mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-21 23:03:15 +00:00
14 lines
370 B
Nim
14 lines
370 B
Nim
import ../statemachine
|
|
import ./error
|
|
import ../../asyncyeah
|
|
|
|
type
|
|
PurchaseFailed* = ref object of PurchaseState
|
|
|
|
method `$`*(state: PurchaseFailed): string =
|
|
"failed"
|
|
|
|
method run*(state: PurchaseFailed, machine: Machine): Future[?State] {.asyncyeah.} =
|
|
let error = newException(PurchaseError, "Purchase failed")
|
|
return some State(PurchaseErrored(error: error))
|