works, needs cleanup

This commit is contained in:
radrow
2021-05-10 15:04:59 +02:00
parent 614c60f04a
commit c8853b2103
5 changed files with 40 additions and 24 deletions
+2 -1
View File
@@ -26,13 +26,14 @@ run_test(Test) ->
simple_compile_test_() ->
[ {"Testing the " ++ ContractName ++ " contract with the " ++ atom_to_list(Backend) ++ " backend",
fun() ->
case compile(Backend, ContractName) of
case compile(Backend, ContractName, [pp_assembler]) of
#{byte_code := ByteCode,
contract_source := _,
type_info := _} when Backend == aevm ->
?assertMatch(Code when is_binary(Code), ByteCode);
#{fate_code := Code} when Backend == fate ->
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
error(xd),
?assertMatch({X, X}, {Code1, Code});
ErrBin ->
io:format("\n~s", [ErrBin]),
+11 -3
View File
@@ -1,6 +1,14 @@
// If you need a quick compiler test — this file is for your playground
contract T =
entrypoint f(x, y) = 3
main contract IntegerAdderFactory =
stateful payable entrypoint calculateSomething(x, t) =
// let t = Chain.create(value = 5555) : T
t.f(protected = true, gas = 999999999, value = 777777, 111, 222)
// t.f()
/*
contract IntegerAdder =
entrypoint init() = unit
entrypoint init() = ()
entrypoint addIntegers(x, y) = x + y
contract IntegerAdderHolder =
@@ -17,4 +25,4 @@ main contract EnterpriseContract =
entrypoint calculateSomething(x) =
let adder = IntegerAdderFactory.new()
adder.addIntegers(x, 2137)
*/