From 25f8123c6f472dcdf2565d5dd263d1b42d2a302e Mon Sep 17 00:00:00 2001 From: coffeepots Date: Tue, 14 Aug 2018 16:55:57 +0100 Subject: [PATCH] eth_getUncleCountByBlockNumber --- nimbus/rpc/p2p.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nimbus/rpc/p2p.nim b/nimbus/rpc/p2p.nim index 69bfdccae..47832c934 100644 --- a/nimbus/rpc/p2p.nim +++ b/nimbus/rpc/p2p.nim @@ -148,12 +148,15 @@ proc setupP2PRPC*(node: EthereumNode, rpcsrv: RpcServer) = let body = chain.getBlockBody(hashData) result = body.uncles.len - rpcsrv.rpc("eth_getUncleCountByBlockNumber") do(quantityTag: string): + rpcsrv.rpc("eth_getUncleCountByBlockNumber") do(quantityTag: string) -> int: ## Returns the number of uncles in a block from a block matching the given block number. ## ## quantityTag: integer of a block number, or the string "latest", "earliest" or "pending", see the default block parameter. ## Returns integer of uncles in this block. - discard + let + header = chain.headerFromTag(quantityTag) + body = chain.getBlockBody(header.stateRoot) + result = body.uncles.len rpcsrv.rpc("eth_getCode") do(data: EthAddressStr, quantityTag: string) -> HexDataStr: ## Returns code at a given address.