Skip to content

Commit ebeafaf

Browse files
authored
Merge pull request #939 from multiversx/egld-balance-after
mandos - egld balance after back transfer
2 parents 6c7eed2 + 8ec203e commit ebeafaf

18 files changed

+828
-71
lines changed

integrationTests/json/scenariosFeatures_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,11 @@ func TestForwarderTransfExecFallibleMultiReject(t *testing.T) {
173173
Run().
174174
CheckNoError()
175175
}
176+
177+
func TestBalanceAfterGet(t *testing.T) {
178+
ScenariosTest(t).
179+
Folder("features/composability/scenarios").
180+
File("forwarder_call_sync_retrieve_bt_multi.scen.json").
181+
Run().
182+
CheckNoError()
183+
}

test/factorial/output/factorial-dbg.mxsc.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

test/features/basic-features/output/basic-features-barnard.mxsc.json

Lines changed: 81 additions & 2 deletions
Large diffs are not rendered by default.

test/features/basic-features/output/basic-features.mxsc.json

Lines changed: 81 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"steps": [
3+
{
4+
"step": "setState",
5+
"accounts": {
6+
"sc:mmap-features": {
7+
"nonce": "0",
8+
"balance": "0",
9+
"storage": {
10+
"str:mm-num-entries": "3",
11+
"str:mm-key|u32:0": "str:key0",
12+
"str:mm-value|u32:0": "str:value0",
13+
"str:mm-key|u32:1": "str:key1",
14+
"str:mm-value|u32:1": "",
15+
"str:mm-key|u32:2": "",
16+
"str:mm-value|u32:2": "str:value2"
17+
},
18+
"code": "mxsc:../output/basic-features.mxsc.json"
19+
},
20+
"address:an-account": {
21+
"nonce": "0"
22+
}
23+
}
24+
},
25+
{
26+
"step": "scCall",
27+
"id": "get 0",
28+
"tx": {
29+
"from": "address:an-account",
30+
"to": "sc:mmap-features",
31+
"function": "mm_get",
32+
"arguments": [
33+
"str:key0"
34+
],
35+
"gasLimit": "50,000,000",
36+
"gasPrice": "0"
37+
},
38+
"expect": {
39+
"out": [
40+
"str:value0"
41+
]
42+
}
43+
},
44+
{
45+
"step": "scCall",
46+
"id": "contains 0",
47+
"tx": {
48+
"from": "address:an-account",
49+
"to": "sc:mmap-features",
50+
"function": "mm_contains",
51+
"arguments": [
52+
"str:key0"
53+
],
54+
"gasLimit": "50,000,000",
55+
"gasPrice": "0"
56+
},
57+
"expect": {
58+
"out": [
59+
"true"
60+
]
61+
}
62+
},
63+
{
64+
"step": "scCall",
65+
"id": "get 1",
66+
"tx": {
67+
"from": "address:an-account",
68+
"to": "sc:mmap-features",
69+
"function": "mm_get",
70+
"arguments": [
71+
"str:key1"
72+
],
73+
"gasLimit": "50,000,000",
74+
"gasPrice": "0"
75+
},
76+
"expect": {
77+
"out": [
78+
""
79+
]
80+
}
81+
},
82+
{
83+
"step": "scCall",
84+
"id": "contains 1",
85+
"tx": {
86+
"from": "address:an-account",
87+
"to": "sc:mmap-features",
88+
"function": "mm_contains",
89+
"arguments": [
90+
"str:key1"
91+
],
92+
"gasLimit": "50,000,000",
93+
"gasPrice": "0"
94+
},
95+
"expect": {
96+
"out": [
97+
"false"
98+
]
99+
}
100+
},
101+
{
102+
"step": "scCall",
103+
"id": "get unknown",
104+
"tx": {
105+
"from": "address:an-account",
106+
"to": "sc:mmap-features",
107+
"function": "mm_get",
108+
"arguments": [
109+
"str:unknown"
110+
],
111+
"gasLimit": "50,000,000",
112+
"gasPrice": "0"
113+
},
114+
"expect": {
115+
"out": [
116+
""
117+
]
118+
}
119+
},
120+
{
121+
"step": "scCall",
122+
"id": "contains unknown",
123+
"tx": {
124+
"from": "address:an-account",
125+
"to": "sc:mmap-features",
126+
"function": "mm_contains",
127+
"arguments": [
128+
"str:unknown"
129+
],
130+
"gasLimit": "50,000,000",
131+
"gasPrice": "0"
132+
},
133+
"expect": {
134+
"out": [
135+
"false"
136+
]
137+
}
138+
}
139+
]
140+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"steps": [
3+
{
4+
"step": "setState",
5+
"accounts": {
6+
"address:owner": {
7+
"nonce": "1",
8+
"balance": "100"
9+
}
10+
}
11+
},
12+
{
13+
"step": "setState",
14+
"accounts": {
15+
"sc:managed-map-features": {
16+
"nonce": "1",
17+
"balance": "100",
18+
"storage": {
19+
"str:mm-num-entries": "3",
20+
"str:mm-key|u32:0": "str:key0",
21+
"str:mm-value|u32:0": "str:value0",
22+
"str:mm-key|u32:1": "str:key1",
23+
"str:mm-value|u32:1": "",
24+
"str:mm-key|u32:2": "",
25+
"str:mm-value|u32:2": "str:value2"
26+
},
27+
"code": "mxsc:../output/basic-features.mxsc.json",
28+
"owner": "address:owner"
29+
}
30+
}
31+
},
32+
{
33+
"step": "scQuery",
34+
"id": "",
35+
"tx": {
36+
"to": "sc:managed-map-features",
37+
"function": "mm_mutable_input_test",
38+
"arguments": [
39+
"str:new-key",
40+
"str:new-value"
41+
]
42+
},
43+
"expect": {
44+
"out": [
45+
"str:new-value",
46+
""
47+
],
48+
"status": "0"
49+
}
50+
},
51+
{
52+
"step": "scQuery",
53+
"id": "",
54+
"tx": {
55+
"to": "sc:managed-map-features",
56+
"function": "mm_mutable_input_test",
57+
"arguments": [
58+
"str:key0",
59+
"str:updated-value"
60+
]
61+
},
62+
"expect": {
63+
"out": [
64+
"str:updated-value",
65+
""
66+
],
67+
"status": "0"
68+
}
69+
}
70+
]
71+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"steps": [
3+
{
4+
"step": "setState",
5+
"accounts": {
6+
"sc:mmap-features": {
7+
"nonce": "0",
8+
"balance": "0",
9+
"storage": {
10+
"str:mm-num-entries": "4",
11+
"str:mm-key|u32:0": "str:key0",
12+
"str:mm-value|u32:0": "str:value0",
13+
"str:mm-key|u32:1": "str:key1",
14+
"str:mm-value|u32:1": "",
15+
"str:mm-key|u32:2": "",
16+
"str:mm-value|u32:2": "str:value2",
17+
"str:mm-key|u32:3": "str:key3",
18+
"str:mm-value|u32:3": "str:value3"
19+
},
20+
"code": "mxsc:../output/basic-features.mxsc.json"
21+
},
22+
"address:an-account": {
23+
"nonce": "0"
24+
}
25+
}
26+
},
27+
{
28+
"step": "scCall",
29+
"id": "remove/get 0",
30+
"tx": {
31+
"from": "address:an-account",
32+
"to": "sc:mmap-features",
33+
"function": "mm_remove_get",
34+
"arguments": [
35+
"str:key0",
36+
"str:key0"
37+
],
38+
"gasLimit": "50,000,000",
39+
"gasPrice": "0"
40+
},
41+
"expect": {
42+
"out": [
43+
"str:value0",
44+
""
45+
]
46+
}
47+
},
48+
{
49+
"step": "scCall",
50+
"id": "remove/get 1",
51+
"tx": {
52+
"from": "address:an-account",
53+
"to": "sc:mmap-features",
54+
"function": "mm_remove_get",
55+
"arguments": [
56+
"str:key1",
57+
"str:key1"
58+
],
59+
"gasLimit": "50,000,000",
60+
"gasPrice": "0"
61+
},
62+
"expect": {
63+
"out": [
64+
"",
65+
""
66+
]
67+
}
68+
},
69+
{
70+
"step": "scCall",
71+
"id": "remove/get 2",
72+
"tx": {
73+
"from": "address:an-account",
74+
"to": "sc:mmap-features",
75+
"function": "mm_remove_get",
76+
"arguments": [
77+
"",
78+
""
79+
],
80+
"gasLimit": "50,000,000",
81+
"gasPrice": "0"
82+
},
83+
"expect": {
84+
"out": [
85+
"str:value2",
86+
""
87+
]
88+
}
89+
},
90+
{
91+
"step": "scCall",
92+
"id": "remove/get unaffected",
93+
"tx": {
94+
"from": "address:an-account",
95+
"to": "sc:mmap-features",
96+
"function": "mm_remove_get",
97+
"arguments": [
98+
"str:key0",
99+
"str:key3"
100+
],
101+
"gasLimit": "50,000,000",
102+
"gasPrice": "0"
103+
},
104+
"expect": {
105+
"out": [
106+
"str:value0",
107+
"str:value3"
108+
]
109+
}
110+
}
111+
]
112+
}

0 commit comments

Comments
 (0)