Skip to content

Commit

Permalink
Make committed value const 8₳ in healthyCommitTx
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jan 26, 2022
1 parent 13d2835 commit ee62bf5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hydra-node/test/Hydra/Chain/Direct/Contract/Commit.hs
Expand Up @@ -11,7 +11,7 @@ import Data.Maybe (fromJust)
import Hydra.Chain.Direct.Contract.Mutation (Mutation (ChangeOutput), SomeMutation (SomeMutation))
import qualified Hydra.Chain.Direct.Fixture as Fixture
import Hydra.Chain.Direct.Tx (commitTx, mkInitialOutput, pubKeyHash)
import Hydra.Ledger.Cardano (CardanoTx, CtxUTxO, Era, PaymentKey, TxIn, TxOut (TxOut), Utxo, VerificationKey, adaOnly, fromLedgerTx, genOutput, genValue, getOutputs, mkTxOutValue, singletonUtxo, toCtxUTxOTxOut, toLedgerTxIn)
import Hydra.Ledger.Cardano (CardanoTx, CtxUTxO, Era, PaymentKey, TxIn, TxOut (TxOut), Utxo, VerificationKey, adaOnly, fromLedgerTx, genOutput, genValue, getOutputs, lovelaceToValue, mkTxOutValue, modifyTxOutValue, singletonUtxo, toCtxUTxOTxOut, toLedgerTxIn)
import Hydra.Party (Party)
import Test.QuickCheck (oneof, suchThat)

Expand Down Expand Up @@ -42,12 +42,11 @@ healthyCommitTx =

initialPubKeyHash = pubKeyHash commitVerificationKey

-- NOTE: An ada-only output which is currently addressed to some arbitrary
-- public key.
-- NOTE: An 8₳ output which is currently addressed to some arbitrary key.
committedUtxo :: (TxIn, TxOut CtxUTxO Era)
committedUtxo = flip generateWith 42 $ do
txIn <- arbitrary
txOut <- adaOnly <$> (genOutput =<< arbitrary)
txOut <- modifyTxOutValue (const $ lovelaceToValue 8_000_000) <$> (genOutput =<< arbitrary)
pure (txIn, txOut)

commitVerificationKey :: VerificationKey PaymentKey
Expand Down

0 comments on commit ee62bf5

Please sign in to comment.