Skip to content

Commit

Permalink
chore: reformat with nph v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fryorcraken committed Sep 10, 2024
1 parent cb9d2b4 commit 993f6e1
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 52 deletions.
3 changes: 1 addition & 2 deletions apps/liteprotocoltester/liteprotocoltester.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ when isMainModule:
wnconf: WakuNodeConf, sources: auto
) {.gcsafe, raises: [ConfigurationError].} =
echo "Loading secondary configuration file into WakuNodeConf"
sources.addConfigFile(Toml, configFile)
,
sources.addConfigFile(Toml, configFile),
)
except CatchableError:
error "Loading Waku configuration failed", error = getCurrentExceptionMsg()
Expand Down
3 changes: 1 addition & 2 deletions apps/liteprotocoltester/tester_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ proc load*(T: type LiteProtocolTesterConf, version = ""): ConfResult[T] =
secondarySources = proc(
conf: LiteProtocolTesterConf, sources: auto
) {.gcsafe, raises: [ConfigurationError].} =
sources.addConfigFile(Envvar, InputFile("liteprotocoltester"))
,
sources.addConfigFile(Envvar, InputFile("liteprotocoltester")),
)
ok(conf)
except CatchableError:
Expand Down
6 changes: 2 additions & 4 deletions tests/testlib/wakunode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ proc newTestWakuNode*(
if secureKey != "":
some(secureKey)
else:
none(string)
,
none(string),
secureCert =
if secureCert != "":
some(secureCert)
else:
none(string)
,
none(string),
agentString = agentString,
)

Expand Down
12 changes: 4 additions & 8 deletions tests/wakunode_rest/test_rest_store.nim
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ procSuite "Waku Rest API - Store v3":
if reqHash.isSome():
reqHash.get().toRestStringWakuMessageHash()
else:
""
, # base64-encoded digest. Empty ignores the field.
"", # base64-encoded digest. Empty ignores the field.
"true", # ascending
"7", # page size. Empty implies default page size.
)
Expand Down Expand Up @@ -790,8 +789,7 @@ procSuite "Waku Rest API - Store v3":
if reqHash.isSome():
reqHash.get().toRestStringWakuMessageHash()
else:
""
, # base64-encoded digest. Empty ignores the field.
"", # base64-encoded digest. Empty ignores the field.
"true", # ascending
"3", # page size. Empty implies default page size.
)
Expand Down Expand Up @@ -827,8 +825,7 @@ procSuite "Waku Rest API - Store v3":
if reqHash.isSome():
reqHash.get().toRestStringWakuMessageHash()
else:
""
, # base64-encoded digest. Empty ignores the field.
"", # base64-encoded digest. Empty ignores the field.
)

check:
Expand All @@ -850,8 +847,7 @@ procSuite "Waku Rest API - Store v3":
if reqHash.isSome():
reqHash.get().toRestStringWakuMessageHash()
else:
""
, # base64-encoded digest. Empty ignores the field.
"", # base64-encoded digest. Empty ignores the field.
"true", # ascending
"5", # page size. Empty implies default page size.
)
Expand Down
3 changes: 1 addition & 2 deletions waku/node/peer_manager/waku_peer_store.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ proc get*(peerStore: PeerStore, peerId: PeerID): RemotePeerInfo =
if peerStore[ENRBook][peerId] != default(enr.Record):
some(peerStore[ENRBook][peerId])
else:
none(enr.Record)
,
none(enr.Record),
protocols: peerStore[ProtoBook][peerId],
agent: peerStore[AgentBook][peerId],
protoVersion: peerStore[ProtoVersionBook][peerId],
Expand Down
12 changes: 4 additions & 8 deletions waku/waku_api/rest/filter/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ proc toFilterWakuMessage*(msg: WakuMessage): FilterWakuMessage =
if msg.meta.len > 0:
some(base64.encode(msg.meta))
else:
none(Base64String)
,
none(Base64String),
ephemeral: some(msg.ephemeral),
)

Expand Down Expand Up @@ -239,8 +238,7 @@ proc readValue*(
if pubsubTopic.isNone() or pubsubTopic.get() == "":
none(string)
else:
some(pubsubTopic.get())
,
some(pubsubTopic.get()),
contentFilters: contentFilters.get(),
)

Expand Down Expand Up @@ -315,8 +313,7 @@ proc readValue*(
if pubsubTopic.isNone() or pubsubTopic.get() == "":
none(string)
else:
some(pubsubTopic.get())
,
some(pubsubTopic.get()),
contentFilters: contentFilters.get(),
)

Expand Down Expand Up @@ -364,8 +361,7 @@ proc readValue*(
if pubsubTopic.isNone() or pubsubTopic.get() == "":
none(string)
else:
some(pubsubTopic.get())
,
some(pubsubTopic.get()),
contentFilters: contentFilters.get(),
)

Expand Down
3 changes: 1 addition & 2 deletions waku/waku_api/rest/legacy_store/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ proc toStoreResponseRest*(histResp: HistoryResponse): StoreResponseRest =
if message.meta.len > 0:
some(base64.encode(message.meta))
else:
none(Base64String)
,
none(Base64String),
)

var storeWakuMsgs: seq[StoreWakuMessage]
Expand Down
3 changes: 1 addition & 2 deletions waku/waku_api/rest/lightpush/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ proc readValue*(
if pubsubTopic.isNone() or pubsubTopic.get() == "":
none(string)
else:
some(pubsubTopic.get())
,
some(pubsubTopic.get()),
message: message.get(),
)
3 changes: 1 addition & 2 deletions waku/waku_api/rest/relay/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ proc toRelayWakuMessage*(msg: WakuMessage): RelayWakuMessage =
if msg.meta.len > 0:
some(base64.encode(msg.meta))
else:
none(Base64String)
,
none(Base64String),
ephemeral: some(msg.ephemeral),
)

Expand Down
12 changes: 4 additions & 8 deletions waku/waku_archive/driver/sqlite_driver/queries.nim
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ proc createTable*(db: SqliteDatabase): DatabaseResult[void] =
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand All @@ -98,8 +97,7 @@ proc createOldestMessageTimestampIndex*(db: SqliteDatabase): DatabaseResult[void
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand Down Expand Up @@ -184,8 +182,7 @@ proc deleteMessagesOlderThanTimestamp*(
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand All @@ -206,8 +203,7 @@ proc deleteOldestMessagesNotWithinLimit*(
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand Down
15 changes: 5 additions & 10 deletions waku/waku_archive_legacy/driver/sqlite_driver/queries.nim
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ proc createTable*(db: SqliteDatabase): DatabaseResult[void] =
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand All @@ -112,8 +111,7 @@ proc createOldestMessageTimestampIndex*(db: SqliteDatabase): DatabaseResult[void
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand All @@ -127,8 +125,7 @@ proc createHistoryQueryIndex*(db: SqliteDatabase): DatabaseResult[void] =
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand Down Expand Up @@ -226,8 +223,7 @@ proc deleteMessagesOlderThanTimestamp*(
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand All @@ -248,8 +244,7 @@ proc deleteOldestMessagesNotWithinLimit*(
?db.query(
query,
proc(s: ptr sqlite3_stmt) =
discard
,
discard,
)
return ok()

Expand Down
3 changes: 1 addition & 2 deletions waku/waku_keystore/utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ proc hasKeys*(data: JsonNode, keys: openArray[string]): bool =
return all(
keys,
proc(key: string): bool =
return data.hasKey(key)
,
return data.hasKey(key),
)

# Safely saves a Keystore's JsonNode to disk.
Expand Down

0 comments on commit 993f6e1

Please sign in to comment.