diff --git a/docs/api/json-rpc/endpoints.md b/docs/api/json-rpc/endpoints.md index fcf5cfd52f..d95ace0315 100644 --- a/docs/api/json-rpc/endpoints.md +++ b/docs/api/json-rpc/endpoints.md @@ -130,7 +130,7 @@ Check the JSON-RPC methods supported on Ethermint. {synopsis} | `debug_traceBlockFromFile` | Debug | | | | | `debug_standardTraceBlockToFile` | Debug | | | | | `debug_standardTraceBadBlockToFile` | Debug | | | | -| `debug_traceTransaction` | Debug | ✔ | | | +| [`debug_traceTransaction`](#debug-tracetransaction) | Debug | ✔ | | | | `debug_verbosity` | Debug | | | | | `debug_vmodule` | Debug | | | | | `debug_writeBlockProfile` | Debug | ✔ | | | @@ -992,12 +992,14 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_ecRecover","params":["0 ## Debug Methods ### `debug_traceTransaction` -The traceTransaction debugging method will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction that corresponds to the given hash. + +The `traceTransaction` debugging method will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction that corresponds to the given hash. #### Parameters + - Trace Config -``` +```json // Request curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xddecdb13226339681372b44e01df0fbc0f446fca6f834b2de5ecb1e569022ec8", {"tracer": "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}"}],"id":1}' -H "Content-Type: application/json" http://localhost:8545 diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 3b47454fa8..ed2e7489a0 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -493,14 +493,14 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ //Used string to comply with go ethereum if req.TraceConfig.Timeout != "" { if timeout, err = time.ParseDuration(req.TraceConfig.Timeout); err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "timeout value: %s", err.Error()) } } txContext := core.NewEVMTxContext(coreMessage) // Constuct the JavaScript tracer to execute with if tracer, err = tracers.New(req.TraceConfig.Tracer, txContext); err != nil { - return nil, err + return nil, status.Error(codes.Internal, err.Error()) } // Handle timeouts and RPC cancellations