File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ]
You can’t perform that action at this time.
0 commit comments