Skip to content

Commit 2bdffd6

Browse files
authored
Add newPayload template for engine_newPayloadV4 and restore eth_getBlockReceipts callsig (#182)
1 parent c8f36f5 commit 2bdffd6

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

tests/test_execution_api.nim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,20 @@ suite "Test eth api":
209209
check res.isSome
210210
waitFor client.close()
211211

212+
test "eth_getBlockReceipts with Quantity param":
213+
let client = newRpcHttpClient()
214+
waitFor client.connect("http://" & $srv.localAddress()[0])
215+
let res = waitFor client.eth_getBlockReceipts(blockId(0))
216+
check res.isSome
217+
waitFor client.close()
218+
219+
test "eth_getBlockReceipts with string param":
220+
let client = newRpcHttpClient()
221+
waitFor client.connect("http://" & $srv.localAddress()[0])
222+
let res = waitFor client.eth_getBlockReceipts("latest")
223+
check res.isSome
224+
waitFor client.close()
225+
212226
waitFor srv.stop()
213227
waitFor srv.closeWait()
214228

web3/eth_api.nim

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,7 @@ createRpcSigsFromNim(RpcClient):
3939
proc eth_getTransactionCount(data: Address, blockId: BlockIdentifier): Quantity
4040
proc eth_getBlockTransactionCountByHash(data: Hash32): Quantity
4141
proc eth_getBlockTransactionCountByNumber(blockId: BlockIdentifier): Quantity
42-
43-
# TODO: Investigate why nim v2 cannot instantiate generic functions
44-
# with oneof params `blockId: BlockIdentifier` and and return type
45-
# Opt[seq[ReceiptObject]], this is a regression after all
46-
# https://github.com/nim-lang/Nim/issues/23310
47-
when false:
48-
proc eth_getBlockReceipts(blockId: BlockIdentifier): Opt[seq[ReceiptObject]]
49-
50-
proc eth_getBlockReceipts(blockId: string): Opt[seq[ReceiptObject]]
51-
proc eth_getBlockReceipts(blockId: Quantity): Opt[seq[ReceiptObject]]
52-
proc eth_getBlockReceipts(blockId: RtBlockIdentifier): Opt[seq[ReceiptObject]]
53-
42+
proc eth_getBlockReceipts(blockId: BlockIdentifier): Opt[seq[ReceiptObject]]
5443
proc eth_getUncleCountByBlockHash(data: Hash32): Quantity
5544
proc eth_getUncleCountByBlockNumber(blockId: BlockIdentifier): Quantity
5645
proc eth_getCode(data: Address, blockId: BlockIdentifier): seq[byte]

0 commit comments

Comments
 (0)