eth_getBlockTransactionCountByHash
This commit is contained in:
parent
404d4d883d
commit
1871a7b090
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue