-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8d9f64
commit d96df7d
Showing
8 changed files
with
570 additions
and
30 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
206 changes: 206 additions & 0 deletions
206
.../feature-tests/composability/scenarios/forwarder_call_async_multi_transfer_egld.scen.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,206 @@ | ||
{ | ||
"gasSchedule": "v3", | ||
"steps": [ | ||
{ | ||
"step": "setState", | ||
"accounts": { | ||
"address:a_user": { | ||
"nonce": "0", | ||
"balance": "0" | ||
}, | ||
"sc:forwarder": { | ||
"nonce": "0", | ||
"balance": "4000", | ||
"esdt": { | ||
"str:FWD-TOKEN": "1000", | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1" | ||
} | ||
] | ||
}, | ||
"str:SFT-456789": { | ||
"instances": [ | ||
{ | ||
"nonce": "3", | ||
"balance": "10" | ||
} | ||
] | ||
} | ||
}, | ||
"code": "mxsc:../forwarder/output/forwarder.mxsc.json" | ||
}, | ||
"sc:vault": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"code": "mxsc:../vault/output/vault.mxsc.json" | ||
} | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "1", | ||
"comment": "send fungible twice", | ||
"tx": { | ||
"from": "address:a_user", | ||
"to": "sc:forwarder", | ||
"function": "send_async_accept_multi_transfer", | ||
"arguments": [ | ||
"sc:vault", | ||
"str:FWD-TOKEN", | ||
"0", | ||
"100", | ||
"str:FWD-TOKEN", | ||
"0", | ||
"200" | ||
], | ||
"gasLimit": "80,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "0", | ||
"message": "", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:a_user": { | ||
"nonce": "*", | ||
"balance": "0", | ||
"storage": {}, | ||
"code": "" | ||
}, | ||
"sc:vault": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"esdt": { | ||
"str:FWD-TOKEN": "300" | ||
}, | ||
"storage": { | ||
"str:call_counts|nested:str:accept_funds": "1" | ||
}, | ||
"code": "mxsc:../vault/output/vault.mxsc.json" | ||
}, | ||
"sc:forwarder": { | ||
"nonce": "0", | ||
"balance": "4000", | ||
"esdt": { | ||
"str:FWD-TOKEN": "700", | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1" | ||
} | ||
] | ||
}, | ||
"str:SFT-456789": { | ||
"instances": [ | ||
{ | ||
"nonce": "3", | ||
"balance": "10" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": {}, | ||
"code": "mxsc:../forwarder/output/forwarder.mxsc.json" | ||
} | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "2", | ||
"comment": "send all types", | ||
"tx": { | ||
"from": "address:a_user", | ||
"to": "sc:forwarder", | ||
"function": "send_async_accept_multi_transfer", | ||
"arguments": [ | ||
"sc:vault", | ||
"str:FWD-TOKEN", | ||
"0", | ||
"500", | ||
"str:NFT-123456", | ||
"1", | ||
"1", | ||
"str:EGLD-000000", | ||
"0", | ||
"100", | ||
"str:SFT-456789", | ||
"3", | ||
"6" | ||
], | ||
"gasLimit": "80,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "0", | ||
"message": "", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:a_user": { | ||
"nonce": "*", | ||
"balance": "0", | ||
"storage": {}, | ||
"code": "" | ||
}, | ||
"sc:vault": { | ||
"nonce": "0", | ||
"balance": "100", | ||
"esdt": { | ||
"str:FWD-TOKEN": "800", | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1" | ||
} | ||
] | ||
}, | ||
"str:SFT-456789": { | ||
"instances": [ | ||
{ | ||
"nonce": "3", | ||
"balance": "6" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": { | ||
"str:call_counts|nested:str:accept_funds": "2" | ||
}, | ||
"code": "mxsc:../vault/output/vault.mxsc.json" | ||
}, | ||
"sc:forwarder": { | ||
"nonce": "0", | ||
"balance": "3900", | ||
"esdt": { | ||
"str:FWD-TOKEN": "200", | ||
"str:SFT-456789": { | ||
"instances": [ | ||
{ | ||
"nonce": "3", | ||
"balance": "4" | ||
} | ||
] | ||
} | ||
}, | ||
"code": "mxsc:../forwarder/output/forwarder.mxsc.json" | ||
} | ||
} | ||
} | ||
] | ||
} |
128 changes: 128 additions & 0 deletions
128
contracts/feature-tests/payable-features/scenarios/call-value-check-multi-egld.scen.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,128 @@ | ||
{ | ||
"steps": [ | ||
{ | ||
"step": "setState", | ||
"accounts": { | ||
"sc:payable-features": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"code": "mxsc:../output/payable-features.mxsc.json" | ||
}, | ||
"address:an-account": { | ||
"nonce": "0", | ||
"balance": "10000", | ||
"esdt": { | ||
"str:TOK-123456": "1000", | ||
"str:OTHERTOK-123456": "500", | ||
"str:SFT-123": { | ||
"instances": [ | ||
{ | ||
"nonce": "5", | ||
"balance": "20" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "call-value-egld", | ||
"tx": { | ||
"from": "address:an-account", | ||
"to": "sc:payable-features", | ||
"egldValue": "100", | ||
"function": "echo_call_value", | ||
"arguments": [], | ||
"gasLimit": "50,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [ | ||
"100", | ||
"" | ||
], | ||
"status": "", | ||
"logs": "*", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "call-value-single-esdt", | ||
"tx": { | ||
"from": "address:an-account", | ||
"to": "sc:payable-features", | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:TOK-123456", | ||
"value": "100" | ||
} | ||
], | ||
"function": "echo_call_value", | ||
"arguments": [], | ||
"gasLimit": "50,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [ | ||
"0", | ||
[ | ||
"nested:str:TOK-123456|u64:0|biguint:100" | ||
] | ||
], | ||
"status": "", | ||
"logs": "*", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "call-value-multi-esdt", | ||
"tx": { | ||
"from": "address:an-account", | ||
"to": "sc:payable-features", | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:EGLD-000000", | ||
"value": "15" | ||
}, | ||
{ | ||
"tokenIdentifier": "str:TOK-123456", | ||
"value": "100" | ||
}, | ||
{ | ||
"tokenIdentifier": "str:OTHERTOK-123456", | ||
"value": "400" | ||
}, | ||
{ | ||
"tokenIdentifier": "str:SFT-123", | ||
"nonce": "5", | ||
"value": "10" | ||
} | ||
], | ||
"function": "echo_call_value", | ||
"arguments": [], | ||
"gasLimit": "50,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [ | ||
"15", | ||
[ | ||
"nested:str:TOK-123456|u64:0|biguint:100", | ||
"nested:str:OTHERTOK-123456|u64:0|biguint:400", | ||
"nested:str:SFT-123|u64:5|biguint:10" | ||
] | ||
], | ||
"status": "", | ||
"logs": "*", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.