From 66c1e51cb25e2f61b0595b9c96b510ce51ddc9b0 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 26 May 2020 15:38:41 +0200 Subject: [PATCH] updating tests --- src/bin/expect_tests/michelson_converter.ml | 121 +++++++++++++++++--- 1 file changed, 108 insertions(+), 13 deletions(-) diff --git a/src/bin/expect_tests/michelson_converter.ml b/src/bin/expect_tests/michelson_converter.ml index cc055ee24..b8a6cd90e 100644 --- a/src/bin/expect_tests/michelson_converter.ml +++ b/src/bin/expect_tests/michelson_converter.ml @@ -208,20 +208,115 @@ let%expect_test _ = run_ligo_good [ "compile-contract" ; (contract "double_fold_converter.religo") ; "main" ] ; [%expect {| { parameter - (or (pair %option1 (string %bar) (nat %baz)) (pair %option2 (string %bar) (nat %baz))) ; - storage nat ; + (list (pair (address %from_) + (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) ; + storage (big_map nat address) ; code { DUP ; + CDR ; + DIG 1 ; + DUP ; + DUG 2 ; CAR ; - IF_LEFT - { DUP ; LEFT (pair (string %bar) (nat %baz)) ; DIP { DROP } } - { DUP ; RIGHT (pair (string %bar) (nat %baz)) ; DIP { DROP } } ; + ITER { SWAP ; + PAIR ; + DUP ; + CDR ; + DUP ; + CAR ; + SENDER ; + DIG 1 ; + DUP ; + DUG 2 ; + COMPARE ; + NEQ ; + IF { PUSH string "NOT_OWNER" ; FAILWITH } { PUSH unit Unit } ; + DIG 1 ; + DUP ; + DUG 2 ; + DIG 4 ; + DUP ; + DUG 5 ; + CAR ; + PAIR ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + ITER { SWAP ; + PAIR ; + DUP ; + CAR ; + DIG 1 ; + DUP ; + DUG 2 ; + CDR ; + DIG 1 ; + DUP ; + DUG 2 ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CAR ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CDR ; + PAIR ; + PAIR ; + DIG 2 ; + DUP ; + DUG 3 ; + DIG 1 ; + DUP ; + DUG 2 ; + CDR ; + GET ; + IF_NONE + { PUSH string "TOKEN_UNDEFINED" ; FAILWITH } + { DIG 2 ; + DUP ; + DUG 3 ; + DIG 1 ; + DUP ; + DUG 2 ; + COMPARE ; + EQ ; + IF { DUP } { PUSH string "INSUFFICIENT_BALANCE" ; FAILWITH } ; + DIP { DROP } } ; + DIG 2 ; + DUP ; + DUG 3 ; + DIG 4 ; + DUP ; + DUG 5 ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + CDR ; + SOME ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + UPDATE ; + PAIR ; + DIP { DROP 7 } } ; + DUP ; + CAR ; + DIP { DROP 5 } } ; DUP ; - IF_LEFT - { DUP ; LEFT (pair (string %bar) (nat %baz)) ; DIP { DROP } } - { DUP ; RIGHT (pair (string %bar) (nat %baz)) ; DIP { DROP } } ; - DIP { DROP } ; - DUP ; - IF_LEFT - { DUP ; CDR ; NIL operation ; PAIR ; DIP { DROP } } - { DUP ; CDR ; NIL operation ; PAIR ; DIP { DROP } } ; + NIL operation ; + PAIR ; DIP { DROP 2 } } } |}] \ No newline at end of file