diff --git a/nimbus/rpc/p2p.nim b/nimbus/rpc/p2p.nim index 7f33761bc..69bfdccae 100644 --- a/nimbus/rpc/p2p.nim +++ b/nimbus/rpc/p2p.nim @@ -138,12 +138,15 @@ proc setupP2PRPC*(node: EthereumNode, rpcsrv: RpcServer) = body = chain.getBlockBody(header.stateRoot) result = body.transactions.len - rpcsrv.rpc("eth_getUncleCountByBlockHash") do(data: HexDataStr): + rpcsrv.rpc("eth_getUncleCountByBlockHash") do(data: HexDataStr) -> int: ## Returns the number of uncles in a block from a block matching the given block hash. ## ## data: hash of a block. ## Returns integer of the number of uncles in this block. - discard + var hashData: Hash256 + hashData.data = hexToPaddedByteArray[32](data.string) + let body = chain.getBlockBody(hashData) + result = body.uncles.len rpcsrv.rpc("eth_getUncleCountByBlockNumber") do(quantityTag: string): ## Returns the number of uncles in a block from a block matching the given block number.