@@ -94,7 +94,6 @@ func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFu
94
94
var (
95
95
env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
96
96
stack = newstack ()
97
- rstack = newReturnStack ()
98
97
pc = uint64 (0 )
99
98
evmInterpreter = env .interpreter .(* EVMInterpreter )
100
99
)
@@ -105,7 +104,7 @@ func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFu
105
104
expected := new (uint256.Int ).SetBytes (common .Hex2Bytes (test .Expected ))
106
105
stack .push (x )
107
106
stack .push (y )
108
- opFn (& pc , evmInterpreter , & callCtx {nil , stack , rstack , nil })
107
+ opFn (& pc , evmInterpreter , & callCtx {nil , stack , nil })
109
108
if len (stack .data ) != 1 {
110
109
t .Errorf ("Expected one item on stack after %v, got %d: " , name , len (stack .data ))
111
110
}
@@ -220,7 +219,7 @@ func TestAddMod(t *testing.T) {
220
219
stack .push (z )
221
220
stack .push (y )
222
221
stack .push (x )
223
- opAddmod (& pc , evmInterpreter , & callCtx {nil , stack , nil , nil })
222
+ opAddmod (& pc , evmInterpreter , & callCtx {nil , stack , nil })
224
223
actual := stack .pop ()
225
224
if actual .Cmp (expected ) != 0 {
226
225
t .Errorf ("Testcase %d, expected %x, got %x" , i , expected , actual )
@@ -231,18 +230,18 @@ func TestAddMod(t *testing.T) {
231
230
// getResult is a convenience function to generate the expected values
232
231
func getResult (args []* twoOperandParams , opFn executionFunc ) []TwoOperandTestcase {
233
232
var (
234
- env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
235
- stack , rstack = newstack (), newReturnStack ()
236
- pc = uint64 (0 )
237
- interpreter = env .interpreter .(* EVMInterpreter )
233
+ env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
234
+ stack = newstack ()
235
+ pc = uint64 (0 )
236
+ interpreter = env .interpreter .(* EVMInterpreter )
238
237
)
239
238
result := make ([]TwoOperandTestcase , len (args ))
240
239
for i , param := range args {
241
240
x := new (uint256.Int ).SetBytes (common .Hex2Bytes (param .x ))
242
241
y := new (uint256.Int ).SetBytes (common .Hex2Bytes (param .y ))
243
242
stack .push (x )
244
243
stack .push (y )
245
- opFn (& pc , interpreter , & callCtx {nil , stack , rstack , nil })
244
+ opFn (& pc , interpreter , & callCtx {nil , stack , nil })
246
245
actual := stack .pop ()
247
246
result [i ] = TwoOperandTestcase {param .x , param .y , fmt .Sprintf ("%064x" , actual )}
248
247
}
@@ -282,7 +281,7 @@ func TestJsonTestcases(t *testing.T) {
282
281
func opBenchmark (bench * testing.B , op executionFunc , args ... string ) {
283
282
var (
284
283
env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
285
- stack , rstack = newstack (), newReturnStack ()
284
+ stack = newstack ()
286
285
evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
287
286
)
288
287
@@ -300,7 +299,7 @@ func opBenchmark(bench *testing.B, op executionFunc, args ...string) {
300
299
a .SetBytes (arg )
301
300
stack .push (a )
302
301
}
303
- op (& pc , evmInterpreter , & callCtx {nil , stack , rstack , nil })
302
+ op (& pc , evmInterpreter , & callCtx {nil , stack , nil })
304
303
stack .pop ()
305
304
}
306
305
}
@@ -516,7 +515,7 @@ func BenchmarkOpIsZero(b *testing.B) {
516
515
func TestOpMstore (t * testing.T ) {
517
516
var (
518
517
env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
519
- stack , rstack = newstack (), newReturnStack ()
518
+ stack = newstack ()
520
519
mem = NewMemory ()
521
520
evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
522
521
)
@@ -526,12 +525,12 @@ func TestOpMstore(t *testing.T) {
526
525
pc := uint64 (0 )
527
526
v := "abcdef00000000000000abba000000000deaf000000c0de00100000000133700"
528
527
stack .pushN (* new (uint256.Int ).SetBytes (common .Hex2Bytes (v )), * new (uint256.Int ))
529
- opMstore (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
528
+ opMstore (& pc , evmInterpreter , & callCtx {mem , stack , nil })
530
529
if got := common .Bytes2Hex (mem .GetCopy (0 , 32 )); got != v {
531
530
t .Fatalf ("Mstore fail, got %v, expected %v" , got , v )
532
531
}
533
532
stack .pushN (* new (uint256.Int ).SetUint64 (0x1 ), * new (uint256.Int ))
534
- opMstore (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
533
+ opMstore (& pc , evmInterpreter , & callCtx {mem , stack , nil })
535
534
if common .Bytes2Hex (mem .GetCopy (0 , 32 )) != "0000000000000000000000000000000000000000000000000000000000000001" {
536
535
t .Fatalf ("Mstore failed to overwrite previous value" )
537
536
}
@@ -540,7 +539,7 @@ func TestOpMstore(t *testing.T) {
540
539
func BenchmarkOpMstore (bench * testing.B ) {
541
540
var (
542
541
env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
543
- stack , rstack = newstack (), newReturnStack ()
542
+ stack = newstack ()
544
543
mem = NewMemory ()
545
544
evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
546
545
)
@@ -554,14 +553,14 @@ func BenchmarkOpMstore(bench *testing.B) {
554
553
bench .ResetTimer ()
555
554
for i := 0 ; i < bench .N ; i ++ {
556
555
stack .pushN (* value , * memStart )
557
- opMstore (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
556
+ opMstore (& pc , evmInterpreter , & callCtx {mem , stack , nil })
558
557
}
559
558
}
560
559
561
560
func BenchmarkOpSHA3 (bench * testing.B ) {
562
561
var (
563
562
env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
564
- stack , rstack = newstack (), newReturnStack ()
563
+ stack = newstack ()
565
564
mem = NewMemory ()
566
565
evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
567
566
)
@@ -573,7 +572,7 @@ func BenchmarkOpSHA3(bench *testing.B) {
573
572
bench .ResetTimer ()
574
573
for i := 0 ; i < bench .N ; i ++ {
575
574
stack .pushN (* uint256 .NewInt ().SetUint64 (32 ), * start )
576
- opSha3 (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
575
+ opSha3 (& pc , evmInterpreter , & callCtx {mem , stack , nil })
577
576
}
578
577
}
579
578
0 commit comments