Skip to content

Commit

Permalink
Add mandos test for paymaster
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Nov 23, 2023
1 parent 8a17c0d commit c938011
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 0 deletions.
Binary file added test/paymaster/output/paymaster.wasm
Binary file not shown.
179 changes: 179 additions & 0 deletions test/paymaster/scenarios/test_forward_call_wegld.scen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"name": "paymaster",
"comment": "add then check",
"gasSchedule": "v3",
"steps": [
{
"step": "setState",
"accounts": {
"address:user": {
"nonce": "1",
"balance": "0",
"esdt": {
"str:FEE-123456": "100,000,000",
"str:WEGLD-123456": "100,000,000"
}
},
"address:owner": {
"nonce": "1"
},
"address:relayer": {
"nonce": "1",
"balance": "0"
},
"sc:wegld": {
"nonce": "0",
"balance": "100,000,000",
"esdt": {
"str:WEGLD-123456": {
"instances": [
{
"nonce": "",
"balance": "0"
}
],
"roles": [
"ESDTRoleLocalMint",
"ESDTRoleLocalBurn"
]
}
},
"storage": {
"str:wrappedEgldTokenId": "str:WEGLD-123456"
},
"code": "file:../../wegld-swap/output/multiversx-wegld-swap-sc.wasm"
}
},
"newAddresses": [
{
"creatorAddress": "address:owner",
"creatorNonce": "1",
"newAddress": "sc:paymaster"
}
]
},
{
"step": "scDeploy",
"id": "",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/paymaster.wasm",
"arguments": [],
"gasLimit": "5,000,000",
"gasPrice": ""
},
"expect": {
"out": [],
"status": "0"
}
},
{
"step": "checkState",
"accounts": {
"address:user": {
"esdt": {
"str:FEE-123456": "100,000,000",
"str:WEGLD-123456": "100,000,000"
},
"storage": "*",
"code": "*",
"owner": "*",
"nonce": "*",
"balance": "0"
},
"+": ""
}
},
{
"step": "scCall",
"id": "paymaster-forward-execution",
"tx": {
"from": "address:user",
"to": "sc:paymaster",
"esdtValue": [
{
"tokenIdentifier": "str:FEE-123456",
"value": "20,000"
},
{
"tokenIdentifier": "str:WEGLD-123456",
"value": "100,000,000"
}
],
"function": "forwardExecution",
"arguments": [
"0x72656c617965725f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f",
"0x000000000000000000007765676c645f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f",
"0x756e7772617045676c64"
],
"gasLimit": "100,000,000",
"gasPrice": ""
},
"expect": {
"out": [],
"status": "0",
"gas": "*",
"refund": "*"
}
},
{
"step": "checkState",
"accounts": {
"address:relayer": {
"esdt": {
"str:FEE-123456": "20,000",
"str:WEGLD-123456": "0"
},
"storage": "*",
"code": "*",
"owner": "*",
"nonce": "1"
},
"address:user": {
"esdt": {
"str:FEE-123456": "99,980,000"
},
"balance": "100,000,000",
"storage": "*",
"code": "*",
"owner": "*",
"nonce": "2"
},
"sc:paymaster": {
"esdt": {
"str:FEE-123456": "0",
"str:WEGLD-123456": "0"
},
"balance": "0",
"storage": "*",
"code": "*",
"owner": "address:owner",
"nonce": "0"
},
"sc:wegld": {
"esdt": {
"str:FEE-123456": "0",
"str:WEGLD-123456": {
"instances": [
{
"nonce": "",
"balance": "0"
}
],
"roles": [
"ESDTRoleLocalMint",
"ESDTRoleLocalBurn"
]
}
},
"balance": "0",
"storage": "*",
"owner": "*",
"nonce": "0",
"code": "file:../../wegld-swap/output/multiversx-wegld-swap-sc.wasm"
},
"+": ""
}
}
]
}

0 comments on commit c938011

Please sign in to comment.