@@ -13,8 +13,8 @@ TEST_F(state_transition, call_value_to_empty)
13
13
rev = EVMC_LONDON;
14
14
static constexpr auto BENEFICIARY = 0xbe_address;
15
15
tx.to = To;
16
- pre. insert (*tx. to , {.balance = 1 , .code = call (BENEFICIARY).value (1 )}) ;
17
- pre. insert ( BENEFICIARY, {}) ;
16
+ pre[To] = {.balance = 1 , .code = call (BENEFICIARY).value (1 )};
17
+ pre[ BENEFICIARY] = {} ;
18
18
19
19
expect.post [To].balance = 0 ;
20
20
expect.post [BENEFICIARY].balance = 1 ;
@@ -24,29 +24,29 @@ TEST_F(state_transition, delegatecall_static_legacy)
24
24
{
25
25
rev = EVMC_PRAGUE;
26
26
// Checks if DELEGATECALL forwards the "static" flag.
27
- constexpr auto callee1 = 0xca11ee01_address;
28
- constexpr auto callee2 = 0xca11ee02_address;
29
- pre.insert (callee2, {
30
- .storage = {{0x01_bytes32, 0xdd_bytes32}},
31
- .code = sstore (1 , 0xcc_bytes32),
32
- });
33
- pre.insert (callee1, {
34
- .storage = {{0x01_bytes32, 0xdd_bytes32}},
35
- .code = ret (delegatecall (callee2).gas (100'000 )),
36
- });
37
-
27
+ static constexpr auto CALLEE1 = 0xca11ee01_address;
28
+ static constexpr auto CALLEE2 = 0xca11ee02_address;
29
+ pre[CALLEE2] = {
30
+ .storage = {{0x01_bytes32, 0xdd_bytes32}},
31
+ .code = sstore (1 , 0xcc_bytes32),
32
+ };
33
+ pre[CALLEE1] = {
34
+ .storage = {{0x01_bytes32, 0xdd_bytes32}},
35
+ .code = ret (delegatecall (CALLEE2).gas (100'000 )),
36
+ };
38
37
tx.to = To;
39
- pre.insert (*tx.to , {
40
- .storage = {{0x01_bytes32, 0xdd_bytes32}, {0x02_bytes32, 0xdd_bytes32}},
41
- .code = sstore (1 , staticcall (callee1).gas (200'000 )) +
42
- sstore (2 , returndatacopy (0 , 0 , returndatasize ()) + mload (0 )),
43
- });
38
+ pre[To] = {
39
+ .storage = {{0x01_bytes32, 0xdd_bytes32}, {0x02_bytes32, 0xdd_bytes32}},
40
+ .code = sstore (1 , staticcall (CALLEE1).gas (200'000 )) +
41
+ sstore (2 , returndatacopy (0 , 0 , returndatasize ()) + mload (0 )),
42
+ };
43
+
44
44
expect.gas_used = 131480 ;
45
45
// Outer call - success.
46
- expect.post [*tx. to ].storage [0x01_bytes32] = 0x01_bytes32;
46
+ expect.post [To ].storage [0x01_bytes32] = 0x01_bytes32;
47
47
// Inner call - no success.
48
- expect.post [*tx. to ].storage [0x02_bytes32] = 0x00_bytes32;
48
+ expect.post [To ].storage [0x02_bytes32] = 0x00_bytes32;
49
49
// SSTORE failed.
50
- expect.post [callee1 ].storage [0x01_bytes32] = 0xdd_bytes32;
51
- expect.post [callee2 ].storage [0x01_bytes32] = 0xdd_bytes32;
50
+ expect.post [CALLEE1 ].storage [0x01_bytes32] = 0xdd_bytes32;
51
+ expect.post [CALLEE2 ].storage [0x01_bytes32] = 0xdd_bytes32;
52
52
}
0 commit comments