fix unit test

This commit is contained in:
bnovil 2023-10-07 20:12:58 +08:00
parent bd6fc4ea6a
commit 33207aa7b7

View file

@ -36,6 +36,7 @@ import (
"github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/eth/tracers" "github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers/logger" "github.com/ethereum/go-ethereum/eth/tracers/logger"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
@ -564,6 +565,7 @@ func testCallContractWithBlockOverrides(t *testing.T, client *rpc.Client) {
func testTraceTransaction(t *testing.T, client *rpc.Client) { func testTraceTransaction(t *testing.T, client *rpc.Client) {
ec := New(client) ec := New(client)
tracer := "callTracer"
var testSuite = []struct { var testSuite = []struct {
txHash common.Hash txHash common.Hash
config *tracers.TraceConfig config *tracers.TraceConfig
@ -599,7 +601,7 @@ func testTraceTransaction(t *testing.T, client *rpc.Client) {
{ {
txHash: testTransactionHash, txHash: testTransactionHash,
config: &tracers.TraceConfig{ config: &tracers.TraceConfig{
TracerConfig: json.RawMessage(`{"tracer":"callTracer"}`), Tracer: &tracer,
}, },
expectErr: nil, expectErr: nil,
expect: map[string]interface{}{ expect: map[string]interface{}{