core/vm, eth: Add support for javascript trace functions
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user