Compare commits

...

13 Commits

Author SHA1 Message Date
Hans Svensson 1975ccf804 Merge pull request #322 from aeternity/prepare_6.0.1
Prepare 6.0.1
2021-06-24 09:38:05 +02:00
Hans Svensson 4f68729631 Prepare v6.0.1 2021-06-24 09:34:05 +02:00
Denis Davidyuk 10c845d3cf Use consistent event definitions between examples 2021-06-24 09:34:05 +02:00
Hans Svensson 393d7710c1 Merge pull request #318 from aeternity/stdlib-tests
Fix Frac library and add stdlib compilation test
2021-06-24 09:29:12 +02:00
Hans Svensson 37e5a92b2e Merge pull request #314 from aeternity/call-fee-doc
Call.fee doc
2021-06-24 09:28:17 +02:00
Hans Svensson cb9c9df103 Merge pull request #321 from aeternity/calldata-fix
Fix calldata
2021-06-24 09:19:05 +02:00
radrow c09313a92c newline 2021-06-22 17:55:31 +02:00
radrow 75b2d6981f Fix calldata 2021-06-22 17:54:05 +02:00
Hans Svensson 78d94786b6 Merge pull request #320 from aeternity/nikita-fuchs-patch-1
fix child contract deployment example
2021-06-22 14:52:36 +02:00
Nikita Fuchs 216f7f8a25 fix child contract deployment example 2021-06-22 14:47:58 +02:00
radrow 254172e3a3 Properly refer the stdlib 2021-06-02 17:06:36 +02:00
radrow eadb4e8c83 Fix Frac library and add stdlib compilation test 2021-06-02 17:03:23 +02:00
radrow 3996b6a711 Call.fee doc 2021-05-25 10:53:40 +02:00
9 changed files with 45 additions and 10 deletions
+1
View File
@@ -21,3 +21,4 @@ rebar3.crashdump
aesophia aesophia
.qcci .qcci
current_counterexample.eqc current_counterexample.eqc
test/contracts/test.aes
+7 -1
View File
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
### Removed ### Removed
## [6.0.1] 2021-06-24
### Changed
- Fixed a bug in calldata encoding for contracts containing multiple contracts
- Fixed a missing `include` in the `Frac` standard library
## [6.0.0] 2021-05-26 ## [6.0.0] 2021-05-26
### Added ### Added
- Child contracts - Child contracts
@@ -298,7 +303,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Simplify calldata creation - instead of passing a compiled contract, simply - Simplify calldata creation - instead of passing a compiled contract, simply
pass a (stubbed) contract string. pass a (stubbed) contract string.
[Unreleased]: https://github.com/aeternity/aesophia/compare/v6.0.0...HEAD [Unreleased]: https://github.com/aeternity/aesophia/compare/v6.0.1...HEAD
[6.0.1]: https://github.com/aeternity/aesophia/compare/v6.0.0...v6.0.1
[6.0.0]: https://github.com/aeternity/aesophia/compare/v5.0.0...v6.0.0 [6.0.0]: https://github.com/aeternity/aesophia/compare/v5.0.0...v6.0.0
[5.0.0]: https://github.com/aeternity/aesophia/compare/v4.3.0...v5.0.0 [5.0.0]: https://github.com/aeternity/aesophia/compare/v4.3.0...v5.0.0
[4.3.0]: https://github.com/aeternity/aesophia/compare/v4.2.0...v4.3.0 [4.3.0]: https://github.com/aeternity/aesophia/compare/v4.2.0...v4.3.0
+3 -3
View File
@@ -194,7 +194,7 @@ contract IntHolder =
entrypoint get() = state entrypoint get() = state
main contract IntHolderFactory = main contract IntHolderFactory =
entrypoint new(x : int) : IntHolder = stateful entrypoint new(x : int) : IntHolder =
let ih = Chain.create(x) : IntHolder let ih = Chain.create(x) : IntHolder
ih ih
``` ```
@@ -802,8 +802,8 @@ will emit one Event of each kind in the example.
```sophia ```sophia
entrypoint emit_events() : () = entrypoint emit_events() : () =
Chain.event(TheFirstEvent(42)) Chain.event(Event1(42, 34, "foo"))
Chain.event(AnotherEvent(Contract.address, "This is not indexed")) Chain.event(Event2("This is not indexed", Contract.address))
``` ```
#### Argument order #### Argument order
+10 -2
View File
@@ -645,7 +645,7 @@ Call.value : int
The amount of coins transferred to the contract in the call. The amount of coins transferred to the contract in the call.
#### gas #### gas_price
``` ```
Call.gas_price : int Call.gas_price : int
``` ```
@@ -653,7 +653,15 @@ Call.gas_price : int
The gas price of the current call. The gas price of the current call.
#### gas #### fee
```
Call.fee : int
```
The fee of the current call.
#### gas_left
``` ```
Call.gas_left() : int Call.gas_left() : int
``` ```
+2
View File
@@ -1,3 +1,5 @@
include "String.aes"
namespace Frac = namespace Frac =
private function gcd(a : int, b : int) = private function gcd(a : int, b : int) =
+1 -1
View File
@@ -15,7 +15,7 @@
{base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]} {base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]}
]}. ]}.
{relx, [{release, {aesophia, "6.0.0"}, {relx, [{release, {aesophia, "6.0.1"},
[aesophia, aebytecode, getopt]}, [aesophia, aebytecode, getopt]},
{dev_mode, true}, {dev_mode, true},
+2 -1
View File
@@ -244,8 +244,9 @@ check_call1(ContractString0, FunName, Args, Options) ->
fate -> fate ->
%% First check the contract without the __call function %% First check the contract without the __call function
#{ fcode := OrgFcode #{ fcode := OrgFcode
, fcode_env := #{child_con_env := ChildContracts}
, ast := Ast } = string_to_code(ContractString0, Options), , ast := Ast } = string_to_code(ContractString0, Options),
FateCode = aeso_fcode_to_fate:compile(OrgFcode, []), FateCode = aeso_fcode_to_fate:compile(ChildContracts, OrgFcode, []),
%% collect all hashes and compute the first name without hash collision to %% collect all hashes and compute the first name without hash collision to
SymbolHashes = maps:keys(aeb_fate_code:symbols(FateCode)), SymbolHashes = maps:keys(aeb_fate_code:symbols(FateCode)),
CallName = first_none_match(?CALL_NAME, SymbolHashes, CallName = first_none_match(?CALL_NAME, SymbolHashes,
+2 -2
View File
@@ -1,6 +1,6 @@
{application, aesophia, {application, aesophia,
[{description, "Contract Language for aeternity"}, [{description, "Compiler for Aeternity Sophia language"},
{vsn, "6.0.0"}, {vsn, "6.0.1"},
{registered, []}, {registered, []},
{applications, {applications,
[kernel, [kernel,
+17
View File
@@ -90,6 +90,23 @@ simple_compile_test_() ->
end} || Backend <- [aevm, fate] ] ++ end} || Backend <- [aevm, fate] ] ++
[]. [].
%% Check if all modules in the standard library compile
stdlib_test_() ->
{ok, Files} = file:list_dir(aeso_stdlib:stdlib_include_path()),
[ { "Testing " ++ File ++ " from the stdlib",
fun() ->
String = "include \"" ++ File ++ "\"\nmain contract Test =\n entrypoint f(x) = x",
Options = [{src_file, File}, {backend, fate}],
case aeso_compiler:from_string(String, Options) of
{ok, #{fate_code := Code}} ->
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
?assertMatch({X, X}, {Code1, Code});
{error, Error} -> io:format("\n\n~p\n\n", [Error]), print_and_throw(Error)
end
end} || File <- Files,
lists:suffix(".aes", File)
].
check_errors(no_error, Actual) -> ?assertMatch(#{}, Actual); check_errors(no_error, Actual) -> ?assertMatch(#{}, Actual);
check_errors(Expect, #{}) -> check_errors(Expect, #{}) ->
?assertEqual({error, Expect}, ok); ?assertEqual({error, Expect}, ok);