use parens around `=? (await...)` calls

This commit is contained in:
Dmitriy Ryajov 2024-02-16 09:00:23 -06:00
parent 3ce68f696e
commit b7c736b34c
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 9 additions and 6 deletions

View File

@ -37,13 +37,16 @@ type
method getBlock*(self: NetworkStore, address: BlockAddress): Future[?!Block] {.async.} =
trace "Getting block from local store or network", address
without blk =? await self.localStore.getBlock(address), error:
if not (error of BlockNotFoundError): return failure error
trace "Block not in local store", address
without blk =? (await self.localStore.getBlock(address)), err:
if not (err of BlockNotFoundError):
trace "Error getting block from local store", address, err = err.msg
return failure err
without newBlock =? (await self.engine.requestBlock(address)).catch, error:
trace "Unable to get block from exchange engine", address
return failure error
trace "Block not in local store", address, err = err.msg
without newBlock =? (await self.engine.requestBlock(address)), err:
trace "Unable to get block from exchange engine", address, err = err.msg
return failure err
return success newBlock