Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data WithCrashTolerance state
- class ContractModel state => CrashTolerance state where
- crash :: SomeContractInstanceKey state -> Spec state ()
- restart :: SomeContractInstanceKey state -> Spec state ()
- restartArguments :: ModelState state -> ContractInstanceKey state w s e p -> p
- available :: Action state -> [SomeContractInstanceKey state] -> Bool
- contractInstanceVariables :: ContractInstanceKey state w s e p -> Set (Any Var)
Extending contract models with a model of
data WithCrashTolerance state Source #
This derived state is used to derive a new ContractModel
on top of the state
contract model
that also specifies how the contract(s) behave when contract instances crash and restart.
Instances
class ContractModel state => CrashTolerance state where Source #
crash :: SomeContractInstanceKey state -> Spec state () Source #
Specifiy what happens when a contract instance crashes
restart :: SomeContractInstanceKey state -> Spec state () Source #
Specify what happens when a contract instance is restarted
restartArguments :: ModelState state -> ContractInstanceKey state w s e p -> p Source #
Specify the arguments to give to a restarted contract
available :: Action state -> [SomeContractInstanceKey state] -> Bool Source #
Check if an action is available given a list of alive contract instances.
contractInstanceVariables :: ContractInstanceKey state w s e p -> Set (Any Var) Source #
If your ContractInstanceKey
s contain symbolic tokens or
symbolic variables you **MUST** implement this function.
Orphan instances
CrashTolerance state => HasVariables (SomeContractInstanceKey state) Source # | |
getAllVariables :: SomeContractInstanceKey state -> Set (Any Var) |