Skip to content

Commit 1b48de2

Browse files
committed
rebases fixes and nits
1 parent 6194eeb commit 1b48de2

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

nimbus_verified_proxy/json_rpc_backend.nim

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,12 @@ proc getEthApiBackend*(client: JsonRpcClient): EthApiBackend =
127127
newestBlock: BlockTag,
128128
rewardPercentiles: Opt[seq[float64]],
129129
): Future[FeeHistoryResult] {.async: (raises: [CancelledError]).} =
130-
try:
131-
await client.getClient().eth_feeHistory(
132-
blockCount, newestBlock, rewardPercentiles
133-
)
134-
except CatchableError as e:
135-
raise newException(CancelledError, e.msg)
130+
handleBackendCall await client.getClient().eth_feeHistory(blockCount, newestBlock, rewardPercentiles)
136131

137132
sendRawTxProc = proc(
138133
txBytes: seq[byte]
139134
): Future[Hash32] {.async: (raises: [CancelledError]).} =
140-
try:
141-
await client.getClient().eth_sendRawTransaction(txBytes)
142-
except CatchableError as e:
143-
raise newException(CancelledError, e.msg)
135+
handleBackendCall await client.getClient().eth_sendRawTransaction(txBytes)
144136

145137
EthApiBackend(
146138
eth_chainId: ethChainIdProc,

nimbus_verified_proxy/json_rpc_frontend.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,14 @@ proc injectEngineFrontend*(server: JsonRpcServer, frontend: EthApiFrontend) =
205205
server.getServer().rpc("eth_sendRawTransaction") do(txBytes: seq[byte]) -> Hash32:
206206
await frontend.eth_sendRawTransaction(txBytes)
207207

208-
proc stop*(server: JsonRpcServer) {.async: (raises: [EngineError]).} =
208+
proc stop*(server: JsonRpcServer) {.async: (raises: [CancelledError, EngineError]).} =
209209
try:
210210
case server.kind
211211
of Http:
212212
await server.httpServer.closeWait()
213213
of WebSocket:
214214
await server.wsServer.closeWait()
215+
except CancelledError as e:
216+
raise e
215217
except CatchableError as e:
216218
raise newException(EngineError, e.msg)

0 commit comments

Comments
 (0)