aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jit_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/jit_test.go')
-rw-r--r--core/vm/jit_test.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/core/vm/jit_test.go b/core/vm/jit_test.go
index 19261827b..43b1dee2a 100644
--- a/core/vm/jit_test.go
+++ b/core/vm/jit_test.go
@@ -125,17 +125,17 @@ type vmBench struct {
type account struct{}
-func (account) SubBalance(amount *big.Int) {}
-func (account) AddBalance(amount *big.Int) {}
-func (account) SetAddress(common.Address) {}
-func (account) Value() *big.Int { return nil }
-func (account) SetBalance(*big.Int) {}
-func (account) SetNonce(uint64) {}
-func (account) Balance() *big.Int { return nil }
-func (account) Address() common.Address { return common.Address{} }
-func (account) ReturnGas(*big.Int, *big.Int) {}
-func (account) SetCode([]byte) {}
-func (account) EachStorage(cb func(key, value []byte)) {}
+func (account) SubBalance(amount *big.Int) {}
+func (account) AddBalance(amount *big.Int) {}
+func (account) SetAddress(common.Address) {}
+func (account) Value() *big.Int { return nil }
+func (account) SetBalance(*big.Int) {}
+func (account) SetNonce(uint64) {}
+func (account) Balance() *big.Int { return nil }
+func (account) Address() common.Address { return common.Address{} }
+func (account) ReturnGas(*big.Int, *big.Int) {}
+func (account) SetCode([]byte) {}
+func (account) ForEachStorage(cb func(key, value common.Hash) bool) {}
func runVmBench(test vmBench, b *testing.B) {
var sender account
@@ -154,7 +154,7 @@ func runVmBench(test vmBench, b *testing.B) {
context := NewContract(sender, sender, big.NewInt(100), big.NewInt(10000), big.NewInt(0))
context.Code = test.code
context.CodeAddr = &common.Address{}
- _, err := New(env).Run(context, test.input)
+ _, err := env.Vm().Run(context, test.input)
if err != nil {
b.Error(err)
b.FailNow()
@@ -165,12 +165,16 @@ func runVmBench(test vmBench, b *testing.B) {
type Env struct {
gasLimit *big.Int
depth int
+ evm *EVM
}
func NewEnv() *Env {
- return &Env{big.NewInt(10000), 0}
+ env := &Env{gasLimit: big.NewInt(10000), depth: 0}
+ env.evm = New(env, nil)
+ return env
}
+func (self *Env) Vm() Vm { return self.evm }
func (self *Env) Origin() common.Address { return common.Address{} }
func (self *Env) BlockNumber() *big.Int { return big.NewInt(0) }
func (self *Env) AddStructLog(log StructLog) {