Skip to content

Commit

Permalink
Fix missing parameter passing for fullTransactions in JSON-RPC API (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme authored Dec 13, 2023
1 parent 77d8e97 commit 64bfe4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions fluffy/rpc/rpc_eth_api.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand Down Expand Up @@ -215,7 +215,7 @@ proc installEthApiHandlers*(
(header, body) = (await historyNetwork.getBlock(blockHash)).valueOr:
return none(BlockObject)

return some(BlockObject.init(header, body))
return some(BlockObject.init(header, body, fullTransactions))

rpcServerWithProxy.rpc("eth_getBlockByNumber") do(
quantityTag: string, fullTransactions: bool) -> Option[BlockObject]:
Expand All @@ -240,7 +240,7 @@ proc installEthApiHandlers*(
(header, body) = (await historyNetwork.getBlock(blockHash)).valueOr:
return none(BlockObject)

return some(BlockObject.init(header, body))
return some(BlockObject.init(header, body, fullTransactions))
else:
raise newException(
ValueError, "Not available before Capella - not synced?")
Expand All @@ -255,7 +255,7 @@ proc installEthApiHandlers*(
(header, body) = (await historyNetwork.getBlock(blockHash)).valueOr:
return none(BlockObject)

return some(BlockObject.init(header, body))
return some(BlockObject.init(header, body, fullTransactions))
else:
raise newException(
ValueError, "Not available before Capella - not synced?")
Expand All @@ -274,7 +274,7 @@ proc installEthApiHandlers*(
return none(BlockObject)
else:
let (header, body) = maybeBlock.get()
return some(BlockObject.init(header, body))
return some(BlockObject.init(header, body, fullTransactions))

rpcServerWithProxy.rpc("eth_getBlockTransactionCountByHash") do(
data: rpc_types.Hash256) -> Quantity:
Expand Down
6 changes: 3 additions & 3 deletions fluffy/scripts/test_portal_testnet.nim
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ procSuite "Portal testnet tests":
let content = await retryUntil(
proc (): Future[Option[BlockObject]] {.async.} =
try:
let res = await client.eth_getBlockByHash(w3Hash hash, false)
let res = await client.eth_getBlockByHash(w3Hash hash, true)
await client.close()
return res
except CatchableError as exc:
Expand Down Expand Up @@ -406,7 +406,7 @@ procSuite "Portal testnet tests":
# let content = await retryUntil(
# proc (): Future[Option[BlockObject]] {.async.} =
# try:
# let res = await client.eth_getBlockByHash(hash.ethHashStr(), false)
# let res = await client.eth_getBlockByHash(hash.ethHashStr(), true)
# await client.close()
# return res
# except CatchableError as exc:
Expand Down Expand Up @@ -492,7 +492,7 @@ procSuite "Portal testnet tests":
# let content = await retryUntil(
# proc (): Future[Option[BlockObject]] {.async.} =
# try:
# let res = await client.eth_getBlockByHash(hash.ethHashStr(), false)
# let res = await client.eth_getBlockByHash(hash.ethHashStr(), true)
# await client.close()
# return res
# except CatchableError as exc:
Expand Down

0 comments on commit 64bfe4d

Please sign in to comment.