diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/jit_test.go | 11 | ||||
-rw-r--r-- | core/vm/logger_test.go | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/core/vm/jit_test.go b/core/vm/jit_test.go index 5e4bcfeef..809abfea9 100644 --- a/core/vm/jit_test.go +++ b/core/vm/jit_test.go @@ -85,7 +85,7 @@ func TestCompiling(t *testing.T) { func TestResetInput(t *testing.T) { var sender account - env := NewEnv(false, true) + env := NewEnv(&Config{EnableJit: true, ForceJit: true}) contract := NewContract(sender, sender, big.NewInt(100), big.NewInt(10000), big.NewInt(0)) contract.CodeAddr = &common.Address{} @@ -144,7 +144,7 @@ func runVmBench(test vmBench, b *testing.B) { if test.precompile && !test.forcejit { NewProgram(test.code) } - env := NewEnv(test.nojit, test.forcejit) + env := NewEnv(&Config{EnableJit: !test.nojit, ForceJit: test.forcejit}) b.ResetTimer() @@ -166,12 +166,9 @@ type Env struct { evm *EVM } -func NewEnv(noJit, forceJit bool) *Env { +func NewEnv(config *Config) *Env { env := &Env{gasLimit: big.NewInt(10000), depth: 0} - env.evm = New(env, Config{ - EnableJit: !noJit, - ForceJit: forceJit, - }) + env.evm = New(env, *config) return env } diff --git a/core/vm/logger_test.go b/core/vm/logger_test.go index a8c4cbc0b..e85bca227 100644 --- a/core/vm/logger_test.go +++ b/core/vm/logger_test.go @@ -47,7 +47,7 @@ type dummyEnv struct { func newDummyEnv(ref *dummyContractRef) *dummyEnv { return &dummyEnv{ - Env: NewEnv(true, false), + Env: NewEnv(&Config{EnableJit: false, ForceJit: false}), ref: ref, } } @@ -57,7 +57,7 @@ func (d dummyEnv) GetAccount(common.Address) Account { func TestStoreCapture(t *testing.T) { var ( - env = NewEnv(true, false) + env = NewEnv(&Config{EnableJit: false, ForceJit: false}) logger = NewStructLogger(nil) mem = NewMemory() stack = newstack() |