@@ -94,7 +94,6 @@ func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFu
9494 var (
9595 env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
9696 stack = newstack ()
97- rstack = newReturnStack ()
9897 pc = uint64 (0 )
9998 evmInterpreter = env .interpreter .(* EVMInterpreter )
10099 )
@@ -105,7 +104,7 @@ func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFu
105104 expected := new (uint256.Int ).SetBytes (common .Hex2Bytes (test .Expected ))
106105 stack .push (x )
107106 stack .push (y )
108- opFn (& pc , evmInterpreter , & callCtx {nil , stack , rstack , nil })
107+ opFn (& pc , evmInterpreter , & callCtx {nil , stack , nil })
109108 if len (stack .data ) != 1 {
110109 t .Errorf ("Expected one item on stack after %v, got %d: " , name , len (stack .data ))
111110 }
@@ -220,7 +219,7 @@ func TestAddMod(t *testing.T) {
220219 stack .push (z )
221220 stack .push (y )
222221 stack .push (x )
223- opAddmod (& pc , evmInterpreter , & callCtx {nil , stack , nil , nil })
222+ opAddmod (& pc , evmInterpreter , & callCtx {nil , stack , nil })
224223 actual := stack .pop ()
225224 if actual .Cmp (expected ) != 0 {
226225 t .Errorf ("Testcase %d, expected %x, got %x" , i , expected , actual )
@@ -231,18 +230,18 @@ func TestAddMod(t *testing.T) {
231230// getResult is a convenience function to generate the expected values
232231func getResult (args []* twoOperandParams , opFn executionFunc ) []TwoOperandTestcase {
233232 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 )
238237 )
239238 result := make ([]TwoOperandTestcase , len (args ))
240239 for i , param := range args {
241240 x := new (uint256.Int ).SetBytes (common .Hex2Bytes (param .x ))
242241 y := new (uint256.Int ).SetBytes (common .Hex2Bytes (param .y ))
243242 stack .push (x )
244243 stack .push (y )
245- opFn (& pc , interpreter , & callCtx {nil , stack , rstack , nil })
244+ opFn (& pc , interpreter , & callCtx {nil , stack , nil })
246245 actual := stack .pop ()
247246 result [i ] = TwoOperandTestcase {param .x , param .y , fmt .Sprintf ("%064x" , actual )}
248247 }
@@ -282,7 +281,7 @@ func TestJsonTestcases(t *testing.T) {
282281func opBenchmark (bench * testing.B , op executionFunc , args ... string ) {
283282 var (
284283 env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
285- stack , rstack = newstack (), newReturnStack ()
284+ stack = newstack ()
286285 evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
287286 )
288287
@@ -300,7 +299,7 @@ func opBenchmark(bench *testing.B, op executionFunc, args ...string) {
300299 a .SetBytes (arg )
301300 stack .push (a )
302301 }
303- op (& pc , evmInterpreter , & callCtx {nil , stack , rstack , nil })
302+ op (& pc , evmInterpreter , & callCtx {nil , stack , nil })
304303 stack .pop ()
305304 }
306305}
@@ -516,7 +515,7 @@ func BenchmarkOpIsZero(b *testing.B) {
516515func TestOpMstore (t * testing.T ) {
517516 var (
518517 env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
519- stack , rstack = newstack (), newReturnStack ()
518+ stack = newstack ()
520519 mem = NewMemory ()
521520 evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
522521 )
@@ -526,12 +525,12 @@ func TestOpMstore(t *testing.T) {
526525 pc := uint64 (0 )
527526 v := "abcdef00000000000000abba000000000deaf000000c0de00100000000133700"
528527 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 })
530529 if got := common .Bytes2Hex (mem .GetCopy (0 , 32 )); got != v {
531530 t .Fatalf ("Mstore fail, got %v, expected %v" , got , v )
532531 }
533532 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 })
535534 if common .Bytes2Hex (mem .GetCopy (0 , 32 )) != "0000000000000000000000000000000000000000000000000000000000000001" {
536535 t .Fatalf ("Mstore failed to overwrite previous value" )
537536 }
@@ -540,7 +539,7 @@ func TestOpMstore(t *testing.T) {
540539func BenchmarkOpMstore (bench * testing.B ) {
541540 var (
542541 env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
543- stack , rstack = newstack (), newReturnStack ()
542+ stack = newstack ()
544543 mem = NewMemory ()
545544 evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
546545 )
@@ -554,14 +553,14 @@ func BenchmarkOpMstore(bench *testing.B) {
554553 bench .ResetTimer ()
555554 for i := 0 ; i < bench .N ; i ++ {
556555 stack .pushN (* value , * memStart )
557- opMstore (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
556+ opMstore (& pc , evmInterpreter , & callCtx {mem , stack , nil })
558557 }
559558}
560559
561560func BenchmarkOpSHA3 (bench * testing.B ) {
562561 var (
563562 env = NewEVM (BlockContext {}, TxContext {}, nil , params .TestChainConfig , Config {})
564- stack , rstack = newstack (), newReturnStack ()
563+ stack = newstack ()
565564 mem = NewMemory ()
566565 evmInterpreter = NewEVMInterpreter (env , env .vmConfig )
567566 )
@@ -573,7 +572,7 @@ func BenchmarkOpSHA3(bench *testing.B) {
573572 bench .ResetTimer ()
574573 for i := 0 ; i < bench .N ; i ++ {
575574 stack .pushN (* uint256 .NewInt ().SetUint64 (32 ), * start )
576- opSha3 (& pc , evmInterpreter , & callCtx {mem , stack , rstack , nil })
575+ opSha3 (& pc , evmInterpreter , & callCtx {mem , stack , nil })
577576 }
578577}
579578
0 commit comments