tests
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Chain.Direct.Contract.Abort

Description

Mutation-based script validator tests for the abort transaction where a healthyAbortTx gets mutated by an arbitrary AbortMutation.

Documentation

healthyHeadParameters :: HeadParameters Source #

healthyInitials :: [UTxOWithScript] Source #

healthyCommits :: [(TxIn, TxOut CtxUTxO, HashableScriptData, UTxO)] Source #

propHasInitial :: (Tx, UTxO) -> Property Source #

propHasCommit :: (Tx, UTxO) -> Property Source #

data AbortMutation Source #

Constructors

MutateParties

Add one more party to the hydra keys. This is essentialy the same as not collecting all inputs.

DropCollectedInput

Not collect one committed UTxO by removing the input and not burn the corresponding PT.

DropOneCommitOutput

Not reimburse one of the parties.

BurnOneTokenMore

Burning one PT more. This should be an impossible situation, but it is tested nontheless.

MutateThreadTokenQuantity

Meant to test that the minting policy is burning all PTs present in tx

MutateRequiredSigner

Check an arbitrary key cannot authenticate abort.

MutateUseDifferentHeadToAbort

Use a different head output to abort.

UseInputFromOtherHead

Spend some abortable output from a different Head e.g. replace a commit by another commit from a different Head.

ReorderCommitOutputs

Re-ordering outputs would not be a big deal, but it is still prevented.

MintOnAbort

Only burning should be allowed in abort (by the minting policy).

ExtractValue

Not spend from v_head and also not burn anything to extract value.

Instances

Instances details
Bounded AbortMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Abort

Enum AbortMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Abort

Generic AbortMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Abort

Associated Types

type Rep AbortMutation :: Type -> Type Source #

Show AbortMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Abort

type Rep AbortMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Abort

type Rep AbortMutation = D1 ('MetaData "AbortMutation" "Hydra.Chain.Direct.Contract.Abort" "main" 'False) (((C1 ('MetaCons "MutateParties" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DropCollectedInput" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DropOneCommitOutput" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BurnOneTokenMore" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateThreadTokenQuantity" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MutateRequiredSigner" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MutateUseDifferentHeadToAbort" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UseInputFromOtherHead" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ReorderCommitOutputs" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MintOnAbort" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExtractValue" 'PrefixI 'False) (U1 :: Type -> Type)))))

genAbortMutation :: (Tx, UTxO) -> Gen SomeMutation Source #

removePTFromMintedValue :: TxOut CtxUTxO -> Tx -> Value Source #