Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'debug-trace' of github.com:crypto-facs/ethermint into d…
Browse files Browse the repository at this point in the history
…ebug-trace
  • Loading branch information
crypto-facs committed Sep 4, 2021
2 parents f91540a + 81e06f4 commit 80424e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions docs/api/json-rpc/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 || | |
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions x/evm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80424e7

Please sign in to comment.