Skip to content
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 mandos for non payable malfunction #842

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/multiversx/mx-chain-core-go v1.2.18
github.com/multiversx/mx-chain-crypto-go v1.2.9
github.com/multiversx/mx-chain-logger-go v1.0.13
github.com/multiversx/mx-chain-scenario-go v1.4.1
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240413152730-7374ba129c4f
github.com/multiversx/mx-chain-vm-common-go v1.5.11
github.com/multiversx/mx-components-big-int v1.0.0
github.com/pelletier/go-toml v1.9.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/multiversx/mx-chain-crypto-go v1.2.9 h1:OEfF2kOQrtzUl273Z3DEcshjlTVUf
github.com/multiversx/mx-chain-crypto-go v1.2.9/go.mod h1:fkaWKp1rbQN9wPKya5jeoRyC+c/SyN/NfggreyeBw+8=
github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpAXmqjT02klNT/JnY=
github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk=
github.com/multiversx/mx-chain-scenario-go v1.4.1 h1:CrVXb1aNBRiFfSfpoMAUoGUy2aNXke5WnoesLdFxC2g=
github.com/multiversx/mx-chain-scenario-go v1.4.1/go.mod h1:Sdgz8nzA9Ki/pdY/e2a4k90LALBKQB1Eo8HeCV3Bkzo=
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240413152730-7374ba129c4f h1:4vKDKnuh/mrfTxckac7yVcR86R4ZQcdjl1YG/tWT/lw=
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240413152730-7374ba129c4f/go.mod h1:Sdgz8nzA9Ki/pdY/e2a4k90LALBKQB1Eo8HeCV3Bkzo=
github.com/multiversx/mx-chain-vm-common-go v1.5.11 h1:rAQR00ALKOmWAuNA8XW8hR02M9gmrAE4WZwyJH4dMMU=
github.com/multiversx/mx-chain-vm-common-go v1.5.11/go.mod h1:T04rZt/VdwjPXcXVxltMmDmrhxNXsqlByYbWNWcNLYA=
github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
Expand Down
121 changes: 121 additions & 0 deletions test/features/payable-features/scenarios/payable_token_5.scen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"name": "payable",
"gasSchedule": "v3",
"steps": [
{
"step": "setState",
"accounts": {
"sc:payable-features": {
"nonce": "0",
"balance": "0",
"code": "mxsc:../output/payable-features.mxsc.json",
"codeMetadata": "0x0000"
},
"address:an-account": {
"nonce": "0",
"balance": "1,000,000,000,000",
"esdt": {
"str:PAYABLE-FEATURES-TOKEN": "1,000,000,000,000",
"str:OTHER-TOKEN": "1,000,000,000,000"
}
}
}
},
{
"step": "scCall",
"id": "payable_token_1.1",
"tx": {
"from": "address:an-account",
"to": "sc:payable-features",
"function": "payable_token_1",
"arguments": [],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [],
"status": "4",
"message": "str:function expects single ESDT payment",
"logs": "*",
"gas": "*",
"refund": "*"
}
},
{
"step": "scCall",
"id": "payable_token_1.2",
"tx": {
"from": "address:an-account",
"to": "sc:payable-features",
"egldValue": "5",
"function": "payable_token_1",
"arguments": [],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [],
"status": "4",
"message": "str:function expects single ESDT payment",
"logs": "*",
"gas": "*",
"refund": "*"
}
},
{
"step": "scCall",
"id": "payable_token_1.3",
"tx": {
"from": "address:an-account",
"to": "sc:payable-features",
"esdtValue": [
{
"tokenIdentifier": "str:PAYABLE-FEATURES-TOKEN",
"value": "100"
}
],
"function": "payable_token_1",
"arguments": [],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [
"0x64",
"0x50415941424c452d46454154555245532d544f4b454e"
],
"status": "0",
"message": "",
"logs": "*",
"gas": "*",
"refund": "*"
}
},
{
"step": "scCall",
"id": "payable_token_1.4",
"tx": {
"from": "address:an-account",
"to": "sc:payable-features",
"esdtValue": [
{
"tokenIdentifier": "str:OTHER-TOKEN",
"value": "100"
}
],
"function": "payable_token_1",
"arguments": [],
"gasLimit": "50,000,000",
"gasPrice": "0"
},
"expect": {
"out": [],
"status": "4",
"message": "str:bad call value token provided",
"logs": "*",
"gas": "*",
"refund": "*"
}
}
]
}
Loading