Skip to content

Commit

Permalink
genByron stash
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Dec 7, 2024
1 parent 23c25eb commit 1a9a18a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 8 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ program-options
constraints:
quickcheck-instances==0.3.31,
data-default==0.7.1.3

source-repository-package
type: git
location: https://github.com/locallycompact/cardano-api
tag: 1a8c2e3b3f37d0738a3f3f4e6a295c550e28c655
--sha256: sha256-//LjfbOn+rnOHWNwOjV/oHRw2HJncPHHzGa022p/6Sk=
subdir:
cardano-api
6 changes: 4 additions & 2 deletions hydra-node/test/Hydra/Chain/Direct/StateSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Hydra.Chain.Direct.StateSpec where
import Hydra.Prelude hiding (label)
import Test.Hydra.Prelude

import Test.QuickCheck.Hedgehog (hedgehog)
import Cardano.Api.UTxO qualified as UTxO
import Cardano.Binary (serialize)
import Data.ByteString.Lazy qualified as LBS
Expand Down Expand Up @@ -121,7 +122,8 @@ import Hydra.Tx.Utils (dummyValidatorScript, splitUTxO)
import PlutusLedgerApi.V3 qualified as Plutus
import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs)
import Test.Hydra.Tx.Fixture (slotLength, systemStart, testNetworkId)
import Test.Hydra.Tx.Gen (genOutput, genTxOut, genTxOutAdaOnly, genTxOutByron, genUTxO1, genUTxOSized)
import Test.Gen.Cardano.Api.Typed (genTxOutByron)
import Test.Hydra.Tx.Gen (genOutput, genTxOut, genTxOutAdaOnly, genUTxO1, genUTxOSized)
import Test.Hydra.Tx.Mutation (
Mutation (..),
applyMutation,
Expand Down Expand Up @@ -273,7 +275,7 @@ spec = parallel $ do
monadicST $ do
hctx <- pickBlind $ genHydraContext maximumNumberOfParties
(ctx, stInitial@InitialState{headId}) <- pickBlind $ genStInitial hctx
utxo <- pick $ genUTxO1 genTxOutByron
utxo <- pick $ genUTxO1 (toCtxUTxOTxOut $ hedgehog genTxOutByron)
pure $
case commit ctx headId (getKnownUTxO stInitial) utxo of
Left UnsupportedLegacyOutput{} -> property True
Expand Down
8 changes: 0 additions & 8 deletions hydra-tx/testlib/Test/Hydra/Tx/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ genTxOut =
noRefScripts out =
out{txOutReferenceScript = ReferenceScriptNone}

-- | Generate a 'TxOut' with a byron address. This is usually not supported by
-- Hydra or Plutus.
genTxOutByron :: Gen (TxOut ctx)
genTxOutByron = do
addr <- ByronAddressInEra <$> arbitrary
value <- genValue
pure $ TxOut addr value TxOutDatumNone ReferenceScriptNone

-- | Generate an ada-only 'TxOut' payed to an arbitrary public key.
genTxOutAdaOnly :: VerificationKey PaymentKey -> Gen (TxOut ctx)
genTxOutAdaOnly vk = do
Expand Down

0 comments on commit 1a9a18a

Please sign in to comment.