[marketplace] WIP prototype

This commit is contained in:
Eric Mastro 2023-01-10 12:45:01 +11:00
parent 0efdb3aad3
commit 065f89eebb
No known key found for this signature in database
GPG Key ID: 141E3048D95A4E63
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
## Nim-Codex
## Copyright (c) 2022 Status Research & Development GmbH
## Licensed under either of
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
## at your option.
## This file may not be copied, modified, or distributed except according to
## those terms.
import pkg/upraises
push: {.upraises: [].}
import pkg/datastore
import ../stores
type
Reservations* = object
repoStore: RepoStore
dataStore: Datastore
proc new*(_: type Reservations, repo: RepoStore, data: Datastore): Reservations =
let r = Reservations(repoStore: repo, dataStore: data)
return r
proc isAvailable(self: Reservations): Future[bool] {.async.} =
# TODO: query RepoStore
return true
proc reserve*(self: Reservations, bytes: uint): Future[?!void] {.async.} =
return self.repoStore.reserve(bytes)