Skip to content

Commit

Permalink
Merge pull request #791 from multiversx/back-transfer-test
Browse files Browse the repository at this point in the history
Back-transfer Test & API change
  • Loading branch information
andrei-marinica authored Nov 3, 2023
2 parents e8e5903 + e237f43 commit 151f4cf
Show file tree
Hide file tree
Showing 19 changed files with 415 additions and 9 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified test/features/composability/forwarder-raw/output/forwarder-raw.wasm
Binary file not shown.
Binary file modified test/features/composability/forwarder/output/forwarder.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"steps": [
{
"step": "setState",
"accounts": {
"address:a_user": {
"nonce": "0",
"balance": "0"
},
"sc:vault": {
"nonce": "0",
"balance": "1000",
"code": "file:../vault/output/vault.wasm"
},
"sc:forwarder": {
"nonce": "0",
"balance": "0",
"code": "file:../promises-features/output/promises-features.wasm"
}
}
},
{
"step": "scCall",
"id": "1",
"tx": {
"from": "address:a_user",
"to": "sc:forwarder",
"function": "forward_sync_retrieve_funds_bt",
"arguments": [
"sc:vault",
"str:EGLD",
"0",
"1000"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"endpoint": "str:transferValueOnly",
"topics": [
"0",
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:retrieve_funds",
"str:EGLD",
"0",
"1000"
]
},
{
"address": "sc:vault",
"endpoint": "str:retrieve_funds",
"topics": [
"str:retrieve_funds",
"str:EGLD",
"0",
"1000"
],
"data": [
""
]
},
{
"address": "sc:vault",
"endpoint": "str:transferValueOnly",
"topics": [
"1000",
"sc:forwarder"
],
"data": [
"str:BackTransfer",
"0"
]
},
{
"address": "sc:forwarder",
"endpoint": "str:forward_sync_retrieve_funds_bt",
"topics": [
"str:back_tranfers",
"1000"
],
"data": [
""
]
}
],
"gas": "*",
"refund": "*"
}
},
{
"step": "checkState",
"accounts": {
"address:a_user": {
"nonce": "*",
"balance": "0",
"storage": {},
"code": ""
},
"sc:vault": {
"nonce": "0",
"balance": "0",
"storage": {},
"code": "file:../vault/output/vault.wasm"
},
"sc:forwarder": {
"nonce": "0",
"balance": "1000",
"storage": "*",
"code": "file:../promises-features/output/promises-features.wasm"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"steps": [
{
"step": "setState",
"accounts": {
"address:a_user": {
"nonce": "0",
"balance": "0"
},
"sc:vault": {
"nonce": "0",
"balance": "0",
"esdt": {
"str:TEST-TOKENA": "1000"
},
"code": "file:../vault/output/vault.wasm"
},
"sc:forwarder": {
"nonce": "0",
"balance": "0",
"code": "file:../promises-features/output/promises-features.wasm"
}
}
},
{
"step": "scCall",
"id": "1",
"tx": {
"from": "address:a_user",
"to": "sc:forwarder",
"function": "forward_sync_retrieve_funds_bt",
"arguments": [
"sc:vault",
"str:TEST-TOKENA",
"0",
"1000"
],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [],
"status": "0",
"logs": [
{
"address": "sc:forwarder",
"endpoint": "str:transferValueOnly",
"topics": [
"",
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:retrieve_funds",
"str:TEST-TOKENA",
"0",
"1000"
]
},
{
"address": "sc:vault",
"endpoint": "str:retrieve_funds",
"topics": [
"str:retrieve_funds",
"str:TEST-TOKENA",
"0",
"1000"
],
"data": [
""
]
},
{
"address": "sc:vault",
"endpoint": "str:ESDTTransfer",
"topics": [
"str:TEST-TOKENA",
"0",
"1000",
"sc:forwarder"
],
"data": [
"str:BackTransfer",
"str:ESDTTransfer",
"str:TEST-TOKENA",
"1000"
]
},
{
"address": "sc:forwarder",
"endpoint": "str:forward_sync_retrieve_funds_bt",
"topics": [
"str:back_tranfers",
"0",
"str:TEST-TOKENA",
"0",
"1000"
],
"data": [
""
]
}
],
"gas": "*",
"refund": "*"
}
},
{
"step": "checkState",
"accounts": {
"address:a_user": {
"nonce": "*",
"balance": "0",
"storage": {},
"code": ""
},
"sc:vault": {
"nonce": "0",
"balance": "0",
"storage": {},
"code": "file:../vault/output/vault.wasm"
},
"sc:forwarder": {
"nonce": "0",
"balance": "0",
"esdt": {
"str:TEST-TOKENA": "1000"
},
"storage": "*",
"code": "file:../promises-features/output/promises-features.wasm"
}
}
}
]
}
Loading

0 comments on commit 151f4cf

Please sign in to comment.