diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index cc24882f4..c2b49cdb1 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -852,6 +852,7 @@ module Typer = struct | C_ADDRESS -> ok @@ address ; | C_SELF_ADDRESS -> ok @@ self_address; | C_IMPLICIT_ACCOUNT -> ok @@ implicit_account; + | C_SET_DELEGATE -> ok @@ set_delegate ; | _ -> simple_fail @@ Format.asprintf "Typer not implemented for consant %a" Stage_common.PP.constant c @@ -924,6 +925,7 @@ module Compiler = struct | C_ADDRESS -> ok @@ simple_constant @@ prim I_ADDRESS | C_SELF_ADDRESS -> ok @@ simple_constant @@ seq [prim I_SELF; prim I_ADDRESS] | C_IMPLICIT_ACCOUNT -> ok @@ simple_unary @@ prim I_IMPLICIT_ACCOUNT + | C_SET_DELEGATE -> ok @@ simple_unary @@ prim I_SET_DELEGATE | C_NOW -> ok @@ simple_constant @@ prim I_NOW | C_CALL -> ok @@ simple_ternary @@ prim I_TRANSFER_TOKENS | C_SOURCE -> ok @@ simple_constant @@ prim I_SOURCE diff --git a/src/test/contracts/set_delegate.ligo b/src/test/contracts/set_delegate.ligo index 68e541861..32f571741 100644 --- a/src/test/contracts/set_delegate.ligo +++ b/src/test/contracts/set_delegate.ligo @@ -1,6 +1,6 @@ function main (const p: key_hash) : list(operation) is begin - set_delegate(p) ; + const unused: operation = set_delegate(Some(p)) ; const dummy: list(operation) = nil; end with dummy diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 9d772b736..ccbf873e9 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -1761,7 +1761,7 @@ let set_delegate () : unit result = let (raw_pkh,_,_) = Signature.generate_key () in let pkh_str = Signature.Public_key_hash.to_b58check raw_pkh in let%bind program = type_file "./contracts/set_delegate.ligo" in - let%bind () = expect_eq program "main" (e_string pkh_str) (e_typed_list [] t_operation) + let%bind () = expect_eq program "main" (e_key_hash pkh_str) (e_typed_list [] t_operation) in ok () let main = test_suite "Integration (End to End)" [