mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-03 22:13:12 +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)
|