diff --git a/cabal.project b/cabal.project index f4357f0bc18..a72ef774920 100644 --- a/cabal.project +++ b/cabal.project @@ -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 diff --git a/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs b/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs index ea0f66182f6..38204b0a3e6 100644 --- a/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs @@ -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 @@ -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, @@ -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 diff --git a/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs b/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs index 1dbc42bae3b..01392ee20a6 100644 --- a/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs +++ b/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs @@ -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