tests
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Chain.Direct.Contract.Commit

Description

Mutation-based script validator tests for the commit transaction where a healthyCommitTx gets mutated by an arbitrary CommitMutation.

Documentation

healthyCommitTx :: (Tx, UTxO) Source #

commitVerificationKey :: VerificationKey PaymentKey Source #

data CommitMutation Source #

Constructors

NonContinuousHeadId

The headId in the output datum must match the one from the input datum.

MutateCommitOutputValue

Invalidates the transaction by changing the committed output value.

MutateCommittedValue

Invalidates the transaction by changing the value of the committed utxo on the input side of the transaction.

MutateCommittedAddress

Ensures the datum recording the commit is consistent with the UTxO being committed.

RecordAllCommittedUTxO

Ensures a commit cannot be left out when "declared" in the commit transaction output datum.

MutateRequiredSigner

Ensures commit is authenticated by a Head party by changing the signer used on the transaction to be the one in the PT.

UsePTFromDifferentHead

Change the head policy id to simulate commit using a PT 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 the tokens should not be possible in commit.

Instances

Instances details
Bounded CommitMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Commit

Enum CommitMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Commit

Generic CommitMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Commit

Associated Types

type Rep CommitMutation :: Type -> Type Source #

Show CommitMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Commit

type Rep CommitMutation Source # 
Instance details

Defined in Hydra.Chain.Direct.Contract.Commit

type Rep CommitMutation = D1 ('MetaData "CommitMutation" "Hydra.Chain.Direct.Contract.Commit" "main" 'False) (((C1 ('MetaCons "NonContinuousHeadId" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateCommitOutputValue" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MutateCommittedValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateCommittedAddress" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "RecordAllCommittedUTxO" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateRequiredSigner" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UsePTFromDifferentHead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MutateTokenMintingOrBurning" 'PrefixI 'False) (U1 :: Type -> Type))))

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