mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-31 07:06:59 +00:00
11 lines
262 B
Nim
11 lines
262 B
Nim
import ../statemachine
|
|
|
|
type PurchaseError* = ref object of PurchaseState
|
|
error*: ref CatchableError
|
|
|
|
method enter*(state: PurchaseError) =
|
|
without purchase =? (state.context as Purchase):
|
|
raiseAssert "invalid state"
|
|
|
|
purchase.future.fail(state.error)
|