Skip to content

Commit

Permalink
ADD explicit error expectations for Fanout
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrange committed Feb 6, 2023
1 parent 6eaaf72 commit ae1c4e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hydra-node/test/Hydra/Chain/Direct/Contract/FanOut.hs
Expand Up @@ -93,17 +93,17 @@ data FanoutMutation
genFanoutMutation :: (Tx, UTxO) -> Gen SomeMutation
genFanoutMutation (tx, _utxo) =
oneof
[ SomeMutation Nothing MutateAddUnexpectedOutput . PrependOutput <$> do
[ SomeMutation (Just "fannedOutUtxoHash /= closedUtxoHash") MutateAddUnexpectedOutput . PrependOutput <$> do
arbitrary >>= genOutput
, SomeMutation Nothing MutateChangeOutputValue <$> do
, SomeMutation (Just "fannedOutUtxoHash /= closedUtxoHash") MutateChangeOutputValue <$> do
let outs = txOuts' tx
-- NOTE: Assumes the fanout transaction has non-empty outputs, which
-- might not be always the case when testing unbalanced txs and we need
-- to ensure it by at least one utxo is in healthyFanoutUTxO
(ix, out) <- elements (zip [0 .. length outs - 1] outs)
value' <- genValue `suchThat` (/= txOutValue out)
pure $ ChangeOutput (fromIntegral ix) (modifyTxOutValue (const value') out)
, SomeMutation Nothing MutateValidityBeforeDeadline . ChangeValidityInterval <$> do
, SomeMutation (Just "lower bound before contestation deadline") MutateValidityBeforeDeadline . ChangeValidityInterval <$> do
lb <- arbitrary `suchThat` slotBeforeContestationDeadline
pure (TxValidityLowerBound lb, TxValidityNoUpperBound)
]
Expand Down

0 comments on commit ae1c4e5

Please sign in to comment.