mirror of
https://github.com/status-im/nim-codex.git
synced 2025-01-11 11:24:33 +00:00
13 lines
304 B
Nim
13 lines
304 B
Nim
|
import ../statemachine
|
||
|
import ./error
|
||
|
|
||
|
type
|
||
|
PurchaseFailed* = ref object of PurchaseState
|
||
|
|
||
|
method enter*(state: PurchaseFailed) =
|
||
|
let error = newException(PurchaseError, "Purchase failed")
|
||
|
state.switch(PurchaseErrored(error: error))
|
||
|
|
||
|
method description*(state: PurchaseFailed): string =
|
||
|
"failed"
|