mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-12 02:13:08 +00:00
13 lines
345 B
Nim
13 lines
345 B
Nim
import ../statemachine
|
|
import ../../asyncyeah
|
|
|
|
type PurchaseErrored* = ref object of PurchaseState
|
|
error*: ref CatchableError
|
|
|
|
method `$`*(state: PurchaseErrored): string =
|
|
"errored"
|
|
|
|
method run*(state: PurchaseErrored, machine: Machine): Future[?State] {.asyncyeah.} =
|
|
let purchase = Purchase(machine)
|
|
purchase.future.fail(state.error)
|