add exception annotations, fix unawaited Future, fix imports

This commit is contained in:
gmega 2024-05-09 19:16:24 -03:00
parent e3863a15d7
commit c3d146f45a
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
3 changed files with 5 additions and 4 deletions

View File

@ -429,7 +429,7 @@ asyncchecksuite "NetworkStore engine handlers":
let
tCid = Cid.example
delivery = BlockDelivery(blk: Block.example, address: BlockAddress(leaf: true, treeCid: tCid))
await engine.resolveBlocks(@[delivery])
check:
@ -442,7 +442,7 @@ asyncchecksuite "NetworkStore engine handlers":
let
blkCid = Cid.example
delivery = BlockDelivery(blk: Block.example, address: BlockAddress(leaf: false, cid: blkCid))
await engine.resolveBlocks(@[delivery])
check:
@ -553,7 +553,7 @@ asyncchecksuite "Task Handler":
test "Should set in-flight for outgoing blocks":
proc sendBlocksDelivery(
id: PeerId,
blocksDelivery: seq[BlockDelivery]) {.gcsafe, async.} =
blocksDelivery: seq[BlockDelivery]) {.gcsafe, async: (handleException: true).} =
check peersCtx[0].peerWants[0].inFlight
for blk in blocks:

View File

@ -256,7 +256,7 @@ ethersuite "On-Chain Market":
receivedIds.add(requestId)
let subscription = await market.subscribeRequestCancelled(request.id, onRequestCancelled)
advanceToCancelledRequest(otherRequest) # shares expiry with otherRequest
await advanceToCancelledRequest(otherRequest) # shares expiry with otherRequest
await market.withdrawFunds(otherRequest.id)
check receivedIds.len == 0
await market.withdrawFunds(request.id)

View File

@ -1,4 +1,5 @@
import pkg/ethers
import pkg/serde
proc currentTime*(provider: Provider): Future[UInt256] {.async.} =
return (!await provider.getBlock(BlockTag.pending)).timestamp