eth_getBlockTransactionCountByHash

This commit is contained in:
coffeepots 2018-08-14 16:53:45 +01:00
parent 404d4d883d
commit 1871a7b090
1 changed files with 4 additions and 1 deletions

View File

@ -123,7 +123,10 @@ proc setupP2PRPC*(node: EthereumNode, rpcsrv: RpcServer) =
## ##
## data: hash of a block ## data: hash of a block
## Returns integer of the number of transactions in this block. ## Returns integer of the number of transactions in this block.
discard var hashData: Hash256
hashData.data = hexToPaddedByteArray[32](data.string)
let body = chain.getBlockBody(hashData)
result = body.transactions.len
rpcsrv.rpc("eth_getBlockTransactionCountByNumber") do(quantityTag: string) -> int: rpcsrv.rpc("eth_getBlockTransactionCountByNumber") do(quantityTag: string) -> int:
## Returns the number of transactions in a block matching the given block number. ## Returns the number of transactions in a block matching the given block number.