cmd/evm: use tracers.Trace instead of vm.EVMLogger

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-11-20 03:03:17 +00:00
parent 2a8b1a8b1a
commit 467f056483
2 changed files with 6 additions and 4 deletions

View file

@ -31,6 +31,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
@ -117,7 +118,7 @@ type rejectedTx struct {
// Apply applies a set of transactions to a pre-state
func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
txIt txIterator, miningReward int64,
getTracerFn func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error)) (*state.StateDB, *ExecutionResult, []byte, error) {
getTracerFn func(txIndex int, txHash common.Hash) (tracer tracers.Tracer, err error)) (*state.StateDB, *ExecutionResult, []byte, error) {
// Capture errors for BLOCKHASH operation, if we haven't been supplied the
// required blockhashes
var hashError error

View file

@ -31,6 +31,7 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers/logger"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
@ -89,7 +90,7 @@ func Transition(ctx *cli.Context) error {
err error
tracer vm.EVMLogger
)
var getTracer func(txIndex int, txHash common.Hash) (vm.EVMLogger, error)
var getTracer func(txIndex int, txHash common.Hash) (tracers.Tracer, error)
baseDir, err := createBasedir(ctx)
if err != nil {
@ -122,7 +123,7 @@ func Transition(ctx *cli.Context) error {
prevFile.Close()
}
}()
getTracer = func(txIndex int, txHash common.Hash) (vm.EVMLogger, error) {
getTracer = func(txIndex int, txHash common.Hash) (tracers.Tracer, error) {
if prevFile != nil {
prevFile.Close()
}
@ -134,7 +135,7 @@ func Transition(ctx *cli.Context) error {
return logger.NewJSONLogger(logConfig, traceFile), nil
}
} else {
getTracer = func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error) {
getTracer = func(txIndex int, txHash common.Hash) (tracer tracers.Tracer, err error) {
return nil, nil
}
}