Merge branch 'feature/cameligo-implicit-account-regress' into 'dev'

Fix IMPLICIT_ACCOUNT, again and this time add regression expect test

Closes #88

See merge request ligolang/ligo!262
This commit is contained in:
John David Pressman 2019-12-16 21:04:40 +00:00
commit 9c9e0e0a2b
3 changed files with 17 additions and 0 deletions

View File

@ -899,3 +899,16 @@ let%expect_test _ =
PAIR ; PAIR ;
DIP { DROP 5 } } ; DIP { DROP 5 } } ;
DIP { DROP } } } |}] DIP { DROP } } } |}]
let%expect_test _ =
run_ligo_good [ "compile-contract" ; contract "implicit.mligo" ; "main" ] ;
[%expect {|
{ parameter key_hash ;
storage unit ;
code { DUP ;
CAR ;
IMPLICIT_ACCOUNT ;
UNIT ;
NIL operation ;
PAIR ;
DIP { DROP 2 } } } |}]

View File

@ -922,6 +922,7 @@ module Compiler = struct
| C_AMOUNT -> ok @@ simple_constant @@ prim I_AMOUNT | C_AMOUNT -> ok @@ simple_constant @@ prim I_AMOUNT
| 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_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

View File

@ -0,0 +1,3 @@
let main (p : key_hash) (s : unit) =
let c : unit contract = Current.implicit_account p in
(([] : operation list), unit)