-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ContestUsedDec AlterRedeemerDecommitHash
- Loading branch information
Showing
2 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
{-# LANGUAGE DuplicateRecordFields #-} | ||
{-# OPTIONS_GHC -Wno-orphans #-} | ||
|
||
module Hydra.Tx.Contract.Contest.ContestUsedDec where | ||
|
||
import Hydra.Cardano.Api | ||
import Hydra.Prelude hiding (label) | ||
|
||
import Hydra.Tx.Contract.Contest.Healthy () | ||
import Hydra.Contract.Error (toErrorCode) | ||
import Hydra.Contract.HeadError (HeadError (..)) | ||
import Hydra.Contract.HeadState qualified as Head | ||
import Hydra.Tx.Crypto (toPlutusSignatures) | ||
|
||
import Hydra.Tx.Contract.Contest.Healthy (healthyContestSnapshotNumber, healthySignature) | ||
import Test.Hydra.Tx.Mutation ( | ||
Mutation (..), | ||
SomeMutation (..), | ||
) | ||
import Test.QuickCheck (oneof) | ||
import Test.QuickCheck.Instances () | ||
|
||
data ContestUsedDecMutation = ContestUsedDecMutation | ||
data ContestUsedDecMutation | ||
= AlterRedeemerDecommitHash | ||
deriving stock (Generic, Show, Enum, Bounded) | ||
|
||
genContestUsedDecMutation :: (Tx, UTxO) -> Gen SomeMutation | ||
genContestUsedDecMutation (_tx, _utxo) = | ||
oneof [] | ||
SomeMutation (pure $ toErrorCode FailedContestUsedDec) AlterRedeemerDecommitHash <$> do | ||
pure $ | ||
ChangeHeadRedeemer $ | ||
Head.Contest | ||
Head.ContestUsedDec | ||
{ signature = toPlutusSignatures (healthySignature healthyContestSnapshotNumber) | ||
, alreadyDecommittedUTxOHash = mempty | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters