eth/tracers: rework the model a bit
This commit is contained in:
@@ -58,7 +58,7 @@ func testCtx() *vmContext {
|
||||
return &vmContext{blockCtx: vm.BlockContext{BlockNumber: big.NewInt(1)}, txCtx: vm.TxContext{GasPrice: big.NewInt(100000)}}
|
||||
}
|
||||
|
||||
func runTrace(tracer *Tracer, vmctx *vmContext, chaincfg *params.ChainConfig) (json.RawMessage, error) {
|
||||
func runTrace(tracer Tracer, vmctx *vmContext, chaincfg *params.ChainConfig) (json.RawMessage, error) {
|
||||
env := vm.NewEVM(vmctx.blockCtx, vmctx.txCtx, &dummyStatedb{}, chaincfg, vm.Config{Debug: true, Tracer: tracer})
|
||||
var (
|
||||
startGas uint64 = 10000
|
||||
@@ -168,7 +168,7 @@ func TestHaltBetweenSteps(t *testing.T) {
|
||||
// TestNoStepExec tests a regular value transfer (no exec), and accessing the statedb
|
||||
// in 'result'
|
||||
func TestNoStepExec(t *testing.T) {
|
||||
runEmptyTrace := func(tracer *Tracer, vmctx *vmContext) (json.RawMessage, error) {
|
||||
runEmptyTrace := func(tracer Tracer, vmctx *vmContext) (json.RawMessage, error) {
|
||||
env := vm.NewEVM(vmctx.blockCtx, vmctx.txCtx, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
|
||||
startGas := uint64(10000)
|
||||
contract := vm.NewContract(account{}, account{}, big.NewInt(0), startGas)
|
||||
@@ -223,7 +223,7 @@ func TestIsPrecompile(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
if string(res) != "false" {
|
||||
t.Errorf("Tracer should not consider blake2f as precompile in byzantium")
|
||||
t.Errorf("JSTracer should not consider blake2f as precompile in byzantium")
|
||||
}
|
||||
|
||||
tracer, _ = New("{addr: toAddress('0000000000000000000000000000000000000009'), res: null, step: function() { this.res = isPrecompiled(this.addr); }, fault: function() {}, result: function() { return this.res; }}", new(Context))
|
||||
@@ -233,7 +233,7 @@ func TestIsPrecompile(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
if string(res) != "true" {
|
||||
t.Errorf("Tracer should consider blake2f as precompile in istanbul")
|
||||
t.Errorf("JSTracer should consider blake2f as precompile in istanbul")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user