Skip to content

Commit

Permalink
scenario self test transfer cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Dec 22, 2024
1 parent 3d20aac commit e8d9f64
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 7 deletions.
100 changes: 100 additions & 0 deletions framework/scenario/tests/scenarios-self/multi-transfer-egld.scen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"comment": "ESDT multi-transfer with EGLD, no SC",
"steps": [
{
"step": "setState",
"accounts": {
"address:A": {
"nonce": "0",
"balance": "1000000000",
"esdt": {
"str:TOK-123456": "150",
"str:OTHERTOK-123456": "500",
"str:NFT-123456": {
"instances": [
{
"nonce": "5",
"balance": "20"
}
]
}
}
},
"address:B": {
"nonce": "0",
"balance": "0"
}
}
},
{
"step": "transfer",
"id": "multi-transfer",
"tx": {
"from": "address:A",
"to": "address:B",
"esdtValue": [
{
"tokenIdentifier": "str:TOK-123456",
"value": "100"
},
{
"tokenIdentifier": "str:OTHERTOK-123456",
"value": "400"
},
{
"tokenIdentifier": "str:EGLD-000000",
"value": "500"
},
{
"tokenIdentifier": "str:NFT-123456",
"nonce": "5",
"value": "10"
}
],
"gasLimit": "0x100000000"
}
},
{
"step": "checkState",
"comment": "check after tx 1",
"accounts": {
"address:A": {
"nonce": "1",
"balance": "999999500",
"esdt": {
"str:TOK-123456": "50",
"str:OTHERTOK-123456": "100",
"str:NFT-123456": {
"instances": [
{
"nonce": "5",
"balance": "10"
}
]
}
},
"storage": {},
"code": ""
},
"address:B": {
"nonce": "0",
"balance": "500",
"esdt": {
"str:TOK-123456": "100",
"str:OTHERTOK-123456": "400",
"str:NFT-123456": {
"instances": [
{
"nonce": "5",
"balance": "10"
}
]
}
},
"storage": {},
"code": ""
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
"tokenIdentifier": "str:OTHERTOK-123456",
"value": "400"
},
{
"tokenIdentifier": "str:EGLD-000000",
"value": "500"
},
{
"tokenIdentifier": "str:NFT-123456",
"nonce": "5",
Expand All @@ -60,7 +56,7 @@
"accounts": {
"address:A": {
"nonce": "1",
"balance": "999999500",
"balance": "1000000000",
"esdt": {
"str:TOK-123456": "50",
"str:OTHERTOK-123456": "100",
Expand All @@ -78,7 +74,6 @@
},
"address:B": {
"nonce": "0",
"balance": "500",
"esdt": {
"str:TOK-123456": "100",
"str:OTHERTOK-123456": "400",
Expand All @@ -97,4 +92,4 @@
}
}
]
}
}
5 changes: 5 additions & 0 deletions framework/scenario/tests/scenarios_self_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ fn esdt_zero_balance_check_err_rs() {

#[test]
#[ignore = "TODO: not yet implemented in Rust VM"]
fn multi_transfer_egld_rs() {
world().run("tests/scenarios-self/multi-transfer-esdt.scen.json");
}

#[test]
fn multi_transfer_esdt_rs() {
world().run("tests/scenarios-self/multi-transfer-esdt.scen.json");
}
Expand Down

0 comments on commit e8d9f64

Please sign in to comment.