From 3efde2a2a194935fc1d832b358ecb2dbce8de2e7 Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Fri, 1 Mar 2019 11:36:28 +0100 Subject: [PATCH] handle hash literals when `permissive_address_literals` --- src/aeso_ast_infer_types.erl | 1 + test/aeso_abi_tests.erl | 1 + 2 files changed, 2 insertions(+) diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index 22af695..c247597 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -1655,6 +1655,7 @@ unify1(_Env, A, B, When) -> Kind = fun({qcon, _, _}) -> con; ({con, _, _}) -> con; ({id, _, "address"}) -> addr; + ({id, _, "hash"}) -> hash; ({app_t, _, {id, _, "oracle"}, _}) -> oracle; ({app_t, _, {id, _, "oracle_query"}, _}) -> query; (_) -> other end, diff --git a/test/aeso_abi_tests.erl b/test/aeso_abi_tests.erl index 3993e68..fd0273f 100644 --- a/test/aeso_abi_tests.erl +++ b/test/aeso_abi_tests.erl @@ -97,6 +97,7 @@ calldata_test() -> Map = #{ <<"a">> => 4 }, [{variant, 1, [Map]}, {{<<"b">>, 5}, {variant, 0, []}}] = encode_decode_calldata("foo", ["variant", "r"], ["Blue({[\"a\"] = 4})", "{x = (\"b\", 5), y = Red}"]), + [16#123, 16#456] = encode_decode_calldata("foo", ["hash", "address"], ["#123", "#456"]), ok. calldata_init_test() ->