Skip to content

Commit

Permalink
Fix inconsistey TraceCall signature
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinaco committed Oct 25, 2023
1 parent ee2b893 commit 1da357c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ type EVMBackend interface {
// Tracing
TraceTransaction(hash common.Hash, config *evmtypes.TraceConfig) (interface{}, error)
TraceBlock(height rpctypes.BlockNumber, config *evmtypes.TraceConfig, block *tmrpctypes.ResultBlock) ([]*evmtypes.TxTraceResult, error)
TraceCall(args evmtypes.TransactionArgs, blockNr rpctypes.BlockNumber, config *evmtypes.TraceConfig) (interface{}, error)
TraceCall(args evmtypes.TransactionArgs, blockNr rpctypes.BlockNumberOrHash, config *evmtypes.TraceConfig) (interface{}, error)
}

var _ BackendI = (*Backend)(nil)
Expand Down
7 changes: 6 additions & 1 deletion rpc/backend/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,17 @@ func (b *Backend) TraceBlock(height rpctypes.BlockNumber,
// TraceCall returns the structured logs created during the execution of EVM call
// and returns them as a JSON object.
func (b *Backend) TraceCall(
args evmtypes.TransactionArgs, blockNr rpctypes.BlockNumber, config *evmtypes.TraceConfig,
args evmtypes.TransactionArgs, blockNrOrHash rpctypes.BlockNumberOrHash, config *evmtypes.TraceConfig,
) (interface{}, error) {
bz, err := json.Marshal(&args)
if err != nil {
return nil, err
}
blockNr, err := b.BlockNumberFromTendermint(blockNrOrHash)
if err != nil {
return nil, err
}

blk, err := b.TendermintBlockByNumber(blockNr)
if err != nil {
// the error message imitates geth behavior
Expand Down

0 comments on commit 1da357c

Please sign in to comment.