Updated traceTransaction to accept a hash

This commit is contained in:
coffeepots 2018-11-29 17:09:59 +00:00
parent 8d4c00cd3f
commit 9b53f8cda4
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ proc setupDebugRpc*(chain: BaseChainDB, rpcsrv: RpcServer) =
if not chain.getBlockBody(hash, result):
raise newException(ValueError, "Error when retrieving block body")
rpcsrv.rpc("debug_traceTransaction") do(data: HexDataStr, options: Option[TraceTxOptions]) -> JsonNode:
rpcsrv.rpc("debug_traceTransaction") do(data: EthHashStr, options: Option[TraceTxOptions]) -> JsonNode:
## 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
@ -38,7 +38,7 @@ proc setupDebugRpc*(chain: BaseChainDB, rpcsrv: RpcServer) =
## * disableMemory: BOOL. Setting this to true will disable memory capture (default = false).
## * disableStack: BOOL. Setting this to true will disable stack capture (default = false).
let
txHash = strToHash(data.string)
txHash = toHash(data)
txDetails = chain.getTransactionKey(txHash)
blockHeader = chain.getBlockHeader(txDetails.blockNumber)
blockHash = chain.getBlockHash(txDetails.blockNumber)