Address review, fix some dialyzer errors

This commit is contained in:
radrow
2021-05-12 20:09:52 +02:00
parent 7898d2a17d
commit 6789b739a5
10 changed files with 123 additions and 88 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ main contract C =
let s1 = Chain.clone(ref=s)
let Some(s2) = Chain.clone(ref=s, protected=true)
let None = Chain.clone(ref=s, protected=true, gas=1)
let None = Chain.clone(ref=l, protected=true, 123)
let None = Chain.clone(ref=l, protected=true, 123) // since it should be HigherOrderState underneath
let s3 = Chain.clone(ref=s1)
require(s1.apply(2137) == 2137, "APPLY_S1_0")
require(s2.apply(2137) == 2137, "APPLY_S2_0")
+5 -7
View File
@@ -1,3 +1,6 @@
// This is a custom test file if you need to run a compiler without
// changing aeso_compiler_tests.erl
include "List.aes"
contract IntegerHolder =
@@ -5,10 +8,5 @@ contract IntegerHolder =
entrypoint init(x) = x
entrypoint get() = state
main contract IntegerCollection =
record state = {template: IntegerHolder, payload: list(IntegerHolder)}
stateful entrypoint init() = {template = Chain.create(0), payload = []}
stateful entrypoint add(x) =
put(state{payload @ p = Chain.clone(ref=state.template, x) :: p})
x
entrypoint sum() = List.sum(List.map((h) => h.get(), state.payload))
main contract Test =
stateful entrypoint f(c) = Chain.clone(ref=c, 123)