Expose address operator in PascaLIGO and CameLIGO

This commit is contained in:
John David Pressman 2019-11-29 02:54:52 -08:00 committed by Gabriel Alfour
parent 694c3aea97
commit 03dd86c9ad
4 changed files with 14 additions and 0 deletions

View File

@ -73,6 +73,7 @@ module Simplify = struct
("unit" , "UNIT") ; ("unit" , "UNIT") ;
("source" , "SOURCE") ; ("source" , "SOURCE") ;
("sender" , "SENDER") ; ("sender" , "SENDER") ;
("address", "ADDRESS") ;
("implicit_account", "IMPLICIT_ACCOUNT") ; ("implicit_account", "IMPLICIT_ACCOUNT") ;
("failwith" , "FAILWITH") ; ("failwith" , "FAILWITH") ;
("bitwise_or" , "OR") ; ("bitwise_or" , "OR") ;
@ -137,6 +138,7 @@ module Simplify = struct
("gas", "STEPS_TO_QUOTA") ; ("gas", "STEPS_TO_QUOTA") ;
("Current.sender" , "SENDER") ; ("Current.sender" , "SENDER") ;
("sender", "SENDER") ; ("sender", "SENDER") ;
("Current.address", "ADDRESS") ;
("Current.implicit_account", "IMPLICIT_ACCOUNT") ; ("Current.implicit_account", "IMPLICIT_ACCOUNT") ;
("Current.source" , "SOURCE") ; ("Current.source" , "SOURCE") ;
("source", "SOURCE") ; ("source", "SOURCE") ;

View File

@ -0,0 +1 @@
function main (const c: contract(unit)) : address is address(c)

View File

@ -0,0 +1 @@
let main (c: unit contract) : address = Current.address c

View File

@ -1233,6 +1233,14 @@ let balance_constant_mligo () : unit result =
let expected = e_tuple [e_list []; e_mutez 4000000000000] in let expected = e_tuple [e_list []; e_mutez 4000000000000] in
expect_eq program "main" input expected expect_eq program "main" input expected
let address () : unit result =
let%bind _ = type_file "./contracts/address.ligo" in
ok ()
let address_mligo () : unit result =
let%bind _ = mtype_file "./contracts/address.mligo" in
ok ()
let implicit_account () : unit result = let implicit_account () : unit result =
let%bind _ = type_file "./contracts/implicit_account.ligo" in let%bind _ = type_file "./contracts/implicit_account.ligo" in
ok () ok ()
@ -1406,6 +1414,8 @@ let main = test_suite "Integration (End to End)" [
test "let multiple (mligo)" mligo_let_multiple ; test "let multiple (mligo)" mligo_let_multiple ;
test "balance constant" balance_constant ; test "balance constant" balance_constant ;
test "balance constant (mligo)" balance_constant_mligo ; test "balance constant (mligo)" balance_constant_mligo ;
test "address" address ;
test "address_mligo" address_mligo ;
test "implicit account" implicit_account ; test "implicit account" implicit_account ;
test "implicit account (mligo)" implicit_account_mligo ; test "implicit account (mligo)" implicit_account_mligo ;
test "is_nat" is_nat ; test "is_nat" is_nat ;