aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/instructions_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/instructions_test.go')
-rw-r--r--core/vm/instructions_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go
index f51e6363f..1643da967 100644
--- a/core/vm/instructions_test.go
+++ b/core/vm/instructions_test.go
@@ -36,6 +36,7 @@ func testTwoOperandOp(t *testing.T, tests []twoOperandTest, opFn func(pc *uint64
stack = newstack()
pc = uint64(0)
)
+ env.interpreter.intPool = poolOfIntPools.get()
for i, test := range tests {
x := new(big.Int).SetBytes(common.Hex2Bytes(test.x))
shift := new(big.Int).SetBytes(common.Hex2Bytes(test.y))
@@ -64,6 +65,7 @@ func testTwoOperandOp(t *testing.T, tests []twoOperandTest, opFn func(pc *uint64
}
}
}
+ poolOfIntPools.put(env.interpreter.intPool)
}
func TestByteOp(t *testing.T) {
@@ -71,6 +73,7 @@ func TestByteOp(t *testing.T) {
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
stack = newstack()
)
+ env.interpreter.intPool = poolOfIntPools.get()
tests := []struct {
v string
th uint64
@@ -97,6 +100,7 @@ func TestByteOp(t *testing.T) {
t.Fatalf("Expected [%v] %v:th byte to be %v, was %v.", test.v, test.th, test.expected, actual)
}
}
+ poolOfIntPools.put(env.interpreter.intPool)
}
func TestSHL(t *testing.T) {
@@ -432,6 +436,7 @@ func TestOpMstore(t *testing.T) {
stack = newstack()
mem = NewMemory()
)
+ env.interpreter.intPool = poolOfIntPools.get()
mem.Resize(64)
pc := uint64(0)
v := "abcdef00000000000000abba000000000deaf000000c0de00100000000133700"
@@ -445,6 +450,7 @@ func TestOpMstore(t *testing.T) {
if common.Bytes2Hex(mem.Get(0, 32)) != "0000000000000000000000000000000000000000000000000000000000000001" {
t.Fatalf("Mstore failed to overwrite previous value")
}
+ poolOfIntPools.put(env.interpreter.intPool)
}
func BenchmarkOpMstore(bench *testing.B) {