diff --git a/codex/blockexchange/engine/engine.nim b/codex/blockexchange/engine/engine.nim index 41b76812..003843f3 100644 --- a/codex/blockexchange/engine/engine.nim +++ b/codex/blockexchange/engine/engine.nim @@ -760,13 +760,12 @@ proc wantListHandler*( wantType = $e.wantType if e.address notin peerCtx.wantedBlocks: # Adding new entry to peer wants - let - have = - try: - await e.address in self.localStore - except CatchableError as exc: - # TODO: should not be necessary once we have proper exception tracking on the BlockStore interface - false + let have = + try: + await e.address in self.localStore + except CatchableError as exc: + # TODO: should not be necessary once we have proper exception tracking on the BlockStore interface + false if e.cancel: # This is sort of expected if we sent the block to the peer, as we have removed @@ -781,17 +780,13 @@ proc wantListHandler*( if have: trace "We HAVE the block", address = e.address presence.add( - BlockPresence( - address: e.address, `type`: BlockPresenceType.Have - ) + BlockPresence(address: e.address, `type`: BlockPresenceType.Have) ) else: trace "We DON'T HAVE the block", address = e.address if e.sendDontHave: presence.add( - BlockPresence( - address: e.address, `type`: BlockPresenceType.DontHave - ) + BlockPresence(address: e.address, `type`: BlockPresenceType.DontHave) ) codex_block_exchange_want_have_lists_received.inc() diff --git a/codex/blockexchange/protobuf/presence.nim b/codex/blockexchange/protobuf/presence.nim index 238f38b2..31a321d0 100644 --- a/codex/blockexchange/protobuf/presence.nim +++ b/codex/blockexchange/protobuf/presence.nim @@ -24,10 +24,8 @@ func parse(_: type UInt256, bytes: seq[byte]): ?UInt256 = UInt256.fromBytesBE(bytes).some func init*(_: type Presence, message: PresenceMessage): ?Presence = - some Presence( - address: message.address, - have: message.`type` == BlockPresenceType.Have, + address: message.address, have: message.`type` == BlockPresenceType.Have ) func init*(_: type PresenceMessage, presence: Presence): PresenceMessage = diff --git a/codex/conf.nim b/codex/conf.nim index f92ce990..f9a80175 100644 --- a/codex/conf.nim +++ b/codex/conf.nim @@ -303,7 +303,8 @@ const nimBanner* = getNimBanner() codexFullVersion* = - "Storage version: " & codexVersion & "\p" & "Storage revision: " & codexRevision & "\p" + "Storage version: " & codexVersion & "\p" & "Storage revision: " & codexRevision & + "\p" proc parseCmdArg*( T: typedesc[MultiAddress], input: string diff --git a/codex/manifest/manifest.nim b/codex/manifest/manifest.nim index 0823f804..29feff47 100644 --- a/codex/manifest/manifest.nim +++ b/codex/manifest/manifest.nim @@ -84,8 +84,7 @@ func isManifest*(mc: MultiCodec): ?!bool = func `==`*(a, b: Manifest): bool = (a.treeCid == b.treeCid) and (a.datasetSize == b.datasetSize) and (a.blockSize == b.blockSize) and (a.version == b.version) and (a.hcodec == b.hcodec) and - (a.codec == b.codec) and (a.filename == b.filename) and - (a.mimetype == b.mimetype) + (a.codec == b.codec) and (a.filename == b.filename) and (a.mimetype == b.mimetype) func `$`*(self: Manifest): string = result = diff --git a/codex/rest/api.nim b/codex/rest/api.nim index 8393a85b..1e65e9c6 100644 --- a/codex/rest/api.nim +++ b/codex/rest/api.nim @@ -489,10 +489,7 @@ proc initDebugApi(node: CodexNodeRef, conf: CodexConf, router: var RestRouter) = "", "announceAddresses": node.discovery.announceAddrs, "table": table, - "storage": { - "version": $codexVersion, - "revision": $codexRevision, - }, + "storage": {"version": $codexVersion, "revision": $codexRevision}, } # return pretty json for human readability diff --git a/codex/rest/json.nim b/codex/rest/json.nim index cfe4769c..86d84a32 100644 --- a/codex/rest/json.nim +++ b/codex/rest/json.nim @@ -10,7 +10,6 @@ import ../units export json type - RestContent* = object cid* {.serialize.}: Cid manifest* {.serialize.}: Manifest diff --git a/tests/codex/blockexchange/engine/testengine.nim b/tests/codex/blockexchange/engine/testengine.nim index 07573cf2..54f16c8d 100644 --- a/tests/codex/blockexchange/engine/testengine.nim +++ b/tests/codex/blockexchange/engine/testengine.nim @@ -253,9 +253,7 @@ asyncchecksuite "NetworkStore engine handlers": await engine.blockPresenceHandler( peerId, - blocks.mapIt( - PresenceMessage.init(Presence(address: it.address, have: true)) - ), + blocks.mapIt(PresenceMessage.init(Presence(address: it.address, have: true))), ) for a in blocks.mapIt(it.address): diff --git a/tests/codex/blockexchange/testnetwork.nim b/tests/codex/blockexchange/testnetwork.nim index 29646bc5..6af156a9 100644 --- a/tests/codex/blockexchange/testnetwork.nim +++ b/tests/codex/blockexchange/testnetwork.nim @@ -230,10 +230,7 @@ asyncchecksuite "Network - Test Limits": ): Future[void] {.async: (raises: []).} = check false - let fut = network1.send( - switch2.peerInfo.peerId, - Message() - ) + let fut = network1.send(switch2.peerInfo.peerId, Message()) await sleepAsync(100.millis) check not fut.finished diff --git a/tests/codex/testmanifest.nim b/tests/codex/testmanifest.nim index f9ba0702..099bce51 100644 --- a/tests/codex/testmanifest.nim +++ b/tests/codex/testmanifest.nim @@ -13,9 +13,8 @@ import ./helpers import ./examples suite "Manifest": - let - manifest = - Manifest.new(treeCid = Cid.example, blockSize = 1.MiBs, datasetSize = 100.MiBs) + let manifest = + Manifest.new(treeCid = Cid.example, blockSize = 1.MiBs, datasetSize = 100.MiBs) proc encodeDecode(manifest: Manifest): Manifest = let e = manifest.encode().tryGet() diff --git a/tests/integration/5_minutes/testrestapivalidation.nim b/tests/integration/5_minutes/testrestapivalidation.nim index 46141aae..e11a0d7b 100644 --- a/tests/integration/5_minutes/testrestapivalidation.nim +++ b/tests/integration/5_minutes/testrestapivalidation.nim @@ -20,7 +20,7 @@ multinodesuite "Rest API validation": test "should return 204 when attempting delete of non-existing dataset", config: let data = await RandomChunker.example(blocks = 2) let cid = (await client.upload(data)).get - + let responseBefore = await client.deleteRaw($Cid.example) check responseBefore.status == 204 check (await responseBefore.body) == "" # No content diff --git a/tests/integration/twonodes.nim b/tests/integration/twonodes.nim index a49fddcb..f9eb5d37 100644 --- a/tests/integration/twonodes.nim +++ b/tests/integration/twonodes.nim @@ -20,7 +20,6 @@ template twonodessuite*(name: string, body: untyped) = var client2 {.inject, used.}: CodexClient setup: - node1 = clients()[0] node2 = clients()[1]