fixes formatting

This commit is contained in:
ThatBen 2025-03-24 14:16:12 +01:00
parent a695b0ee31
commit 538be676c2
No known key found for this signature in database
GPG Key ID: E020A7DDCD52E1AB
4 changed files with 5 additions and 11 deletions

View File

@ -78,6 +78,4 @@ proc new*(
store: RequestStore, store: RequestStore,
marketplace: MarketplaceService, marketplace: MarketplaceService,
): ChainMetrics = ): ChainMetrics =
ChainMetrics( ChainMetrics(state: state, metrics: metrics, store: store, marketplace: marketplace)
state: state, metrics: metrics, store: store, marketplace: marketplace
)

View File

@ -55,9 +55,7 @@ proc decode*(T: type RequestEntry, bytes: seq[byte]): ?!T =
return success(RequestEntry(isValid: false)) return success(RequestEntry(isValid: false))
return RequestEntry.fromBytes(bytes) return RequestEntry.fromBytes(bytes)
method add*( method add*(s: RequestStore, rid: Rid): Future[?!void] {.async: (raises: []), base.} =
s: RequestStore, rid: Rid
): Future[?!void] {.async: (raises: []), base.} =
without key =? Key.init(requeststoreName / $rid), err: without key =? Key.init(requeststoreName / $rid), err:
error "failed to format key", err = err.msg error "failed to format key", err = err.msg
return failure(err) return failure(err)
@ -110,9 +108,7 @@ method iterateAll*(
return failure(exc.msg) return failure(exc.msg)
return success() return success()
proc new*( proc new*(T: type RequestStore, state: State, store: TypedDatastore): RequestStore =
T: type RequestStore, state: State, store: TypedDatastore
): RequestStore =
RequestStore(state: state, store: store) RequestStore(state: state, store: store)
proc createRequestStore*(state: State): ?!RequestStore = proc createRequestStore*(state: State): ?!RequestStore =

View File

@ -33,7 +33,8 @@ proc fetchRequestInfo(
try: try:
let request = await market.getRequest(rid) let request = await market.getRequest(rid)
if r =? request: if r =? request:
return some(RequestInfo(pending: false, slots: r.ask.slots, slotSize: r.ask.slotSize)) return
some(RequestInfo(pending: false, slots: r.ask.slots, slotSize: r.ask.slotSize))
except CatchableError as exc: except CatchableError as exc:
trace "Failed to get request info", err = exc.msg trace "Failed to get request info", err = exc.msg
return none(RequestInfo) return none(RequestInfo)

View File

@ -96,4 +96,3 @@ suite "Requeststore":
for id in all: for id in all:
check: check:
id in ids id in ids