mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-25 10:25:32 +00:00
fixes rpc compilation error
This commit is contained in:
parent
d23a33a80c
commit
e8ec1706ed
@ -56,7 +56,7 @@ proc setupDebugRpc*(chainDB: BaseChainDB, rpcsrv: RpcServer) =
|
|||||||
blockBody = chainDB.getBlockBody(blockHash)
|
blockBody = chainDB.getBlockBody(blockHash)
|
||||||
flags = traceOptionsToFlags(options)
|
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:
|
rpcsrv.rpc("debug_dumpBlockStateByNumber") do(quantityTag: string) -> JsonNode:
|
||||||
## Retrieves the state that corresponds to the block number and returns
|
## 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)
|
blockHash = chainDB.getBlockHash(header.blockNumber)
|
||||||
body = chainDB.getBlockBody(blockHash)
|
body = chainDB.getBlockBody(blockHash)
|
||||||
|
|
||||||
dumpBlockState(chainDB, header, body)
|
result = dumpBlockState(chainDB, header, body)
|
||||||
|
|
||||||
rpcsrv.rpc("debug_dumpBlockStateByHash") do(data: EthHashStr) -> JsonNode:
|
rpcsrv.rpc("debug_dumpBlockStateByHash") do(data: EthHashStr) -> JsonNode:
|
||||||
## Retrieves the state that corresponds to the block number and returns
|
## 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)
|
blockHash = chainDB.getBlockHash(header.blockNumber)
|
||||||
body = chainDB.getBlockBody(blockHash)
|
body = chainDB.getBlockBody(blockHash)
|
||||||
|
|
||||||
dumpBlockState(chainDB, header, body)
|
result = dumpBlockState(chainDB, header, body)
|
||||||
|
|
||||||
rpcsrv.rpc("debug_traceBlockByNumber") do(quantityTag: string, options: Option[TraceOptions]) -> JsonNode:
|
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
|
## 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)
|
body = chainDB.getBlockBody(blockHash)
|
||||||
flags = traceOptionsToFlags(options)
|
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:
|
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
|
## 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)
|
body = chainDB.getBlockBody(blockHash)
|
||||||
flags = traceOptionsToFlags(options)
|
flags = traceOptionsToFlags(options)
|
||||||
|
|
||||||
traceBlock(chainDB, header, body, flags)
|
result = traceBlock(chainDB, header, body, flags)
|
||||||
|
|
||||||
rpcsrv.rpc("debug_setHead") do(quantityTag: string):
|
rpcsrv.rpc("debug_setHead") do(quantityTag: string):
|
||||||
## Sets the current head of the local chain by block number.
|
## Sets the current head of the local chain by block number.
|
||||||
|
@ -462,7 +462,7 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
|
|||||||
header = chain.getBlockHeader(txDetails.blockNumber)
|
header = chain.getBlockHeader(txDetails.blockNumber)
|
||||||
blockHash = chain.getBlockHash(txDetails.blockNumber)
|
blockHash = chain.getBlockHash(txDetails.blockNumber)
|
||||||
transaction = getBlockBody(blockHash).transactions[txDetails.index]
|
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
|
# TODO: if the requested transaction not in blockchain
|
||||||
# try to look for pending transaction in txpool
|
# try to look for pending transaction in txpool
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
|
|||||||
blockHash = data.toHash()
|
blockHash = data.toHash()
|
||||||
header = chain.getBlockHeader(blockHash)
|
header = chain.getBlockHeader(blockHash)
|
||||||
transaction = getBlockBody(blockHash).transactions[quantity]
|
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:
|
rpcsrv.rpc("eth_getTransactionByBlockNumberAndIndex") do(quantityTag: string, quantity: int) -> TransactionObject:
|
||||||
## Returns information about a transaction by block number and transaction index position.
|
## 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)
|
header = chain.headerFromTag(quantityTag)
|
||||||
blockHash = header.hash
|
blockHash = header.hash
|
||||||
transaction = getBlockBody(blockHash).transactions[quantity]
|
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 =
|
proc populateReceipt(receipt: Receipt, gasUsed: GasInt, tx: Transaction, txIndex: int, blockHeader: BlockHeader): ReceiptObject =
|
||||||
result.transactionHash = tx.rlpHash
|
result.transactionHash = tx.rlpHash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user