diff options
author | Nick Johnson <arachnid@notdot.net> | 2016-08-22 22:03:30 +0800 |
---|---|---|
committer | Nick Johnson <arachnid@notdot.net> | 2016-08-23 22:06:39 +0800 |
commit | 2f9972090165f25f953f986014d78b172e334497 (patch) | |
tree | 4401f3430307f8a4d23cffbc8d983ceefc04a327 /core/vm | |
parent | d8cec35b10e80887aacd68da3d16489bc4cdde69 (diff) | |
download | dexon-2f9972090165f25f953f986014d78b172e334497.tar dexon-2f9972090165f25f953f986014d78b172e334497.tar.gz dexon-2f9972090165f25f953f986014d78b172e334497.tar.bz2 dexon-2f9972090165f25f953f986014d78b172e334497.tar.lz dexon-2f9972090165f25f953f986014d78b172e334497.tar.xz dexon-2f9972090165f25f953f986014d78b172e334497.tar.zst dexon-2f9972090165f25f953f986014d78b172e334497.zip |
core/vm, eth: Add support for javascript trace functions
Diffstat (limited to 'core/vm')
-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() |