fixes rpc compilation error

This commit is contained in:
andri lim 2020-01-23 14:45:06 +07:00 committed by zah
parent d23a33a80c
commit e8ec1706ed
2 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
blockBody = chainDB.getBlockBody(blockHash)
flags = traceOptionsToFlags(options)
traceTransaction(chainDB, blockHeader, blockBody, txDetails.index, flags)
result = traceTransaction(chainDB, blockHeader, blockBody, txDetails.index, flags)
rpcsrv.rpc("debug_dumpBlockStateByNumber") do(quantityTag: string) -> JsonNode:
## Retrieves the state that corresponds to the block number and returns
@ -69,7 +69,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
blockHash = chainDB.getBlockHash(header.blockNumber)
body = chainDB.getBlockBody(blockHash)
dumpBlockState(chainDB, header, body)
result = dumpBlockState(chainDB, header, body)
rpcsrv.rpc("debug_dumpBlockStateByHash") do(data: EthHashStr) -> JsonNode:
## Retrieves the state that corresponds to the block number and returns
@ -82,7 +82,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
blockHash = chainDB.getBlockHash(header.blockNumber)
body = chainDB.getBlockBody(blockHash)
dumpBlockState(chainDB, header, body)
result = dumpBlockState(chainDB, header, body)
rpcsrv.rpc("debug_traceBlockByNumber") do(quantityTag: string, options: Option[TraceOptions]) -> JsonNode:
## The traceBlock method will return a full stack trace of all invoked opcodes of all transaction
@ -97,7 +97,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
body = chainDB.getBlockBody(blockHash)
flags = traceOptionsToFlags(options)
traceBlock(chainDB, header, body, flags)
result = traceBlock(chainDB, header, body, flags)
rpcsrv.rpc("debug_traceBlockByHash") do(data: EthHashStr, options: Option[TraceOptions]) -> JsonNode:
## The traceBlock method will return a full stack trace of all invoked opcodes of all transaction
@ -112,7 +112,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
body = chainDB.getBlockBody(blockHash)
flags = traceOptionsToFlags(options)
traceBlock(chainDB, header, body, flags)
result = traceBlock(chainDB, header, body, flags)
rpcsrv.rpc("debug_setHead") do(quantityTag: string):
## Sets the current head of the local chain by block number.

View File

@ -462,7 +462,7 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
header = chain.getBlockHeader(txDetails.blockNumber)
blockHash = chain.getBlockHash(txDetails.blockNumber)
transaction = getBlockBody(blockHash).transactions[txDetails.index]
populateTransactionObject(transaction, txDetails.index, header, blockHash)
result = populateTransactionObject(transaction, txDetails.index, header, blockHash)
# TODO: if the requested transaction not in blockchain
# try to look for pending transaction in txpool
@ -476,7 +476,7 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
blockHash = data.toHash()
header = chain.getBlockHeader(blockHash)
transaction = getBlockBody(blockHash).transactions[quantity]
populateTransactionObject(transaction, quantity, header, blockHash)
result = populateTransactionObject(transaction, quantity, header, blockHash)
rpcsrv.rpc("eth_getTransactionByBlockNumberAndIndex") do(quantityTag: string, quantity: int) -> TransactionObject:
## Returns information about a transaction by block number and transaction index position.
@ -487,7 +487,7 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
header = chain.headerFromTag(quantityTag)
blockHash = header.hash
transaction = getBlockBody(blockHash).transactions[quantity]
populateTransactionObject(transaction, quantity, header, blockHash)
result = populateTransactionObject(transaction, quantity, header, blockHash)
proc populateReceipt(receipt: Receipt, gasUsed: GasInt, tx: Transaction, txIndex: int, blockHeader: BlockHeader): ReceiptObject =
result.transactionHash = tx.rlpHash