nim-codex/codex/purchasing/states/started.nim

10 lines
230 B
Nim

import ../statemachine
type PurchaseStarted* = ref object of PurchaseState
method enter*(state: PurchaseStarted) =
without purchase =? (state.context as Purchase):
raiseAssert "invalid state"
purchase.future.complete()