plutus-contract-0.1.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

(Typeable state, Show (ContractInstanceSpec state), Eq (ContractInstanceSpec 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 #

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. (SymToken -> AssetClass) -> ContractInstanceKey (WithCrashTolerance state) w s e p -> p -> Contract w s e () Source #

perform :: HandleFun (WithCrashTolerance state) -> (SymToken -> AssetClass) -> 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 #

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

Defined in Plutus.Contract.Test.ContractModel.CrashTolerance

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

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.