Skip to content

Commit 4c29f95

Browse files
committed
geth upgrade test
1 parent 3a3af97 commit 4c29f95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1421
-473
lines changed

Diff for: app/ante_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
app "github.com/sei-protocol/sei-chain/app"
2828
"github.com/sei-protocol/sei-chain/app/apptesting"
2929
testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper"
30-
"github.com/sei-protocol/sei-chain/x/evm/types"
3130
evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
3231
"github.com/sei-protocol/sei-chain/x/evm/types/ethtx"
3332
"github.com/stretchr/testify/require"
@@ -243,7 +242,7 @@ func TestEvmAnteErrorHandler(t *testing.T) {
243242
require.Nil(t, err)
244243
txwrapper, err := ethtx.NewLegacyTx(tx)
245244
require.Nil(t, err)
246-
req, err := types.NewMsgEVMTransaction(txwrapper)
245+
req, err := evmtypes.NewMsgEVMTransaction(txwrapper)
247246
require.Nil(t, err)
248247
builder := testkeeper.EVMTestApp.GetTxConfig().NewTxBuilder()
249248
builder.SetMsgs(req)

Diff for: app/eth_replay.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
ethtypes "github.com/ethereum/go-ethereum/core/types"
1818
"github.com/ethereum/go-ethereum/params"
1919
ethtests "github.com/ethereum/go-ethereum/tests"
20+
"github.com/holiman/uint256"
2021
"github.com/sei-protocol/sei-chain/utils"
2122
"github.com/sei-protocol/sei-chain/x/evm/state"
2223
evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
@@ -85,7 +86,7 @@ func Replay(a *App) {
8586
for _, w := range b.Withdrawals() {
8687
amount := new(big.Int).SetUint64(w.Amount)
8788
amount = amount.Mul(amount, big.NewInt(params.GWei))
88-
s.AddBalance(w.Address, amount, tracing.BalanceIncreaseWithdrawal)
89+
s.AddBalance(w.Address, uint256.MustFromBig(amount), tracing.BalanceIncreaseWithdrawal)
8990
}
9091
_, _ = s.Finalize()
9192
for _, tx := range b.Txs {
@@ -183,7 +184,7 @@ func BlockTest(a *App, bt *ethtests.BlockTest) {
183184
continue
184185
}
185186
// Not checking compliance with EIP-4788
186-
if addr == params.BeaconRootsStorageAddress {
187+
if addr == params.BeaconRootsAddress {
187188
fmt.Println("Skipping beacon roots storage address: ", addr)
188189
continue
189190
}

Diff for: evmrpc/block.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/ethereum/go-ethereum/common"
2020
"github.com/ethereum/go-ethereum/common/hexutil"
2121
ethtypes "github.com/ethereum/go-ethereum/core/types"
22-
"github.com/ethereum/go-ethereum/lib/ethapi"
22+
"github.com/ethereum/go-ethereum/export"
2323
"github.com/ethereum/go-ethereum/rpc"
2424
"github.com/sei-protocol/sei-chain/x/evm/keeper"
2525
"github.com/sei-protocol/sei-chain/x/evm/state"
@@ -335,7 +335,7 @@ func EncodeTmBlock(
335335
if !fullTx {
336336
transactions = append(transactions, hash)
337337
} else {
338-
newTx := ethapi.NewRPCTransaction(ethtx, blockhash, number.Uint64(), uint64(blockTime.Second()), uint64(receipt.TransactionIndex), baseFeePerGas, chainConfig)
338+
newTx := export.NewRPCTransaction(ethtx, blockhash, number.Uint64(), uint64(blockTime.Second()), uint64(receipt.TransactionIndex), baseFeePerGas, chainConfig)
339339
transactions = append(transactions, newTx)
340340
}
341341
case *wasmtypes.MsgExecuteContract:
@@ -352,7 +352,7 @@ func EncodeTmBlock(
352352
} else {
353353
ti := uint64(receipt.TransactionIndex)
354354
to := k.GetEVMAddressOrDefault(ctx, sdk.MustAccAddressFromBech32(m.Contract))
355-
transactions = append(transactions, &ethapi.RPCTransaction{
355+
transactions = append(transactions, &export.RPCTransaction{
356356
BlockHash: &blockhash,
357357
BlockNumber: (*hexutil.Big)(number),
358358
From: common.HexToAddress(receipt.From),
@@ -370,7 +370,7 @@ func EncodeTmBlock(
370370
if !fullTx {
371371
transactions = append(transactions, "0x"+hex.EncodeToString(th[:]))
372372
} else {
373-
rpcTx := &ethapi.RPCTransaction{
373+
rpcTx := &export.RPCTransaction{
374374
BlockHash: &blockhash,
375375
BlockNumber: (*hexutil.Big)(number),
376376
Hash: th,

Diff for: evmrpc/block_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/ethereum/go-ethereum/common"
1515
"github.com/ethereum/go-ethereum/common/hexutil"
1616
ethtypes "github.com/ethereum/go-ethereum/core/types"
17-
"github.com/ethereum/go-ethereum/lib/ethapi"
17+
"github.com/ethereum/go-ethereum/export"
1818
"github.com/sei-protocol/sei-chain/evmrpc"
1919
testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper"
2020
"github.com/sei-protocol/sei-chain/x/evm/types"
@@ -306,7 +306,7 @@ func TestEncodeWasmExecuteMsg(t *testing.T) {
306306
ti := uint64(1)
307307
bh := common.HexToHash(MockBlockID.Hash.String())
308308
to := common.Address(toSeiAddr)
309-
require.Equal(t, &ethapi.RPCTransaction{
309+
require.Equal(t, &export.RPCTransaction{
310310
BlockHash: &bh,
311311
BlockNumber: (*hexutil.Big)(big.NewInt(MockHeight8)),
312312
From: fromEvmAddr,
@@ -317,7 +317,7 @@ func TestEncodeWasmExecuteMsg(t *testing.T) {
317317
V: nil,
318318
R: nil,
319319
S: nil,
320-
}, txs[0].(*ethapi.RPCTransaction))
320+
}, txs[0].(*export.RPCTransaction))
321321
}
322322

323323
func TestEncodeBankTransferMsg(t *testing.T) {
@@ -365,7 +365,7 @@ func TestEncodeBankTransferMsg(t *testing.T) {
365365
require.Equal(t, 1, len(txs))
366366
bh := common.HexToHash(MockBlockID.Hash.String())
367367
to := common.Address(toSeiAddr)
368-
require.Equal(t, &ethapi.RPCTransaction{
368+
require.Equal(t, &export.RPCTransaction{
369369
BlockHash: &bh,
370370
BlockNumber: (*hexutil.Big)(big.NewInt(MockHeight8)),
371371
From: fromEvmAddr,
@@ -375,5 +375,5 @@ func TestEncodeBankTransferMsg(t *testing.T) {
375375
V: nil,
376376
R: nil,
377377
S: nil,
378-
}, txs[0].(*ethapi.RPCTransaction))
378+
}, txs[0].(*export.RPCTransaction))
379379
}

Diff for: evmrpc/send.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/ethereum/go-ethereum/common"
1212
"github.com/ethereum/go-ethereum/common/hexutil"
1313
ethtypes "github.com/ethereum/go-ethereum/core/types"
14-
"github.com/ethereum/go-ethereum/lib/ethapi"
14+
"github.com/ethereum/go-ethereum/export"
1515
"github.com/ethereum/go-ethereum/signer/core/apitypes"
1616
"github.com/sei-protocol/sei-chain/x/evm/keeper"
1717
"github.com/sei-protocol/sei-chain/x/evm/types"
@@ -94,10 +94,13 @@ func (s *SendAPI) SendRawTransaction(ctx context.Context, input hexutil.Bytes) (
9494
return
9595
}
9696

97-
func (s *SendAPI) SignTransaction(_ context.Context, args apitypes.SendTxArgs, _ *string) (result *ethapi.SignTransactionResult, returnErr error) {
97+
func (s *SendAPI) SignTransaction(_ context.Context, args apitypes.SendTxArgs, _ *string) (result *export.SignTransactionResult, returnErr error) {
9898
startTime := time.Now()
9999
defer recordMetrics("eth_signTransaction", s.connectionType, startTime, returnErr == nil)
100-
var unsignedTx = args.ToTransaction()
100+
unsignedTx, err := args.ToTransaction()
101+
if err != nil {
102+
return nil, err
103+
}
101104
signedTx, err := s.signTransaction(unsignedTx, args.From.Address().Hex())
102105
if err != nil {
103106
return nil, err
@@ -106,16 +109,16 @@ func (s *SendAPI) SignTransaction(_ context.Context, args apitypes.SendTxArgs, _
106109
if err != nil {
107110
return nil, err
108111
}
109-
return &ethapi.SignTransactionResult{Raw: data, Tx: signedTx}, nil
112+
return &export.SignTransactionResult{Raw: data, Tx: signedTx}, nil
110113
}
111114

112-
func (s *SendAPI) SendTransaction(ctx context.Context, args ethapi.TransactionArgs) (result common.Hash, returnErr error) {
115+
func (s *SendAPI) SendTransaction(ctx context.Context, args export.TransactionArgs) (result common.Hash, returnErr error) {
113116
startTime := time.Now()
114117
defer recordMetrics("eth_sendTransaction", s.connectionType, startTime, returnErr == nil)
115-
if err := args.SetDefaults(ctx, s.backend); err != nil {
118+
if err := args.SetDefaults(ctx, s.backend, false); err != nil {
116119
return common.Hash{}, err
117120
}
118-
var unsignedTx = args.ToTransaction()
121+
var unsignedTx = args.ToTransaction(ethtypes.LegacyTxType)
119122
signedTx, err := s.signTransaction(unsignedTx, args.From.Hex())
120123
if err != nil {
121124
return common.Hash{}, err

Diff for: evmrpc/setup_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ func generateTxData() {
643643
})
644644
debugTraceTxBuilder, _ := buildTx(ethtypes.DynamicFeeTx{
645645
Nonce: 0,
646-
GasFeeCap: big.NewInt(10),
646+
GasFeeCap: big.NewInt(1000000000),
647647
Gas: 22000,
648648
To: &to,
649649
Value: big.NewInt(1000),
@@ -652,7 +652,7 @@ func generateTxData() {
652652
})
653653
debugTraceNonPanicTxBuilder, _ := buildTx(ethtypes.DynamicFeeTx{
654654
Nonce: 0,
655-
GasFeeCap: big.NewInt(10),
655+
GasFeeCap: big.NewInt(1000000000),
656656
Gas: 22000,
657657
To: &to,
658658
Value: big.NewInt(1000),

Diff for: evmrpc/simulate.go

+16-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/ethereum/go-ethereum/eth"
2424
"github.com/ethereum/go-ethereum/eth/tracers"
2525
"github.com/ethereum/go-ethereum/ethdb"
26-
"github.com/ethereum/go-ethereum/lib/ethapi"
26+
"github.com/ethereum/go-ethereum/export"
2727
"github.com/ethereum/go-ethereum/params"
2828
"github.com/ethereum/go-ethereum/rpc"
2929
"github.com/sei-protocol/sei-chain/utils"
@@ -64,15 +64,15 @@ type AccessListResult struct {
6464
GasUsed hexutil.Uint64 `json:"gasUsed"`
6565
}
6666

67-
func (s *SimulationAPI) CreateAccessList(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (result *AccessListResult, returnErr error) {
67+
func (s *SimulationAPI) CreateAccessList(ctx context.Context, args export.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (result *AccessListResult, returnErr error) {
6868
startTime := time.Now()
6969
defer recordMetrics("eth_createAccessList", s.connectionType, startTime, returnErr == nil)
7070
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
7171
if blockNrOrHash != nil {
7272
bNrOrHash = *blockNrOrHash
7373
}
7474
ctx = context.WithValue(ctx, CtxIsWasmdPrecompileCallKey, wasmd.IsWasmdCall(args.To))
75-
acl, gasUsed, vmerr, err := ethapi.AccessList(ctx, s.backend, bNrOrHash, args)
75+
acl, gasUsed, vmerr, err := export.AccessList(ctx, s.backend, bNrOrHash, args)
7676
if err != nil {
7777
return nil, err
7878
}
@@ -83,31 +83,31 @@ func (s *SimulationAPI) CreateAccessList(ctx context.Context, args ethapi.Transa
8383
return result, nil
8484
}
8585

86-
func (s *SimulationAPI) EstimateGas(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *ethapi.StateOverride) (result hexutil.Uint64, returnErr error) {
86+
func (s *SimulationAPI) EstimateGas(ctx context.Context, args export.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *export.StateOverride) (result hexutil.Uint64, returnErr error) {
8787
startTime := time.Now()
8888
defer recordMetricsWithError("eth_estimateGas", s.connectionType, startTime, returnErr)
8989
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
9090
if blockNrOrHash != nil {
9191
bNrOrHash = *blockNrOrHash
9292
}
9393
ctx = context.WithValue(ctx, CtxIsWasmdPrecompileCallKey, wasmd.IsWasmdCall(args.To))
94-
estimate, err := ethapi.DoEstimateGas(ctx, s.backend, args, bNrOrHash, overrides, s.backend.RPCGasCap())
94+
estimate, err := export.DoEstimateGas(ctx, s.backend, args, bNrOrHash, overrides, nil, s.backend.RPCGasCap())
9595
return estimate, err
9696
}
9797

98-
func (s *SimulationAPI) EstimateGasAfterCalls(ctx context.Context, args ethapi.TransactionArgs, calls []ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *ethapi.StateOverride) (result hexutil.Uint64, returnErr error) {
98+
func (s *SimulationAPI) EstimateGasAfterCalls(ctx context.Context, args export.TransactionArgs, calls []export.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *export.StateOverride) (result hexutil.Uint64, returnErr error) {
9999
startTime := time.Now()
100100
defer recordMetricsWithError("eth_estimateGasAfterCalls", s.connectionType, startTime, returnErr)
101101
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
102102
if blockNrOrHash != nil {
103103
bNrOrHash = *blockNrOrHash
104104
}
105105
ctx = context.WithValue(ctx, CtxIsWasmdPrecompileCallKey, wasmd.IsWasmdCall(args.To))
106-
estimate, err := ethapi.DoEstimateGasAfterCalls(ctx, s.backend, args, calls, bNrOrHash, overrides, s.backend.RPCEVMTimeout(), s.backend.RPCGasCap())
106+
estimate, err := export.DoEstimateGasAfterCalls(ctx, s.backend, args, calls, bNrOrHash, overrides, s.backend.RPCEVMTimeout(), s.backend.RPCGasCap())
107107
return estimate, err
108108
}
109109

110-
func (s *SimulationAPI) Call(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *ethapi.StateOverride, blockOverrides *ethapi.BlockOverrides) (result hexutil.Bytes, returnErr error) {
110+
func (s *SimulationAPI) Call(ctx context.Context, args export.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash, overrides *export.StateOverride, blockOverrides *export.BlockOverrides) (result hexutil.Bytes, returnErr error) {
111111
startTime := time.Now()
112112
defer recordMetrics("eth_call", s.connectionType, startTime, returnErr == nil)
113113
defer func() {
@@ -124,7 +124,7 @@ func (s *SimulationAPI) Call(ctx context.Context, args ethapi.TransactionArgs, b
124124
blockNrOrHash = &latest
125125
}
126126
ctx = context.WithValue(ctx, CtxIsWasmdPrecompileCallKey, wasmd.IsWasmdCall(args.To))
127-
callResult, err := ethapi.DoCall(ctx, s.backend, args, *blockNrOrHash, overrides, blockOverrides, s.backend.RPCEVMTimeout(), s.backend.RPCGasCap())
127+
callResult, err := export.DoCall(ctx, s.backend, args, *blockNrOrHash, overrides, blockOverrides, s.backend.RPCEVMTimeout(), s.backend.RPCGasCap())
128128
if err != nil {
129129
return nil, err
130130
}
@@ -204,16 +204,16 @@ func (b *Backend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHas
204204
return state.NewDBImpl(sdkCtx, b.keeper, true), b.getHeader(big.NewInt(height)), nil
205205
}
206206

207-
func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (tx *ethtypes.Transaction, blockHash common.Hash, blockNumber uint64, index uint64, err error) {
207+
func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (found bool, tx *ethtypes.Transaction, blockHash common.Hash, blockNumber uint64, index uint64, err error) {
208208
sdkCtx := b.ctxProvider(LatestCtxHeight)
209209
receipt, err := b.keeper.GetReceipt(sdkCtx, txHash)
210210
if err != nil {
211-
return nil, common.Hash{}, 0, 0, err
211+
return false, nil, common.Hash{}, 0, 0, err
212212
}
213213
txHeight := int64(receipt.BlockNumber)
214214
block, err := blockByNumber(ctx, b.tmClient, &txHeight)
215215
if err != nil {
216-
return nil, common.Hash{}, 0, 0, err
216+
return false, nil, common.Hash{}, 0, 0, err
217217
}
218218
txIndex := hexutil.Uint(receipt.TransactionIndex)
219219
tmTx := block.Block.Txs[int(txIndex)]
@@ -223,11 +223,11 @@ func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (tx *e
223223
return err == nil
224224
})
225225
if !found {
226-
return nil, common.Hash{}, 0, 0, errors.New("failed to find transaction in block")
226+
return false, nil, common.Hash{}, 0, 0, errors.New("failed to find transaction in block")
227227
}
228228
tx = getEthTxForTxBz(tmTx, b.txDecoder)
229229
blockHash = common.BytesToHash(block.Block.Header.Hash().Bytes())
230-
return tx, blockHash, uint64(txHeight), uint64(evmTxIndex), nil
230+
return true, tx, blockHash, uint64(txHeight), uint64(evmTxIndex), nil
231231
}
232232

233233
func (b *Backend) ChainDb() ethdb.Database {
@@ -323,7 +323,6 @@ func (b *Backend) StateAtTransaction(ctx context.Context, block *ethtypes.Block,
323323
if err != nil {
324324
return nil, vm.BlockContext{}, nil, nil, err
325325
}
326-
txContext := core.NewEVMTxContext(msg)
327326
blockContext, err := b.keeper.GetVMBlockContext(b.ctxProvider(prevBlockHeight), core.GasPool(b.RPCGasCap()))
328327
if err != nil {
329328
return nil, vm.BlockContext{}, nil, nil, err
@@ -352,7 +351,7 @@ func (b *Backend) StateAtTransaction(ctx context.Context, block *ethtypes.Block,
352351
}
353352
statedb.WithCtx(statedb.Ctx().WithEVMEntryViaWasmdPrecompile(wasmd.IsWasmdCall(tx.To())))
354353
// Not yet the searched for transaction, execute on top of the current state
355-
vmenv := vm.NewEVM(*blockContext, txContext, statedb, b.ChainConfig(), vm.Config{})
354+
vmenv := vm.NewEVM(*blockContext, statedb, b.ChainConfig(), vm.Config{})
356355
statedb.SetTxContext(tx.Hash(), idx)
357356
if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())); err != nil {
358357
return nil, vm.BlockContext{}, nil, nil, fmt.Errorf("transaction %#x failed: %v", tx.Hash(), err)
@@ -391,11 +390,10 @@ func (b *Backend) StateAtBlock(ctx context.Context, block *ethtypes.Block, reexe
391390
}
392391

393392
func (b *Backend) GetEVM(_ context.Context, msg *core.Message, stateDB vm.StateDB, _ *ethtypes.Header, vmConfig *vm.Config, blockCtx *vm.BlockContext) *vm.EVM {
394-
txContext := core.NewEVMTxContext(msg)
395393
if blockCtx == nil {
396394
blockCtx, _ = b.keeper.GetVMBlockContext(b.ctxProvider(LatestCtxHeight).WithIsEVM(true).WithEVMEntryViaWasmdPrecompile(wasmd.IsWasmdCall(msg.To)), core.GasPool(b.RPCGasCap()))
397395
}
398-
return vm.NewEVM(*blockCtx, txContext, stateDB, b.ChainConfig(), *vmConfig)
396+
return vm.NewEVM(*blockCtx, stateDB, b.ChainConfig(), *vmConfig)
399397
}
400398

401399
func (b *Backend) CurrentHeader() *ethtypes.Header {

Diff for: evmrpc/state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (a *StateAPI) GetBalance(ctx context.Context, address common.Address, block
4949
}
5050
}
5151
statedb := state.NewDBImpl(sdkCtx, a.keeper, true)
52-
return (*hexutil.Big)(statedb.GetBalance(address)), nil
52+
return (*hexutil.Big)(statedb.GetBalance(address).ToBig()), nil
5353
}
5454

5555
func (a *StateAPI) GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (result hexutil.Bytes, returnErr error) {

Diff for: evmrpc/subscribe.go

-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ func (a *SubscriptionAPI) NewHeads(ctx context.Context) (s *rpc.Subscription, er
123123
}
124124
case <-rpcSub.Err():
125125
break OUTER
126-
case <-notifier.Closed():
127-
break OUTER
128126
}
129127
}
130128
a.newHeadListenersMtx.Lock()

Diff for: evmrpc/tracers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/ethereum/go-ethereum/eth/tracers"
1111
_ "github.com/ethereum/go-ethereum/eth/tracers/js" // run init()s to register JS tracers
1212
_ "github.com/ethereum/go-ethereum/eth/tracers/native" // run init()s to register native tracers
13-
"github.com/ethereum/go-ethereum/lib/ethapi"
13+
"github.com/ethereum/go-ethereum/export"
1414
"github.com/ethereum/go-ethereum/rpc"
1515
"github.com/hashicorp/golang-lru/v2/expirable"
1616
"github.com/sei-protocol/sei-chain/x/evm/keeper"
@@ -168,7 +168,7 @@ func (api *DebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, con
168168
return
169169
}
170170

171-
func (api *DebugAPI) TraceCall(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *tracers.TraceCallConfig) (result interface{}, returnErr error) {
171+
func (api *DebugAPI) TraceCall(ctx context.Context, args export.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *tracers.TraceCallConfig) (result interface{}, returnErr error) {
172172
startTime := time.Now()
173173
defer recordMetrics("debug_traceCall", api.connectionType, startTime, returnErr == nil)
174174
result, returnErr = api.tracersAPI.TraceCall(ctx, args, blockNrOrHash, config)

Diff for: evmrpc/tracers_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func TestTraceTransaction(t *testing.T) {
1414
// test callTracer
1515
args["tracer"] = "callTracer"
1616
resObj := sendRequestGoodWithNamespace(t, "debug", "traceTransaction", DebugTraceHashHex, args)
17+
fmt.Println(resObj)
1718
result := resObj["result"].(map[string]interface{})
1819
require.Equal(t, "0x5b4eba929f3811980f5ae0c5d04fa200f837df4e", result["from"])
1920
require.Equal(t, "0x55f0", result["gas"])

0 commit comments

Comments
 (0)