Skip to content

Commit

Permalink
Regenerate golden files and make XXX comments mention Spec instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jul 15, 2024
1 parent a102e36 commit 63bce1b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions hydra-node/test/Hydra/Chain/Direct/Contract/Decrement.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@ data DecrementMutation
genDecrementMutation :: (Tx, UTxO) -> Gen SomeMutation
genDecrementMutation (tx, _utxo) =
oneof
[ -- XXX: parameters cid, ̃kH,n,T stay unchanged
[ -- Spec: parameters cid, ̃kH,n,T stay unchanged
SomeMutation (pure $ toErrorCode ChangedParameters) ChangePartiesInOuput <$> do
mutatedParties <- arbitrary `suchThat` (/= healthyOnChainParties)
pure $ ChangeOutput 0 $ modifyInlineDatum (replaceParties mutatedParties) headTxOut
, -- New version v′ is incremented correctly
SomeMutation (pure $ toErrorCode VersionNotIncremented) UseDifferentSnapshotVersion <$> do
mutatedSnapshotVersion <- arbitrarySizedNatural `suchThat` (/= healthySnapshotVersion + 1)
pure $ ChangeOutput 0 $ modifyInlineDatum (replaceSnapshotVersion $ toInteger mutatedSnapshotVersion) headTxOut
, -- XXX: ξ is a valid multi-signature of the currency id cid, the current snapshot state η,
-- the new snapshot number s′ and state η
, -- Spec: ξ is a valid multi-signature of the currency id cid, the current
-- snapshot state η, the new snapshot number s′ and state η
SomeMutation (pure $ toErrorCode SignatureVerificationFailed) ProduceInvalidSignatures . ChangeHeadRedeemer <$> do
invalidSignature <- toPlutusSignatures <$> (arbitrary :: Gen (MultiSignature (Snapshot Tx)))
pure $
Expand All @@ -186,7 +186,7 @@ genDecrementMutation (tx, _utxo) =
, snapshotNumber = fromIntegral healthySnapshotNumber
, numberOfDecommitOutputs = fromIntegral $ maybe 0 length $ utxoToDecommit healthySnapshot
}
, -- XXX: Transaction is signed by a participant
, -- Spec: Transaction is signed by a participant
SomeMutation (pure $ toErrorCode SignerIsNotAParticipant) AlterRequiredSigner <$> do
newSigner <- verificationKeyHash <$> genVerificationKey `suchThat` (/= somePartyCardanoVerificationKey)
pure $ ChangeRequiredSigners [newSigner]
Expand All @@ -196,7 +196,7 @@ genDecrementMutation (tx, _utxo) =
(ix, out) <- elements (zip [1 .. length outs - 1] outs)
value' <- genValue `suchThat` (/= txOutValue out)
pure $ ChangeOutput (fromIntegral ix) (modifyTxOutValue (const value') out)
, -- XXX: The value in the head output is decreased accordingly
, -- Spec: The value in the head output is decreased accordingly
SomeMutation (pure $ toErrorCode HeadValueIsNotPreserved) ChangeValueInOutput <$> do
newValue <- genValue
pure $ ChangeOutput 0 (headTxOut{txOutValue = newValue})
Expand Down
14 changes: 7 additions & 7 deletions hydra-node/test/Hydra/Chain/Direct/Contract/FanOut.hs
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ data FanoutMutation
genFanoutMutation :: (Tx, UTxO) -> Gen SomeMutation
genFanoutMutation (tx, _utxo) =
oneof
[ -- XXX: Transaction is posted after contestation deadline tmin > tfinal .
[ -- Spec: Transaction is posted after contestation deadline tmin > tfinal .
SomeMutation (pure $ toErrorCode LowerBoundBeforeContestationDeadline) MutateValidityBeforeDeadline . ChangeValidityInterval <$> do
lb <- genSlotBefore $ slotNoFromUTCTime systemStart slotLength healthyContestationDeadline
pure (TxValidityLowerBound lb, TxValidityNoUpperBound)
, -- XXX: All tokens are burnt |{cid 7→ · 7→ −1} ∈ mint| = m′ + 1.
, -- Spec: All tokens are burnt |{cid 7→ · 7→ −1} ∈ mint| = m′ + 1.
SomeMutation (pure $ toErrorCode BurntTokenNumberMismatch) MutateThreadTokenQuantity <$> do
(token, _) <- elements burntTokens
changeMintedTokens tx (valueFromList [(token, 1)])
, -- XXX: The first m outputs are distributing funds according to η. That is, the outputs exactly
, -- Spec: The first m outputs are distributing funds according to η. That is, the outputs exactly
-- correspond to the UTxO canonically combined U
SomeMutation (pure $ toErrorCode FanoutUTxOHashMismatch) MutateAddUnexpectedOutput . PrependOutput <$> do
arbitrary >>= genOutput
, -- XXX: The following n outputs are distributing funds according to η∆ .
, -- Spec: The following n outputs are distributing funds according to η∆.
-- That is, the outputs exactly # correspond to the UTxO canonically combined U∆
SomeMutation (pure $ toErrorCode FanoutUTxOToDecommitHashMismatch) MutateChangeOutputValue <$> do
let outs = txOuts' tx
Expand All @@ -144,7 +144,7 @@ genFanoutMutation (tx, _utxo) =
(ix, out) <- elements (zip [noOfUtxoToOutputs .. length outs - 1] outs)
value' <- genValue `suchThat` (/= txOutValue out)
pure $ ChangeOutput (fromIntegral ix) (modifyTxOutValue (const value') out)
, -- XXX: The following n outputs are distributing funds according to η∆ .
, -- Spec: The following n outputs are distributing funds according to η∆ .
-- That is, the outputs exactly # correspond to the UTxO canonically combined U∆
SomeMutation (pure $ toErrorCode FanoutUTxOHashMismatch) MutateChangeOutputValue <$> do
let outs = txOuts' tx
Expand All @@ -156,14 +156,14 @@ genFanoutMutation (tx, _utxo) =
(ix, out) <- elements (zip [0 .. (length outs - noOfUtxoToDecommitOutputs) - 1] outs)
value' <- genValue `suchThat` (/= txOutValue out)
pure $ ChangeOutput (fromIntegral ix) (modifyTxOutValue (const value') out)
, -- XXX: The following n outputs are distributing funds according to η∆ .
, -- Spec: The following n outputs are distributing funds according to η∆ .
-- That is, the outputs exactly # correspond to the UTxO canonically combined U∆
SomeMutation (pure $ toErrorCode FanoutUTxOToDecommitHashMismatch) MutateFanoutRedeemer . ChangeHeadRedeemer <$> do
let noOfUtxoToOutputs = fromIntegral . size $ toMap (fst healthyFanoutSnapshotUTxO)
let noOfUtxoDecommitToOutputs = fromIntegral . size $ toMap (snd healthyFanoutSnapshotUTxO)
n <- elements [1 .. 3]
pure (Head.Fanout noOfUtxoToOutputs (noOfUtxoDecommitToOutputs - n))
, -- XXX: The first m outputs are distributing funds according to η. That is, the outputs exactly
, -- Spec: The first m outputs are distributing funds according to η. That is, the outputs exactly
-- correspond to the UTxO canonically combined U
SomeMutation (pure $ toErrorCode FanoutUTxOHashMismatch) MutateFanoutRedeemer . ChangeHeadRedeemer <$> do
let noOfUtxoToOutputs = fromIntegral . size $ toMap (fst healthyFanoutSnapshotUTxO)
Expand Down
Loading

0 comments on commit 63bce1b

Please sign in to comment.