Less hacky handling of Chain.event

This commit is contained in:
Ulf Norell
2019-02-08 14:48:38 +01:00
parent 236ef6eb89
commit b5b0d30fc4
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ ast_type(T, Icode) ->
ast_body(?qid_app(["Chain","spend"], [To, Amount], _, _), Icode) ->
prim_call(?PRIM_CALL_SPEND, ast_body(Amount, Icode), [ast_body(To, Icode)], [word], {tuple, []});
ast_body(?qid_app(["Chain","event"], [Event], _, _), Icode) ->
ast_body(?qid_app([Con, "Chain", "event"], [Event], _, _), Icode = #{ contract_name := Con }) ->
aeso_builtins:check_event_type(Icode),
builtin_call({event, maps:get(event_type, Icode)}, [ast_body(Event, Icode)]);