tests
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Chain.Direct.Contract.Contest

Synopsis

Documentation

healthyContestTx :: (Tx, UTxO) Source #

Healthy contest tx where the contester is the first one to contest and correctly pushing out the deadline by the contestation period.

healthyContestUTxOHash :: BuiltinByteString Source #

healthyContestationPeriod :: ContestationPeriod Source #

healthyClosedUTxOHash :: BuiltinByteString Source #

healthyParticipants :: [VerificationKey PaymentKey] Source #

healthyContesterVerificationKey :: VerificationKey PaymentKey Source #

healthySigningKeys :: [SigningKey HydraKey] Source #

healthySignature :: SnapshotNumber -> MultiSignature (Snapshot Tx) Source #

data ContestMutation Source #

Constructors

NotContinueContract

Ensures collectCom does not allow any output address but νHead.

MutateSignatureButNotSnapshotNumber

Invalidates the tx by changing the redeemer signature but not the snapshot number in resulting head output.

Ensures the snapshot signature is multisigned by all valid Head participants.

MutateSnapshotNumberButNotSignature

Invalidates the tx by changing the snapshot number in resulting head output but not the redeemer signature.

Ensures the snapshot signature is aligned with snapshot number.

MutateToNonNewerSnapshot

Invalidates the tx by changing the contest snapshot number too old.

This is achieved by updating the head input datum to be older, so the healthy snapshot number becomes too old.

MutateRequiredSigner

Ensures close is authenticated by one of the Head members by changing the signer used on the tx to be not one of PTs.

MutateNoRequiredSigner

Ensures close is authenticated by one of the Head members by changing the signer used on the tx to be empty.

MutateMultipleRequiredSigner

Ensures close is authenticated by one of the Head members by changing the signer used on the tx to have multiple signers (including the signer to not fail for SignerIsNotAParticipant).

MutateContestUTxOHash

Invalidates the tx by changing the utxo hash in resulting head output.

Ensures the output state is consistent with the redeemer.

SnapshotNotSignedByAllParties

Ensures the contest snapshot is multisigned by all Head participants by changing the parties in the input head datum. If they do not align the multisignature will not be valid anymore.

MutateValidityPastDeadline

Invalidates the tx by changing the upper bound to be beyond contestation deadline from head input (stored state).

ContestFromDifferentHead

Change the head policy id to simulate contestation using a ST and signer from a different head. The signer shows a correct signature but from a different head. This will cause the signer to not be present in the participation tokens.

MutateTokenMintingOrBurning

Minting or burning of tokens should not be possible in contest.

MutateInputContesters

Ensures a participant can only contest once by changing the head input datum to already include the signer.

MutateContesters

Ensures a the signer needs to be added to the head output datum.

MutateValueInOutput

Invalidates the tx by changing the output values arbitrarily to be different (not preserved) from the head.

Ensures values are preserved between head input and output.

NotUpdateDeadlineAlthoughItShould

Not pushing the contestation deadline in head output datum should not be allowed.

PushDeadlineAlthoughItShouldNot

Pushes the deadline although this is the last contest. Instead of creating another healthy case and mutate that one, this mutation just changes the starting situation so that everyone else already contested. Remember the healthyContestTx is already pushing out the deadline.

MutateOutputContestationPeriod

Ensures contestation period does not change between head input datum and head output datum.

MutatePartiesInOutput

Ensures parties do not change between head input datum and head output datum.

MutateHeadIdInOutput

Ensures headId do not change between head input datum and head output datum.

Instances

Instances details
Bounded ContestMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Contest

Enum ContestMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Contest

Generic ContestMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Contest

Associated Types

type Rep ContestMutation :: Type -> Type Source #

Show ContestMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Contest

type Rep ContestMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Contest

type Rep ContestMutation = D1 ('MetaData "ContestMutation" "Hydra.Chain.Direct.Contract.Contest" "main" 'False) ((((C1 ('MetaCons "NotContinueContract" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateSignatureButNotSnapshotNumber" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MutateSnapshotNumberButNotSignature" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MutateToNonNewerSnapshot" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateRequiredSigner" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MutateNoRequiredSigner" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateMultipleRequiredSigner" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MutateContestUTxOHash" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SnapshotNotSignedByAllParties" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateValidityPastDeadline" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ContestFromDifferentHead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateTokenMintingOrBurning" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MutateInputContesters" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MutateContesters" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateValueInOutput" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "NotUpdateDeadlineAlthoughItShould" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PushDeadlineAlthoughItShouldNot" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MutateOutputContestationPeriod" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MutatePartiesInOutput" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateHeadIdInOutput" 'PrefixI 'False) (U1 :: Type -> Type))))))