Passing SET_DELEGATE test for PascaLIGO
This commit is contained in:
parent
20285f2b9e
commit
fdeb95288d
@ -852,6 +852,7 @@ module Typer = struct
|
|||||||
| C_ADDRESS -> ok @@ address ;
|
| C_ADDRESS -> ok @@ address ;
|
||||||
| C_SELF_ADDRESS -> ok @@ self_address;
|
| C_SELF_ADDRESS -> ok @@ self_address;
|
||||||
| C_IMPLICIT_ACCOUNT -> ok @@ implicit_account;
|
| 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
|
| _ -> 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_ADDRESS -> ok @@ simple_constant @@ prim I_ADDRESS
|
||||||
| C_SELF_ADDRESS -> ok @@ simple_constant @@ seq [prim I_SELF; 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_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_NOW -> ok @@ simple_constant @@ prim I_NOW
|
||||||
| C_CALL -> ok @@ simple_ternary @@ prim I_TRANSFER_TOKENS
|
| C_CALL -> ok @@ simple_ternary @@ prim I_TRANSFER_TOKENS
|
||||||
| C_SOURCE -> ok @@ simple_constant @@ prim I_SOURCE
|
| C_SOURCE -> ok @@ simple_constant @@ prim I_SOURCE
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
function main (const p: key_hash) : list(operation) is
|
function main (const p: key_hash) : list(operation) is
|
||||||
begin
|
begin
|
||||||
set_delegate(p) ;
|
const unused: operation = set_delegate(Some(p)) ;
|
||||||
const dummy: list(operation) = nil;
|
const dummy: list(operation) = nil;
|
||||||
end with dummy
|
end with dummy
|
||||||
|
|
||||||
|
@ -1761,7 +1761,7 @@ let set_delegate () : unit result =
|
|||||||
let (raw_pkh,_,_) = Signature.generate_key () in
|
let (raw_pkh,_,_) = Signature.generate_key () in
|
||||||
let pkh_str = Signature.Public_key_hash.to_b58check raw_pkh 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 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 ()
|
in ok ()
|
||||||
|
|
||||||
let main = test_suite "Integration (End to End)" [
|
let main = test_suite "Integration (End to End)" [
|
||||||
|
Loading…
Reference in New Issue
Block a user