-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fromatter tests for new primitives
- Loading branch information
1 parent
abd10a2
commit c9131dd
Showing
8 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
internal/bcd/formatter/formatter_tests/KT1BcTXqU4TW1tPuujvyWYvnUJ2VrpY3WnzY/code_KT1BcT.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"prim":"parameter","args":[{"prim":"pair","args":[{"prim":"string"},{"prim":"nat"},{"prim":"tx_rollup_l2_address"},{"prim":"address"}]}]},{"prim":"storage","args":[{"prim":"unit"}]},{"prim":"code","args":[[{"prim":"CAR"},{"prim":"UNPAIR","args":[{"int":"4"}]},{"prim":"TICKET_DEPRECATED"},{"prim":"PAIR"},{"prim":"SWAP"},{"prim":"CONTRACT","args":[{"prim":"pair","args":[{"prim":"ticket","args":[{"prim":"string"}]},{"prim":"tx_rollup_l2_address"}]}],"annots":["%deposit"]},[{"prim":"IF_NONE","args":[[[{"prim":"UNIT"},{"prim":"FAILWITH"}]],[]]}],{"prim":"SWAP"},{"prim":"PUSH","args":[{"prim":"mutez"},{"int":"0"}]},{"prim":"SWAP"},{"prim":"TRANSFER_TOKENS"},{"prim":"UNIT"},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"DIG","args":[{"int":"2"}]},{"prim":"CONS"},{"prim":"PAIR"}]]}] |
18 changes: 18 additions & 0 deletions
18
internal/bcd/formatter/formatter_tests/KT1BcTXqU4TW1tPuujvyWYvnUJ2VrpY3WnzY/code_KT1BcT.tz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
parameter (pair string nat tx_rollup_l2_address address); | ||
storage unit; | ||
code { CAR ; | ||
UNPAIR 4 ; | ||
TICKET_DEPRECATED ; | ||
PAIR ; | ||
SWAP ; | ||
CONTRACT %deposit (pair (ticket string) tx_rollup_l2_address) ; | ||
{ IF_NONE { { UNIT ; FAILWITH } } {} } ; | ||
SWAP ; | ||
PUSH mutez 0 ; | ||
SWAP ; | ||
TRANSFER_TOKENS ; | ||
UNIT ; | ||
NIL operation ; | ||
DIG 2 ; | ||
CONS ; | ||
PAIR } |
1 change: 1 addition & 0 deletions
1
internal/bcd/formatter/formatter_tests/KT1LfmcX6usZoHYNf9LPrBL1sYCGDDeuApJq/code_KT1Lfm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"prim":"parameter","args":[{"prim":"or","args":[{"prim":"or","args":[{"prim":"chest","annots":["%commit"]},{"prim":"pair","args":[{"prim":"address","annots":["%target"]},{"prim":"chest_key","annots":["%proposedKey"]}],"annots":["%reveal"]}]},{"prim":"unit","annots":["%roll"]}]}]},{"prim":"storage","args":[{"prim":"pair","args":[{"prim":"nat","annots":["%lotterykey"]},{"prim":"pair","args":[{"prim":"nat","annots":["%chest_time"]},{"prim":"map","args":[{"prim":"address"},{"prim":"pair","args":[{"prim":"chest","annots":["%randomhash"]},{"prim":"bool","annots":["%revealed"]}]}],"annots":["%participants"]}]}]}]},{"prim":"code","args":[[{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"DIG","args":[{"int":"1"}]},{"prim":"UNPAIR"},{"prim":"DIP","args":[[{"prim":"UNPAIR","args":[{"int":"3"}]}]]},{"prim":"IF_LEFT","args":[[{"prim":"IF_LEFT","args":[[{"prim":"PUSH","args":[{"prim":"mutez"},{"int":"1000000"}]},{"prim":"AMOUNT"},{"prim":"COMPARE"},{"prim":"GE"},{"prim":"NOT"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"Entry cost is 1tz"}]},{"prim":"FAILWITH"}],[]]},{"prim":"DUP","args":[{"int":"4"}]},{"prim":"SENDER"},{"prim":"MEM"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"participants"}]},{"prim":"PUSH","args":[{"prim":"string"},{"string":"KeyExists"}]},{"prim":"PAIR"},{"prim":"FAILWITH"}],[{"prim":"DUP","args":[{"int":"4"}]},{"prim":"PUSH","args":[{"prim":"bool"},{"prim":"False"}]},{"prim":"DUP","args":[{"int":"3"}]},{"prim":"PAIR"},{"prim":"SOME"},{"prim":"SENDER"},{"prim":"UPDATE"},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"3"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"3"}]}]]},{"prim":"DROP"},{"prim":"PAIR","args":[{"int":"3"}]},{"prim":"DIG","args":[{"int":"1"}]},{"prim":"PAIR"}],[{"prim":"UNPAIR"},{"prim":"SWAP"},{"prim":"PUSH","args":[{"prim":"timestamp"},{"int":"1654436582"}]},{"prim":"NOW"},{"prim":"COMPARE"},{"prim":"LT"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"The lottery has been closed"}]},{"prim":"FAILWITH"}],[]]},{"prim":"DUP","args":[{"int":"5"}]},{"prim":"SENDER"},{"prim":"GET"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"participants"}]},{"prim":"PUSH","args":[{"prim":"string"},{"string":"AssetNotFound"}]},{"prim":"PAIR"},{"prim":"FAILWITH"}],[]]},{"prim":"CDR"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"You have already revealed your key"}]},{"prim":"FAILWITH"}],[]]},{"prim":"DUP","args":[{"int":"4"}]},{"prim":"DUP","args":[{"int":"6"}]},{"prim":"DUP","args":[{"int":"4"}]},{"prim":"GET"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"participants"}]},{"prim":"PUSH","args":[{"prim":"string"},{"string":"AssetNotFound"}]},{"prim":"PAIR"},{"prim":"FAILWITH"}],[]]},{"prim":"CAR"},{"prim":"DUP","args":[{"int":"3"}]},{"prim":"OPEN_CHEST"},{"prim":"IF_LEFT","args":[[{"prim":"DUP"},{"prim":"UNPACK","args":[{"prim":"nat"}]},{"prim":"IF_NONE","args":[[{"prim":"DUP","args":[{"int":"6"}]},{"prim":"NONE","args":[{"prim":"pair","args":[{"prim":"chest"},{"prim":"bool"}]}]},{"prim":"DUP","args":[{"int":"5"}]},{"prim":"UPDATE"},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"5"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"5"}]}],[{"prim":"DUP"},{"prim":"DUP","args":[{"int":"6"}]},{"prim":"ADD"},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"4"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"4"}]},{"prim":"DUP","args":[{"int":"7"}]},{"prim":"DUP","args":[{"int":"8"}]},{"prim":"SENDER"},{"prim":"GET"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"participants"}]},{"prim":"PUSH","args":[{"prim":"string"},{"string":"AssetNotFound"}]},{"prim":"PAIR"},{"prim":"FAILWITH"}],[]]},{"prim":"UNPAIR"},{"prim":"SWAP"},{"prim":"DROP"},{"prim":"PUSH","args":[{"prim":"bool"},{"prim":"True"}]},{"prim":"SWAP"},{"prim":"PAIR"},{"prim":"SOME"},{"prim":"SENDER"},{"prim":"UPDATE"},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"6"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"6"}]},{"prim":"DROP"}]]},{"prim":"DROP"}],[{"prim":"DUP"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"INVALID_CHEST_KEY"}]},{"prim":"FAILWITH"}],[{"prim":"DUP","args":[{"int":"6"}]},{"prim":"NONE","args":[{"prim":"pair","args":[{"prim":"chest"},{"prim":"bool"}]}]},{"prim":"DUP","args":[{"int":"5"}]},{"prim":"UPDATE"},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"5"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"5"}]}]]},{"prim":"DROP"}]]},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"DUP","args":[{"int":"8"}]},{"prim":"ITER","args":[[{"prim":"CONS"}]]},{"prim":"SENDER"},{"prim":"CONTRACT","args":[{"prim":"unit"}]},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"EntryNotFound"}]},{"prim":"FAILWITH"}],[]]},{"prim":"PUSH","args":[{"prim":"mutez"},{"int":"350000"}]},{"prim":"UNIT"},{"prim":"TRANSFER_TOKENS"},{"prim":"CONS"},{"prim":"ITER","args":[[{"prim":"CONS"}]]},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"5"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"5"}]},{"prim":"DROP","args":[{"int":"2"}]},{"prim":"PAIR","args":[{"int":"3"}]},{"prim":"DIG","args":[{"int":"1"}]},{"prim":"PAIR"}]]}],[{"prim":"DROP"},{"prim":"PUSH","args":[{"prim":"address"},{"string":"tz1f8jaMYrtQ1qRv7JG5ZX6AJEtTzaDUT2vk"}]},{"prim":"SENDER"},{"prim":"COMPARE"},{"prim":"EQ"},{"prim":"NOT"},{"prim":"IF","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"InvalidCaller"}]},{"prim":"FAILWITH"}],[]]},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"DUP","args":[{"int":"6"}]},{"prim":"ITER","args":[[{"prim":"CONS"}]]},{"prim":"NONE","args":[{"prim":"address"}]},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"0"}]},{"prim":"PAIR"},{"prim":"DUP","args":[{"int":"6"}]},{"prim":"ITER","args":[[{"prim":"UNPAIR"},{"prim":"DUP","args":[{"int":"8"}]},{"prim":"SIZE"},{"prim":"INT"},{"prim":"DUP","args":[{"int":"7"}]},{"prim":"INT"},{"prim":"EDIV"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"DivByZero"}]},{"prim":"FAILWITH"}],[{"prim":"DUP"},{"prim":"CDR"},{"prim":"SWAP"},{"prim":"DROP"}]]},{"prim":"DUP","args":[{"int":"4"}]},{"prim":"CAR"},{"prim":"COMPARE"},{"prim":"EQ"},{"prim":"IF","args":[[{"prim":"DUP"},{"prim":"SOME"},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"1"}]},{"prim":"DUP","args":[{"int":"5"}]},{"prim":"CAR"},{"prim":"ADD"},{"prim":"PAIR"}],[{"prim":"DUP","args":[{"int":"3"}]},{"prim":"CDR"},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"1"}]},{"prim":"DUP","args":[{"int":"5"}]},{"prim":"CAR"},{"prim":"ADD"},{"prim":"PAIR"}]]},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"2"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"2"}]},{"prim":"DROP","args":[{"int":"2"}]}]]},{"prim":"CDR"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"NotFound"}]},{"prim":"FAILWITH"}],[]]},{"prim":"CONTRACT","args":[{"prim":"unit"}]},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"string"},{"string":"EntryNotFound"}]},{"prim":"FAILWITH"}],[]]},{"prim":"BALANCE"},{"prim":"UNIT"},{"prim":"TRANSFER_TOKENS"},{"prim":"CONS"},{"prim":"ITER","args":[[{"prim":"CONS"}]]},{"prim":"DIP","args":[[{"prim":"DIG","args":[{"int":"3"}]},{"prim":"DROP"}]]},{"prim":"DUG","args":[{"int":"3"}]},{"prim":"PAIR","args":[{"int":"3"}]},{"prim":"DIG","args":[{"int":"1"}]},{"prim":"PAIR"}]]}]]}] |
175 changes: 175 additions & 0 deletions
175
internal/bcd/formatter/formatter_tests/KT1LfmcX6usZoHYNf9LPrBL1sYCGDDeuApJq/code_KT1Lfm.tz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
parameter (or (or (chest %commit) (pair %reveal (address %target) (chest_key %proposedKey))) | ||
(unit %roll)); | ||
storage (pair (nat %lotterykey) | ||
(pair (nat %chest_time) | ||
(map %participants address (pair (chest %randomhash) (bool %revealed))))); | ||
code { NIL operation ; | ||
DIG 1 ; | ||
UNPAIR ; | ||
DIP { UNPAIR 3 } ; | ||
IF_LEFT | ||
{ IF_LEFT | ||
{ PUSH mutez 1000000 ; | ||
AMOUNT ; | ||
COMPARE ; | ||
GE ; | ||
NOT ; | ||
IF { PUSH string "Entry cost is 1tz" ; FAILWITH } {} ; | ||
DUP 4 ; | ||
SENDER ; | ||
MEM ; | ||
IF | ||
{ PUSH string "participants" ; PUSH string "KeyExists" ; PAIR ; FAILWITH } | ||
{ DUP 4 ; | ||
PUSH bool False ; | ||
DUP 3 ; | ||
PAIR ; | ||
SOME ; | ||
SENDER ; | ||
UPDATE ; | ||
DIP { DIG 3 ; DROP } ; | ||
DUG 3 } ; | ||
DROP ; | ||
PAIR 3 ; | ||
DIG 1 ; | ||
PAIR } | ||
{ UNPAIR ; | ||
SWAP ; | ||
PUSH timestamp 1654436582 ; | ||
NOW ; | ||
COMPARE ; | ||
LT ; | ||
IF { PUSH string "The lottery has been closed" ; FAILWITH } {} ; | ||
DUP 5 ; | ||
SENDER ; | ||
GET ; | ||
IF_NONE | ||
{ PUSH string "participants" ; PUSH string "AssetNotFound" ; PAIR ; FAILWITH } | ||
{} ; | ||
CDR ; | ||
IF { PUSH string "You have already revealed your key" ; FAILWITH } {} ; | ||
DUP 4 ; | ||
DUP 6 ; | ||
DUP 4 ; | ||
GET ; | ||
IF_NONE | ||
{ PUSH string "participants" ; PUSH string "AssetNotFound" ; PAIR ; FAILWITH } | ||
{} ; | ||
CAR ; | ||
DUP 3 ; | ||
OPEN_CHEST ; | ||
IF_LEFT | ||
{ DUP ; | ||
UNPACK nat ; | ||
IF_NONE | ||
{ DUP 6 ; | ||
NONE (pair chest bool) ; | ||
DUP 5 ; | ||
UPDATE ; | ||
DIP { DIG 5 ; DROP } ; | ||
DUG 5 } | ||
{ DUP ; | ||
DUP 6 ; | ||
ADD ; | ||
DIP { DIG 4 ; DROP } ; | ||
DUG 4 ; | ||
DUP 7 ; | ||
DUP 8 ; | ||
SENDER ; | ||
GET ; | ||
IF_NONE | ||
{ PUSH string "participants" ; | ||
PUSH string "AssetNotFound" ; | ||
PAIR ; | ||
FAILWITH } | ||
{} ; | ||
UNPAIR ; | ||
SWAP ; | ||
DROP ; | ||
PUSH bool True ; | ||
SWAP ; | ||
PAIR ; | ||
SOME ; | ||
SENDER ; | ||
UPDATE ; | ||
DIP { DIG 6 ; DROP } ; | ||
DUG 6 ; | ||
DROP } ; | ||
DROP } | ||
{ DUP ; | ||
IF | ||
{ PUSH string "INVALID_CHEST_KEY" ; FAILWITH } | ||
{ DUP 6 ; | ||
NONE (pair chest bool) ; | ||
DUP 5 ; | ||
UPDATE ; | ||
DIP { DIG 5 ; DROP } ; | ||
DUG 5 } ; | ||
DROP } ; | ||
NIL operation ; | ||
NIL operation ; | ||
DUP 8 ; | ||
ITER { CONS } ; | ||
SENDER ; | ||
CONTRACT unit ; | ||
IF_NONE { PUSH string "EntryNotFound" ; FAILWITH } {} ; | ||
PUSH mutez 350000 ; | ||
UNIT ; | ||
TRANSFER_TOKENS ; | ||
CONS ; | ||
ITER { CONS } ; | ||
DIP { DIG 5 ; DROP } ; | ||
DUG 5 ; | ||
DROP 2 ; | ||
PAIR 3 ; | ||
DIG 1 ; | ||
PAIR } } | ||
{ DROP ; | ||
PUSH address "tz1f8jaMYrtQ1qRv7JG5ZX6AJEtTzaDUT2vk" ; | ||
SENDER ; | ||
COMPARE ; | ||
EQ ; | ||
NOT ; | ||
IF { PUSH string "InvalidCaller" ; FAILWITH } {} ; | ||
NIL operation ; | ||
NIL operation ; | ||
DUP 6 ; | ||
ITER { CONS } ; | ||
NONE address ; | ||
PUSH nat 0 ; | ||
PAIR ; | ||
DUP 6 ; | ||
ITER { UNPAIR ; | ||
DUP 8 ; | ||
SIZE ; | ||
INT ; | ||
DUP 7 ; | ||
INT ; | ||
EDIV ; | ||
IF_NONE | ||
{ PUSH string "DivByZero" ; FAILWITH } | ||
{ DUP ; CDR ; SWAP ; DROP } ; | ||
DUP 4 ; | ||
CAR ; | ||
COMPARE ; | ||
EQ ; | ||
IF | ||
{ DUP ; SOME ; PUSH nat 1 ; DUP 5 ; CAR ; ADD ; PAIR } | ||
{ DUP 3 ; CDR ; PUSH nat 1 ; DUP 5 ; CAR ; ADD ; PAIR } ; | ||
DIP { DIG 2 ; DROP } ; | ||
DUG 2 ; | ||
DROP 2 } ; | ||
CDR ; | ||
IF_NONE { PUSH string "NotFound" ; FAILWITH } {} ; | ||
CONTRACT unit ; | ||
IF_NONE { PUSH string "EntryNotFound" ; FAILWITH } {} ; | ||
BALANCE ; | ||
UNIT ; | ||
TRANSFER_TOKENS ; | ||
CONS ; | ||
ITER { CONS } ; | ||
DIP { DIG 3 ; DROP } ; | ||
DUG 3 ; | ||
PAIR 3 ; | ||
DIG 1 ; | ||
PAIR } } |
1 change: 1 addition & 0 deletions
1
internal/bcd/formatter/formatter_tests/KT1U4Gb8FjnmyyiUxu4Uy5iFuBRzp4ezbYa7/code_KT1U4G.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"prim":"parameter","args":[{"prim":"or","args":[{"prim":"unit","annots":["%auto_call"]},{"prim":"ticket","args":[{"prim":"int"}],"annots":["%run"]}]}]},{"prim":"storage","args":[{"prim":"pair","args":[{"prim":"option","args":[{"prim":"ticket","args":[{"prim":"int"}]}],"annots":["%x"]},{"prim":"option","args":[{"prim":"ticket","args":[{"prim":"string"}]}],"annots":["%y"]}]}]},{"prim":"code","args":[[{"prim":"UNPAIR"},{"prim":"IF_LEFT","args":[[{"prim":"DROP"},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"43"}]},{"prim":"PUSH","args":[{"prim":"int"},{"int":"1"}]},{"prim":"TICKET_DEPRECATED"},{"prim":"NIL","args":[{"prim":"operation"}]},{"prim":"SELF","annots":["%run"]},{"prim":"PUSH","args":[{"prim":"mutez"},{"int":"0"}]},{"prim":"DIG","args":[{"int":"3"}]},{"prim":"TRANSFER_TOKENS"},{"prim":"CONS"}],[{"prim":"READ_TICKET"},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"42"}]},{"prim":"PUSH","args":[{"prim":"string"},{"string":"abc"}]},{"prim":"TICKET_DEPRECATED"},{"prim":"DIG","args":[{"int":"3"}]},{"prim":"SWAP"},{"prim":"SOME"},{"prim":"SWAP"},{"prim":"CAR"},{"prim":"PAIR"},{"prim":"DUG","args":[{"int":"2"}]},{"prim":"GET","args":[{"int":"4"}]},{"prim":"DUP"},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"3"}]},{"prim":"SWAP"},{"prim":"EDIV"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"int"},{"int":"20"}]},{"prim":"FAILWITH"}],[{"prim":"CAR"}]]},{"prim":"SWAP"},{"prim":"DUP"},{"prim":"DUG","args":[{"int":"2"}]},{"prim":"SUB"},{"prim":"ISNAT"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"int"},{"int":"20"}]},{"prim":"FAILWITH"}],[]]},{"prim":"PUSH","args":[{"prim":"nat"},{"int":"3"}]},{"prim":"DIG","args":[{"int":"2"}]},{"prim":"EDIV"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"int"},{"int":"20"}]},{"prim":"FAILWITH"}],[{"prim":"CAR"}]]},{"prim":"PAIR"},{"prim":"SWAP"},{"prim":"SPLIT_TICKET"},{"prim":"IF_NONE","args":[[{"prim":"PUSH","args":[{"prim":"int"},{"int":"20"}]},{"prim":"FAILWITH"}],[]]},{"prim":"UNPAIR"},{"prim":"SWAP"},{"prim":"PAIR"},{"prim":"JOIN_TICKETS"},{"prim":"SWAP"},{"prim":"CDR"},{"prim":"SWAP"},{"prim":"PAIR"},{"prim":"NIL","args":[{"prim":"operation"}]}]]},{"prim":"PAIR"}]]}] |
55 changes: 55 additions & 0 deletions
55
internal/bcd/formatter/formatter_tests/KT1U4Gb8FjnmyyiUxu4Uy5iFuBRzp4ezbYa7/code_KT1U4G.tz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
parameter (or (unit %auto_call) (ticket %run int)); | ||
storage (pair (option %x (ticket int)) (option %y (ticket string))); | ||
code { UNPAIR ; | ||
IF_LEFT | ||
{ DROP ; | ||
PUSH nat 43 ; | ||
PUSH int 1 ; | ||
TICKET_DEPRECATED ; | ||
NIL operation ; | ||
SELF %run ; | ||
PUSH mutez 0 ; | ||
DIG 3 ; | ||
TRANSFER_TOKENS ; | ||
CONS } | ||
{ READ_TICKET ; | ||
PUSH nat 42 ; | ||
PUSH string "abc" ; | ||
TICKET_DEPRECATED ; | ||
DIG 3 ; | ||
SWAP ; | ||
SOME ; | ||
SWAP ; | ||
CAR ; | ||
PAIR ; | ||
DUG 2 ; | ||
GET 4 ; | ||
DUP ; | ||
PUSH nat 3 ; | ||
SWAP ; | ||
EDIV ; | ||
IF_NONE { PUSH int 20 ; FAILWITH } { CAR } ; | ||
SWAP ; | ||
DUP ; | ||
DUG 2 ; | ||
SUB ; | ||
ISNAT ; | ||
IF_NONE { PUSH int 20 ; FAILWITH } {} ; | ||
PUSH nat 3 ; | ||
DIG 2 ; | ||
EDIV ; | ||
IF_NONE { PUSH int 20 ; FAILWITH } { CAR } ; | ||
PAIR ; | ||
SWAP ; | ||
SPLIT_TICKET ; | ||
IF_NONE { PUSH int 20 ; FAILWITH } {} ; | ||
UNPAIR ; | ||
SWAP ; | ||
PAIR ; | ||
JOIN_TICKETS ; | ||
SWAP ; | ||
CDR ; | ||
SWAP ; | ||
PAIR ; | ||
NIL operation } ; | ||
PAIR } |