-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add paymaster contract + mandos test #797
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c938011
Add mandos test for paymaster
CostinCarabas 249da29
Paymaster wasm now uses async call
CostinCarabas 55d946f
Merge branch 'master' into paymaster-mandos-test
sasurobert 3475079
fixed back transfers on callBack.
sasurobert 72fc32c
fixed back transfers on callBack.
sasurobert 78ecab4
goimports
sasurobert 071ae47
use constant and safer code
sasurobert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Binary file not shown.
179 changes: 179 additions & 0 deletions
179
test/paymaster/scenarios/test_forward_call_wegld.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,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" | ||
}, | ||
"+": "" | ||
} | ||
} | ||
] | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go imports