@@ -217,9 +217,9 @@ func TestNewStatefulPrecompile(t *testing.T) {
217
217
state .SetBalance (caller , new (uint256.Int ).Not (uint256 .NewInt (0 )))
218
218
evm .Origin = eoa
219
219
220
- // By definition, the raw caller and self are the same, regardless of the
221
- // incoming call type.
222
- rawAddresses := & libevm.CallerAndSelf {
220
+ // By definition, the raw caller and self are the same for every test case,
221
+ // regardless of the incoming call type.
222
+ rawAddresses := libevm.CallerAndSelf {
223
223
Caller : caller ,
224
224
Self : precompile ,
225
225
}
@@ -240,12 +240,9 @@ func TestNewStatefulPrecompile(t *testing.T) {
240
240
return evm .Call (callerContract , precompile , input , gasLimit , transferValue )
241
241
},
242
242
wantAddresses : & libevm.AddressContext {
243
- Origin : eoa ,
244
- EVMSemantic : libevm.CallerAndSelf {
245
- Caller : caller ,
246
- Self : precompile ,
247
- },
248
- Raw : rawAddresses ,
243
+ Origin : eoa ,
244
+ EVMSemantic : rawAddresses ,
245
+ Raw : & rawAddresses ,
249
246
},
250
247
wantReadOnly : false ,
251
248
wantTransferValue : transferValue ,
@@ -262,7 +259,7 @@ func TestNewStatefulPrecompile(t *testing.T) {
262
259
Caller : caller ,
263
260
Self : caller ,
264
261
},
265
- Raw : rawAddresses ,
262
+ Raw : & rawAddresses ,
266
263
},
267
264
wantReadOnly : false ,
268
265
wantTransferValue : transferValue ,
@@ -279,7 +276,7 @@ func TestNewStatefulPrecompile(t *testing.T) {
279
276
Caller : eoa , // inherited from caller
280
277
Self : caller ,
281
278
},
282
- Raw : rawAddresses ,
279
+ Raw : & rawAddresses ,
283
280
},
284
281
wantReadOnly : false ,
285
282
wantTransferValue : uint256 .NewInt (0 ),
@@ -291,12 +288,9 @@ func TestNewStatefulPrecompile(t *testing.T) {
291
288
return evm .StaticCall (callerContract , precompile , input , gasLimit )
292
289
},
293
290
wantAddresses : & libevm.AddressContext {
294
- Origin : eoa ,
295
- EVMSemantic : libevm.CallerAndSelf {
296
- Caller : caller ,
297
- Self : precompile ,
298
- },
299
- Raw : rawAddresses ,
291
+ Origin : eoa ,
292
+ EVMSemantic : rawAddresses ,
293
+ Raw : & rawAddresses ,
300
294
},
301
295
wantReadOnly : true ,
302
296
wantTransferValue : uint256 .NewInt (0 ),
@@ -824,7 +818,7 @@ func TestPrecompileMakeCall(t *testing.T) {
824
818
825
819
for _ , tt := range tests {
826
820
t .Run (tt .incomingCallType .String (), func (t * testing.T ) {
827
- // From the perspective of `dest` after a CALL.
821
+ // From the perspective of `dest` after a CALL from `sut` .
828
822
tt .want .Addresses .Raw = & tt .want .Addresses .EVMSemantic
829
823
830
824
t .Logf ("calldata = %q" , tt .eoaTxCallData )
0 commit comments