Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions core/vm/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (

// force-load js tracers to trigger registration
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
"github.com/holiman/uint256"
)

func TestDefaults(t *testing.T) {
Expand Down Expand Up @@ -339,11 +338,7 @@ func benchmarkNonModifyingCode(gas uint64, code []byte, name string, tracerCode
Tracer: tracer.Hooks,
}
}
var (
destination = common.BytesToAddress([]byte("contract"))
vmenv = NewEnv(cfg)
sender = vm.AccountRef(cfg.Origin)
)
destination := common.BytesToAddress([]byte("contract"))
cfg.State.CreateAccount(destination)
eoa := common.HexToAddress("E0")
{
Expand All @@ -363,12 +358,12 @@ func benchmarkNonModifyingCode(gas uint64, code []byte, name string, tracerCode
//cfg.State.CreateAccount(cfg.Origin)
// set the receiver's (the executing contract) code for execution.
cfg.State.SetCode(destination, code)
vmenv.Call(sender, destination, nil, gas, uint256.MustFromBig(cfg.Value))
Call(destination, nil, cfg)

b.Run(name, func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
vmenv.Call(sender, destination, nil, gas, uint256.MustFromBig(cfg.Value))
Call(destination, nil, cfg)
}
})
}
Expand Down