mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-28 05:35:17 +00:00
20 lines
540 B
Nim
20 lines
540 B
Nim
import pkg/metrics
|
|
import pkg/chronicles
|
|
import ../statemachine
|
|
|
|
declareCounter(codexPurchasesFinished, "codex purchases finished")
|
|
|
|
logScope:
|
|
topics = "marketplace purchases finished"
|
|
|
|
type PurchaseFinished* = ref object of PurchaseState
|
|
|
|
method `$`*(state: PurchaseFinished): string =
|
|
"finished"
|
|
|
|
method run*(state: PurchaseFinished, machine: Machine): Future[?State] {.async.} =
|
|
codexPurchasesFinished.inc()
|
|
let purchase = Purchase(machine)
|
|
info "Purchase finished", requestId = purchase.requestId
|
|
purchase.future.complete()
|