plutus-contract-model-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.Test.ContractModel.CrashTolerance

Synopsis

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

Instances details
ContractModel state => Eq (Action (WithCrashTolerance state)) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

(Eq state, ContractModel state) => Eq (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

ContractModel state => Show (Action (WithCrashTolerance state)) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

ContractModel state => Show (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Generic (Action (WithCrashTolerance state)) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Associated Types

type Rep (Action (WithCrashTolerance state)) :: Type -> Type Source #

Generic (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Associated Types

type Rep (WithCrashTolerance state) :: Type -> Type Source #

ContractModel state => HasSymbolics (Action (WithCrashTolerance state)) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Methods

getAllSymbolics :: Action (WithCrashTolerance state) -> SymCollectionIndex #

(Typeable state, CrashTolerance state) => ContractModel (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Associated Types

data Action (WithCrashTolerance state) Source #

data ContractInstanceKey (WithCrashTolerance state) :: Type -> Row Type -> Type -> Type -> Type Source #

Methods

instanceWallet :: forall w (s :: Row Type) e p. ContractInstanceKey (WithCrashTolerance state) w s e p -> Wallet Source #

instanceTag :: forall w (s :: Row Type) e p. SchemaConstraints w s e => ContractInstanceKey (WithCrashTolerance state) w s e p -> ContractInstanceTag Source #

arbitraryAction :: ModelState (WithCrashTolerance state) -> Gen (Action (WithCrashTolerance state)) Source #

actionName :: Action (WithCrashTolerance state) -> String Source #

waitProbability :: ModelState (WithCrashTolerance state) -> Double Source #

arbitraryWaitInterval :: ModelState (WithCrashTolerance state) -> Gen Slot Source #

initialState :: WithCrashTolerance state Source #

initialInstances :: [StartContract (WithCrashTolerance state)] Source #

precondition :: ModelState (WithCrashTolerance state) -> Action (WithCrashTolerance state) -> Bool Source #

nextReactiveState :: Slot -> Spec (WithCrashTolerance state) () Source #

nextState :: Action (WithCrashTolerance state) -> Spec (WithCrashTolerance state) () Source #

startInstances :: ModelState (WithCrashTolerance state) -> Action (WithCrashTolerance state) -> [StartContract (WithCrashTolerance state)] Source #

instanceContract :: forall w (s :: Row Type) e p. (forall t. HasSymbolicRep t => Symbolic t -> t) -> ContractInstanceKey (WithCrashTolerance state) w s e p -> p -> Contract w s e () Source #

perform :: HandleFun (WithCrashTolerance state) -> (forall t. HasSymbolicRep t => Symbolic t -> t) -> ModelState (WithCrashTolerance state) -> Action (WithCrashTolerance state) -> SpecificationEmulatorTrace () Source #

shrinkAction :: ModelState (WithCrashTolerance state) -> Action (WithCrashTolerance state) -> [Action (WithCrashTolerance state)] Source #

monitoring :: (ModelState (WithCrashTolerance state), ModelState (WithCrashTolerance state)) -> Action (WithCrashTolerance state) -> Property -> Property Source #

restricted :: Action (WithCrashTolerance state) -> Bool Source #

Eq (ContractInstanceKey state w s e p) => Eq (ContractInstanceKey (WithCrashTolerance state) w s e p) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

Show (ContractInstanceKey state w s e p) => Show (ContractInstanceKey (WithCrashTolerance state) w s e p) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

type Rep (Action (WithCrashTolerance state)) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

type Rep (Action (WithCrashTolerance state)) = D1 ('MetaData "Action" "Plutus.Contract.Test.ContractModel.CrashTolerance" "plutus-contract-model-1.2.0.0-AT5Aekx0s4LCgIL1y0MF95" 'False) (C1 ('MetaCons "Crash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SomeContractInstanceKey state))) :+: (C1 ('MetaCons "Restart" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SomeContractInstanceKey state))) :+: C1 ('MetaCons "UnderlyingAction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Action state)))))
type Rep (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

type Rep (WithCrashTolerance state) = D1 ('MetaData "WithCrashTolerance" "Plutus.Contract.Test.ContractModel.CrashTolerance" "plutus-contract-model-1.2.0.0-AT5Aekx0s4LCgIL1y0MF95" 'False) (C1 ('MetaCons "WithCrashTolerance" 'PrefixI 'True) (S1 ('MetaSel ('Just "_underlyingModelState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 state) :*: (S1 ('MetaSel ('Just "_aliveContractInstances") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SomeContractInstanceKey state]) :*: S1 ('MetaSel ('Just "_deadContractInstances") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SomeContractInstanceKey state]))))
data Action (WithCrashTolerance state) Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

data ContractInstanceKey (WithCrashTolerance state) w s e p Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

data ContractInstanceKey (WithCrashTolerance state) w s e p where

class ContractModel state => CrashTolerance state where Source #

Minimal complete definition

restartArguments, available

Methods

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 ContractInstanceKeys contain symbolic tokens or symbolic variables you **MUST** implement this function.

Orphan instances

CrashTolerance state => HasVariables (SomeContractInstanceKey state) Source # 
Instance details

Methods

getAllVariables :: SomeContractInstanceKey state -> Set (Any Var)