Skip to content

Commit

Permalink
separate multi egld tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Dec 23, 2024
1 parent e8d9f64 commit 2fd3357
Show file tree
Hide file tree
Showing 7 changed files with 562 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
{
"gasSchedule": "v3",
"steps": [
{
"step": "setState",
"accounts": {
"address:a_user": {
"nonce": "0",
"balance": "0"
},
"sc:forwarder": {
"nonce": "0",
"balance": "0",
"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": "0",
"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: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": "0",
"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": "0",
"esdt": {
"str:FWD-TOKEN": "200",
"str:SFT-456789": {
"instances": [
{
"nonce": "3",
"balance": "4"
}
]
}
},
"code": "mxsc:../forwarder/output/forwarder.mxsc.json"
}
}
}
]
}
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": "*"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@
"from": "address:an-account",
"to": "sc:payable-features",
"esdtValue": [
{
"tokenIdentifier": "str:EGLD-000000",
"value": "15"
},
{
"tokenIdentifier": "str:TOK-123456",
"value": "100"
Expand All @@ -111,7 +107,7 @@
},
"expect": {
"out": [
"15",
"0",
[
"nested:str:TOK-123456|u64:0|biguint:100",
"nested:str:OTHERTOK-123456|u64:0|biguint:400",
Expand All @@ -125,4 +121,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
"tokenIdentifier": "str:SFT-123",
"nonce": "5",
"value": "10"
},
{
"tokenIdentifier": "str:EGLD-000000",
"nonce": "0",
"value": "103"
}
],
"function": "payment_array_3",
Expand Down Expand Up @@ -116,7 +111,7 @@
"value": "100"
},
{
"tokenIdentifier": "str:EGLD-000000",
"tokenIdentifier": "str:TOK-000002",
"value": "400"
},
{
Expand All @@ -133,7 +128,7 @@
"expect": {
"out": [
"nested:str:TOK-000001|u64:0|biguint:100",
"nested:str:EGLD-000000|u64:0|biguint:400",
"nested:str:TOK-000002|u64:0|biguint:400",
"nested:str:SFT-123|u64:5|biguint:10"
],
"status": "",
Expand All @@ -143,4 +138,4 @@
}
}
]
}
}
Loading

0 comments on commit 2fd3357

Please sign in to comment.