Skip to content

Commit

Permalink
PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch authored and ffakenz committed Nov 11, 2024
1 parent 2527497 commit 42eef1a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion hydra-cluster/src/Hydra/Cluster/Scenarios.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ import Network.HTTP.Req (
)
import Network.HTTP.Simple (getResponseBody, httpJSON, setRequestBodyJSON)
import Network.HTTP.Types (urlEncode)
import PlutusLedgerApi.Test.Examples (alwaysSucceedingNAryFunction)
import System.Directory (removeDirectoryRecursive)
import System.FilePath ((</>))
import Test.Hydra.Tx.Fixture (testNetworkId)
Expand Down
2 changes: 1 addition & 1 deletion hydra-node/test/Hydra/Chain/Direct/TxSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ genBlueprintTxWithUTxO =
[ pure (utxo, txbody)
, do
lovelace <- arbitrary
let redeemer = toScriptData ()
let redeemer = arbitrary `generateWith` 42
alwaysSucceedingScript = PlutusScriptSerialised dummyValidatorScript
scriptWitness = mkScriptWitness alwaysSucceedingScript NoScriptDatumForStake redeemer
stakeAddress = mkScriptStakeAddress testNetworkId alwaysSucceedingScript
Expand Down
6 changes: 2 additions & 4 deletions hydra-tx/test/Hydra/Tx/Contract/Commit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ genCommitMutation (tx, _utxo) =
(party, mCommit, toPlutusCurrencySymbol otherHeadId)
pure $ ChangeOutput 0 $ mutateHeadId commitTxOut
, SomeMutation (pure $ toErrorCode LockedValueDoesNotMatch) MutateCommitOutputValue . ChangeOutput 0 <$> do
mutatedValue <- scale (`div` 2) genValue `suchThat` (/= commitOutputValue)
pure $ commitTxOut{txOutValue = mutatedValue <> negateValue mutatedValue}
let totalValueMinusOneLovelace = negateValue (lovelaceToValue 1) <> txOutValue healthyInitialTxOut <> foldMap (txOutValue . snd) (UTxO.pairs healthyCommittedUTxO)
pure $ commitTxOut{txOutValue = totalValueMinusOneLovelace}
, SomeMutation (pure $ toErrorCode LockedValueDoesNotMatch) MutateCommittedValue <$> do
mutatedValue <- scale (`div` 2) genValue `suchThat` (/= aCommittedOutputValue)
let mutatedOutput = modifyTxOutValue (const mutatedValue) aCommittedTxOut
Expand Down Expand Up @@ -169,8 +169,6 @@ genCommitMutation (tx, _utxo) =
<$> (changeMintedTokens tx =<< genMintedOrBurnedValue)
]
where
TxOut{txOutValue = commitOutputValue} = commitTxOut

commitTxOut = fromJust $ txOuts' tx !!? 0

allComittedTxIn = UTxO.inputSet healthyCommittedUTxO & toList
Expand Down

0 comments on commit 42eef1a

Please sign in to comment.