Handle negative numbers in aci (#247)

* Handle negative numbers in aci

Fixes aeternity/aesophia_http#59

* Updated CHANGELOG

Updated CHANGELOG1

Co-authored-by: radrow <radrowicki@gmail.com>
This commit is contained in:
Ulf Norell 2020-03-23 18:11:00 +01:00 committed by GitHub
parent 83e03f3013
commit 515838e2f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added ### Added
### Changed ### Changed
- Bug fix: Fixed ACI encoder to handle `-` unary operator
### Removed ### Removed
## [4.2.0] - 2020-01-15 ## [4.2.0] - 2020-01-15

View File

@ -194,6 +194,8 @@ encode_expr({bytes, _, B}) ->
encode_expr({Lit, _, L}) when Lit == oracle_pubkey; Lit == oracle_query_id; encode_expr({Lit, _, L}) when Lit == oracle_pubkey; Lit == oracle_query_id;
Lit == contract_pubkey; Lit == account_pubkey -> Lit == contract_pubkey; Lit == account_pubkey ->
aeser_api_encoder:encode(Lit, L); aeser_api_encoder:encode(Lit, L);
encode_expr({app, _, {'-', _}, [{int, _, N}]}) ->
encode_expr({int, [], -N});
encode_expr({app, _, F, As}) -> encode_expr({app, _, F, As}) ->
Ef = encode_expr(F), Ef = encode_expr(F),
Eas = encode_exprs(As), Eas = encode_exprs(As),