diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index e4dd957..97ce45e 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -148,12 +148,14 @@ global_env() -> {["Map", "delete"], Fun([K, Map(K, V)], Map(K, V))}, {["Map", "member"], Fun([K, Map(K, V)], Bool)}, {["Map", "size"], Fun1(Map(K, V), Int)}, + %% Crypto/Curve operations + {["Crypto", "ecverify"], Fun([Hash, Address, SignId], Bool)}, %% Strings {["String", "length"], Fun1(String, Int)}, {["String", "concat"], Fun([String, String], String)}, - {["String", "sha3"], Fun1(String, Int)}, + {["String", "sha3"], Fun1(String, Hash)}, %% Conversion - {["Int", "to_str"], Fun1(Int, String)}, + {["Int", "to_str"], Fun1(Int, String)}, {["Address", "to_str"], Fun1(Address, String)} ]. diff --git a/src/aeso_ast_to_icode.erl b/src/aeso_ast_to_icode.erl index 77508c0..2a0321f 100644 --- a/src/aeso_ast_to_icode.erl +++ b/src/aeso_ast_to_icode.erl @@ -316,6 +316,12 @@ ast_body({map, _, Map, [Upd]}, Icode) -> ast_body({map, Ann, Map, [Upd | Upds]}, Icode) -> ast_body({map, Ann, {map, Ann, Map, [Upd]}, Upds}, Icode); +%% Crypto +ast_body(?qid_app(["Crypto", "ecverify"], [Msg, PK, Sig], _, _), Icode) -> + prim_call(?PRIM_CALL_CRYPTO_ECVERIFY, #integer{value = 0}, + [ast_body(Msg, Icode), ast_body(PK, Icode), ast_body(Sig, Icode)], + [word, word, sign_t()], word); + %% Strings %% -- String length ast_body(?qid_app(["String", "length"], [String], _, _), Icode) ->