cleanup
This commit is contained in:
parent
c8853b2103
commit
5c43be22b9
@ -283,9 +283,9 @@ bind_contract({Contract, Ann, Id, Contents}, Env)
|
|||||||
[ {field_t, Sys, {id, Sys, "address"}, {id, Sys, "address"}} ] ++
|
[ {field_t, Sys, {id, Sys, "address"}, {id, Sys, "address"}} ] ++
|
||||||
[ {field_t, Sys, {id, Sys, ?CONSTRUCTOR_MOCK_NAME},
|
[ {field_t, Sys, {id, Sys, ?CONSTRUCTOR_MOCK_NAME},
|
||||||
contract_call_type(
|
contract_call_type(
|
||||||
case [ {fun_t, [payable|Sys], [], [ArgT || {typed, _, _, ArgT} <- Args], {id, Sys, "void"}}
|
case [ {fun_t, [stateful,payable|Sys], [], [ArgT || {typed, _, _, ArgT} <- Args], {id, Sys, "void"}}
|
||||||
|| {letfun, _, {id, _, "init"}, Args, _, _} <- Contents] of
|
|| {letfun, _, {id, _, "init"}, Args, _, _} <- Contents] of
|
||||||
[] -> {fun_t, [payable|Sys], [], [], {id, Sys, "void"}};
|
[] -> {fun_t, [stateful,payable|Sys], [], [], {id, Sys, "void"}};
|
||||||
[T] -> T
|
[T] -> T
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@ -3092,6 +3092,10 @@ pp_why_record(Fld = {field, _Ann, LV, _E}) ->
|
|||||||
{pos(Fld),
|
{pos(Fld),
|
||||||
io_lib:format("arising from an assignment of the field ~s (at ~s)",
|
io_lib:format("arising from an assignment of the field ~s (at ~s)",
|
||||||
[pp_expr("", {lvalue, [], LV}), pp_loc(Fld)])};
|
[pp_expr("", {lvalue, [], LV}), pp_loc(Fld)])};
|
||||||
|
pp_why_record(Fld = {field, _Ann, LV, _Alias, _E}) ->
|
||||||
|
{pos(Fld),
|
||||||
|
io_lib:format("arising from an assignment of the field ~s (at ~s)",
|
||||||
|
[pp_expr("", {lvalue, [], LV}), pp_loc(Fld)])};
|
||||||
pp_why_record({proj, _Ann, Rec, FldName}) ->
|
pp_why_record({proj, _Ann, Rec, FldName}) ->
|
||||||
{pos(Rec),
|
{pos(Rec),
|
||||||
io_lib:format("arising from the projection of the field ~s (at ~s)",
|
io_lib:format("arising from the projection of the field ~s (at ~s)",
|
||||||
|
@ -707,7 +707,6 @@ expr_to_fcode(Env, _Type, {app, _Ann, {Op, _}, [A]}) when is_atom(Op) ->
|
|||||||
|
|
||||||
%% Function calls
|
%% Function calls
|
||||||
expr_to_fcode(Env, Type, {app, _, Fun = {typed, _, FunE, {fun_t, _, NamedArgsT, ArgsT, _}}, Args}) ->
|
expr_to_fcode(Env, Type, {app, _, Fun = {typed, _, FunE, {fun_t, _, NamedArgsT, ArgsT, _}}, Args}) ->
|
||||||
io:format("Named args: ~p\n", [[N||{named_arg_t, _, {id, _, N}, _, _} <- NamedArgsT]]),
|
|
||||||
Args1 = get_named_args(NamedArgsT, Args),
|
Args1 = get_named_args(NamedArgsT, Args),
|
||||||
FArgs = [expr_to_fcode(Env, Arg) || Arg <- Args1],
|
FArgs = [expr_to_fcode(Env, Arg) || Arg <- Args1],
|
||||||
case expr_to_fcode(Env, Fun) of
|
case expr_to_fcode(Env, Fun) of
|
||||||
|
@ -328,7 +328,6 @@ to_scode1(Env, {remote, ArgsT, RetT, Ct, Fun, [Gas, Value, Protected | Args]}) -
|
|||||||
{ArgTypes, RetType0} = typesig_to_scode([{"_", T} || T <- ArgsT], RetT),
|
{ArgTypes, RetType0} = typesig_to_scode([{"_", T} || T <- ArgsT], RetT),
|
||||||
ArgType = ?i(aeb_fate_data:make_typerep({tuple, ArgTypes})),
|
ArgType = ?i(aeb_fate_data:make_typerep({tuple, ArgTypes})),
|
||||||
RetType = ?i(aeb_fate_data:make_typerep(RetType0)),
|
RetType = ?i(aeb_fate_data:make_typerep(RetType0)),
|
||||||
io:format("GAS: ~p, VALUE: ~p, PROT: ~p\n", [Gas, Value, Protected]),
|
|
||||||
case Protected of
|
case Protected of
|
||||||
{lit, {bool, false}} ->
|
{lit, {bool, false}} ->
|
||||||
case Gas of
|
case Gas of
|
||||||
|
@ -26,14 +26,13 @@ run_test(Test) ->
|
|||||||
simple_compile_test_() ->
|
simple_compile_test_() ->
|
||||||
[ {"Testing the " ++ ContractName ++ " contract with the " ++ atom_to_list(Backend) ++ " backend",
|
[ {"Testing the " ++ ContractName ++ " contract with the " ++ atom_to_list(Backend) ++ " backend",
|
||||||
fun() ->
|
fun() ->
|
||||||
case compile(Backend, ContractName, [pp_assembler]) of
|
case compile(Backend, ContractName) of
|
||||||
#{byte_code := ByteCode,
|
#{byte_code := ByteCode,
|
||||||
contract_source := _,
|
contract_source := _,
|
||||||
type_info := _} when Backend == aevm ->
|
type_info := _} when Backend == aevm ->
|
||||||
?assertMatch(Code when is_binary(Code), ByteCode);
|
?assertMatch(Code when is_binary(Code), ByteCode);
|
||||||
#{fate_code := Code} when Backend == fate ->
|
#{fate_code := Code} when Backend == fate ->
|
||||||
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
|
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
|
||||||
error(xd),
|
|
||||||
?assertMatch({X, X}, {Code1, Code});
|
?assertMatch({X, X}, {Code1, Code});
|
||||||
ErrBin ->
|
ErrBin ->
|
||||||
io:format("\n~s", [ErrBin]),
|
io:format("\n~s", [ErrBin]),
|
||||||
@ -208,7 +207,6 @@ debug_mode_contracts() ->
|
|||||||
-define(TYPE_ERROR(Name, Errs), ?ERROR("Type", Name, Errs)).
|
-define(TYPE_ERROR(Name, Errs), ?ERROR("Type", Name, Errs)).
|
||||||
-define(PARSE_ERROR(Name, Errs), ?ERROR("Parse", Name, Errs)).
|
-define(PARSE_ERROR(Name, Errs), ?ERROR("Parse", Name, Errs)).
|
||||||
|
|
||||||
failing_contracts() -> []; % FIXME remove
|
|
||||||
failing_contracts() ->
|
failing_contracts() ->
|
||||||
{ok, V} = aeso_compiler:numeric_version(),
|
{ok, V} = aeso_compiler:numeric_version(),
|
||||||
Version = list_to_binary(string:join([integer_to_list(N) || N <- V], ".")),
|
Version = list_to_binary(string:join([integer_to_list(N) || N <- V], ".")),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user