diff --git a/cabal.project b/cabal.project index 1155d1ff94e..9f2eace7e75 100644 --- a/cabal.project +++ b/cabal.project @@ -12,8 +12,8 @@ repository cardano-haskell-packages -- See CONTRIBUTING.md for information about when and how to update these. index-state: - , hackage.haskell.org 2025-06-11T21:55:55Z - , cardano-haskell-packages 2025-06-12T11:07:25Z + , hackage.haskell.org 2025-09-22T06:47:49Z + , cardano-haskell-packages 2025-09-22T06:47:49Z packages: **/*.cabal diff --git a/flake.lock b/flake.lock index b65f92bb826..5f86b07a03d 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1749727790, - "narHash": "sha256-yCKoVpny9PSGTcSrCtXq77FuKFlq9Hf81ULVgCvkfmc=", + "lastModified": 1758727647, + "narHash": "sha256-J0PlznW05SByIJZvP90JvFMvnHsP+Rs/qwLogpConI4=", "owner": "IntersectMBO", "repo": "cardano-haskell-packages", - "rev": "b1b559392d6fc44626cef9d5b7821421cc7adcdc", + "rev": "bbf172e0d11e3842e543df101dee223f05a2332e", "type": "github" }, "original": { @@ -823,11 +823,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1749687986, - "narHash": "sha256-cEt2Hhbc0w0SqiadjZg4TJyn2+rKxW/15nmu4an79wo=", + "lastModified": 1758759934, + "narHash": "sha256-VrTBELvtzIdsye3FZ5YVGb2CXQiyOFZPo3vsLZOFiO4=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "0949afe39e6d249b6db126a96646d3f51a4a4c11", + "rev": "84e95f44c5b56a81495f59702f56fa7d18695dcd", "type": "github" }, "original": { diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api.hs b/hydra-cardano-api/src/Hydra/Cardano/Api.hs index 516ebe93459..2c5be6a21f1 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api.hs @@ -18,7 +18,6 @@ module Hydra.Cardano.Api ( Era, LedgerEra, ledgerEraVersion, - LedgerProtocolParameters (..), -- * Wrapped Types module Hydra.Cardano.Api, @@ -88,25 +87,10 @@ import Cardano.Api.Ledger as X ( import Cardano.Api.Ledger.Lens as X ( mkAdaValue, ) -import Cardano.Api.Shelley as X ( - AcquiringFailure (..), - Hash (HeaderHash), - Key (..), +import Cardano.Api.Shelley ( + LedgerProtocolParameters, PlutusScriptOrReferenceInput (PScript), - PoolId, - ShelleyGenesis (..), ShelleyLedgerEra, - SigningKey (..), - StakeCredential (..), - VerificationKey (..), - fromAlonzoCostModels, - fromAlonzoPrices, - fromPlutusData, - fromShelleyMetadata, - toAlonzoPrices, - toPlutusData, - toShelleyMetadata, - toShelleyNetwork, ) import Cardano.Api.UTxO ( UTxO, @@ -116,7 +100,6 @@ import Cardano.Ledger.Coin as X (Coin (..)) import Hydra.Cardano.Api.Prelude ( Era, LedgerEra, - LedgerProtocolParameters, Map, ledgerEraVersion, ) @@ -136,7 +119,7 @@ import Hydra.Cardano.Api.ScriptData as Extras import Hydra.Cardano.Api.ScriptDatum as Extras import Hydra.Cardano.Api.ScriptHash as Extras import Hydra.Cardano.Api.StakeAddress as Extras -import Hydra.Cardano.Api.Tx as Extras hiding (Tx) +import Hydra.Cardano.Api.Tx as Extras import Hydra.Cardano.Api.TxBody as Extras import Hydra.Cardano.Api.TxId as Extras import Hydra.Cardano.Api.TxIn as Extras diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Address.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Address.hs index 9e28e38d495..9c6b501216b 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Address.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Address.hs @@ -2,9 +2,10 @@ module Hydra.Cardano.Api.Address where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (Address, ByronAddr) import Test.Gen.Cardano.Api.Typed (genAddressByron) +import Test.QuickCheck (Arbitrary (..)) import Test.QuickCheck.Hedgehog (hedgehog) -- * Orphans diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs index b73ce27756f..8d8e710b896 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs @@ -1,7 +1,10 @@ module Hydra.Cardano.Api.AddressInEra where -import Hydra.Cardano.Api.Prelude +import Hydra.Cardano.Api.Prelude (unsafeHashFromBytes) +import Cardano.Api (Address (..), AddressInEra (..), AddressTypeInEra (..), IsPlutusScriptLanguage, IsShelleyBasedEra, NetworkId, PaymentCredential (..), PaymentKey, PlutusScript, StakeAddressReference (..), VerificationKey (..), hashScript, makeShelleyAddressInEra, plutusScriptVersion, shelleyBasedEra, verificationKeyHash) +import Cardano.Api qualified as Api +import Cardano.Api.Shelley (fromShelleyAddrIsSbe) import Cardano.Ledger.Address qualified as Ledger import Cardano.Ledger.BaseTypes qualified as Ledger import Cardano.Ledger.Credential qualified as Ledger @@ -50,7 +53,8 @@ mkScriptAddress networkId script = makeShelleyAddressInEra shelleyBasedEra networkId - (PaymentCredentialByScript $ hashScript $ PlutusScript version script) + -- Erik TODO: The qualified `Api.PlutusScript` may not be needed when all re-exports are removed. + (PaymentCredentialByScript $ hashScript $ Api.PlutusScript version script) NoStakeAddress where version = plutusScriptVersion @lang diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/BlockHeader.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/BlockHeader.hs index 666dff0daa3..2ac0727134b 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/BlockHeader.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/BlockHeader.hs @@ -4,8 +4,9 @@ module Hydra.Cardano.Api.BlockHeader where import Hydra.Cardano.Api.Prelude +import Cardano.Api (BlockHeader (..), BlockNo (..), Hash, SlotNo (..), deserialiseFromRawBytes, proxyToAsType) import Data.ByteString qualified as BS -import Test.QuickCheck (vectorOf) +import Test.QuickCheck (Arbitrary (..), Gen, vectorOf) -- * Generators diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ChainPoint.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ChainPoint.hs index 21995cfe8dc..86ce020fee0 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ChainPoint.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ChainPoint.hs @@ -2,10 +2,9 @@ module Hydra.Cardano.Api.ChainPoint where -import Hydra.Cardano.Api.Prelude - +import Cardano.Api (BlockHeader (..), ChainPoint (..), SlotNo (..)) import Hydra.Cardano.Api.BlockHeader (genBlockHeaderHash) -import Test.QuickCheck (frequency) +import Test.QuickCheck (Arbitrary (..), Gen, frequency) -- | Get the chain point corresponding to a given 'BlockHeader'. getChainPoint :: BlockHeader -> ChainPoint diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ExecutionUnits.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ExecutionUnits.hs index a474759f780..beb62a5032e 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ExecutionUnits.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ExecutionUnits.hs @@ -1,7 +1,7 @@ module Hydra.Cardano.Api.ExecutionUnits where -import Hydra.Cardano.Api.Prelude - +import Cardano.Api (ExecutionUnits) +import Cardano.Api.Shelley (toAlonzoExUnits) import Cardano.Ledger.Alonzo.Scripts qualified as Ledger -- * Type Conversions diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Hash.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Hash.hs index 8c186e87441..6f6b071524b 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Hash.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Hash.hs @@ -2,6 +2,8 @@ module Hydra.Cardano.Api.Hash where import Hydra.Cardano.Api.Prelude +import Cardano.Api (PaymentKey, ScriptData, SerialiseAsCBOR, deserialiseFromCBOR, proxyToAsType, serialiseToCBOR) +import Cardano.Api.Shelley (Hash (..)) import Cardano.Ledger.Hashes (unsafeMakeSafeHash) import Cardano.Ledger.Keys qualified as Ledger import Cardano.Ledger.Plutus.TxInfo (transKeyHash) diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/NetworkId.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/NetworkId.hs index 4ef6d521f74..e3a6894f2d7 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/NetworkId.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/NetworkId.hs @@ -4,9 +4,10 @@ module Hydra.Cardano.Api.NetworkId where import Hydra.Cardano.Api.Prelude -import Data.Aeson (Value (String), object, withObject, (.:), (.=)) +import Cardano.Api (NetworkId (..)) +import Data.Aeson (FromJSON (..), ToJSON (..), Value (String), object, withObject, (.:), (.=)) import Hydra.Cardano.Api.NetworkMagic () -import Test.QuickCheck (oneof) +import Test.QuickCheck (Arbitrary (..), oneof) -- * Orphans diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyAssets.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyAssets.hs index 2fae022e449..b6cfa7e72f9 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyAssets.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyAssets.hs @@ -2,7 +2,8 @@ module Hydra.Cardano.Api.PolicyAssets where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (PolicyAssets (..)) +import Data.Aeson (FromJSON (..), ToJSON (..)) -- * Orphans diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyId.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyId.hs index 4306ed6c9b7..cc0757b8b9d 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyId.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/PolicyId.hs @@ -2,14 +2,15 @@ module Hydra.Cardano.Api.PolicyId where -import Hydra.Cardano.Api.Prelude - +import Cardano.Api (AsType (..), PolicyId (..), deserialiseFromRawBytes) +import Cardano.Api.Shelley (toShelleyScriptHash) import Cardano.Ledger.Alonzo.Plutus.TxInfo qualified as Ledger import Cardano.Ledger.Mary.Value qualified as Ledger import Data.Aeson (FromJSONKey (..), ToJSONKey (..)) import Hydra.Cardano.Api.ScriptHash () import PlutusLedgerApi.V3 (CurrencySymbol, fromBuiltin, unCurrencySymbol) import Test.Gen.Cardano.Api.Typed (genPolicyId) +import Test.QuickCheck (Arbitrary (..)) import Test.QuickCheck.Hedgehog (hedgehog) -- * Orphans diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Prelude.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Prelude.hs index 3100752bbd7..716cddf2823 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Prelude.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Prelude.hs @@ -1,7 +1,4 @@ module Hydra.Cardano.Api.Prelude ( - module Cardano.Api, - module Cardano.Api.Shelley, - module Data.Aeson, HasCallStack, Proxy (..), Typeable, @@ -19,25 +16,14 @@ module Hydra.Cardano.Api.Prelude ( Map, Set, unsafeHashFromBytes, - Arbitrary (..), - Gen, ) where -import Cardano.Api hiding ( - UTxO, - scriptLanguageSupportedInEra, - toLedgerUTxO, - ) -import Cardano.Api.Shelley hiding ( - UTxO, - scriptLanguageSupportedInEra, - toLedgerUTxO, - ) +import Cardano.Api (ConwayEra) +import Cardano.Api.Shelley (ShelleyLedgerEra) import Cardano.Api.UTxO (UTxO, UTxO' (..)) import Cardano.Crypto.Hash.Class qualified as CC import Cardano.Ledger.Binary qualified as Ledger import Cardano.Ledger.Core qualified as Ledger -import Data.Aeson (FromJSON (..), ToJSON (..)) import Data.ByteString (ByteString) import Data.ByteString.Lazy (fromStrict, toStrict) import Data.Map (Map) @@ -47,7 +33,6 @@ import Data.Text (Text) import Data.Text.Encoding (decodeUtf8, encodeUtf8) import Data.Typeable (Typeable) import GHC.Stack (HasCallStack) -import Test.QuickCheck (Arbitrary (..), Gen) type Era = ConwayEra diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Pretty.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Pretty.hs index d8d5335b7ed..a39222ca9fb 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Pretty.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Pretty.hs @@ -4,6 +4,7 @@ module Hydra.Cardano.Api.Pretty where import Hydra.Cardano.Api qualified as Api import Hydra.Cardano.Api.Prelude +import Cardano.Api (ScriptDataJsonSchema (..), Tx (..), TxOutDatum (..), getTxBodyContent, getTxId, hashScript, renderTxIn, renderValue, scriptDataToJson, serialiseToRawBytesHexText, txExtraKeyWits, txFee, txIns, txInsCollateral, txInsReference, txMetadata, txMintValue, txMintValueToValue, txOuts, txReturnCollateral, txTotalCollateral, txValidityLowerBound, txValidityUpperBound) import Cardano.Api.UTxO qualified as UTxO import Cardano.Binary (serialize) import Cardano.Ledger.Alonzo.Scripts qualified as Ledger diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ReferenceScript.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ReferenceScript.hs index 55269871689..6f6c2898478 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ReferenceScript.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ReferenceScript.hs @@ -1,10 +1,15 @@ module Hydra.Cardano.Api.ReferenceScript where -import Hydra.Cardano.Api.Prelude +import Hydra.Cardano.Api.Prelude (Era) + +import Cardano.Api (IsPlutusScriptLanguage, PlutusScript, babbageBasedEra, plutusScriptVersion, toScriptInAnyLang) +import Cardano.Api qualified as Api +import Cardano.Api.Shelley (ReferenceScript (..)) -- | Construct a 'ReferenceScript' from any given Plutus script. mkScriptRef :: IsPlutusScriptLanguage lang => PlutusScript lang -> ReferenceScript Era mkScriptRef = ReferenceScript babbageBasedEra . toScriptInAnyLang - . PlutusScript plutusScriptVersion + -- Erik TODO: The qualified `Api.PlutusScript` may not be needed when all re-exports are removed. + . Api.PlutusScript plutusScriptVersion diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptData.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptData.hs index 6ebce1c9b2b..6bcb637e2ea 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptData.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptData.hs @@ -2,8 +2,8 @@ module Hydra.Cardano.Api.ScriptData where -import Hydra.Cardano.Api.Prelude hiding (left) - +import Cardano.Api (CtxTx, HashableScriptData, TxOut (..), TxOutDatum (..), getScriptData, unsafeHashableScriptData) +import Cardano.Api.Shelley (fromAlonzoData, fromPlutusData, toAlonzoData, toPlutusData) import Cardano.Ledger.Core qualified as Ledger import Cardano.Ledger.Plutus.Data qualified as Ledger import PlutusLedgerApi.V3 qualified as Plutus diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptDatum.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptDatum.hs index f6e5d6870e5..a0846e11b6a 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptDatum.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptDatum.hs @@ -1,6 +1,6 @@ module Hydra.Cardano.Api.ScriptDatum where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (ScriptDatum (..), WitCtxTxIn) import Hydra.Cardano.Api.ScriptData (ToScriptData, toScriptData) diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptHash.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptHash.hs index bdf51f1aff2..fe8e9936140 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptHash.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ScriptHash.hs @@ -2,7 +2,7 @@ module Hydra.Cardano.Api.ScriptHash where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (ScriptHash, ScriptInAnyLang (..), hashScript) -- * Extras diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/StakeAddress.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/StakeAddress.hs index 2561118bd74..0e2da1c864b 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/StakeAddress.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/StakeAddress.hs @@ -1,6 +1,8 @@ module Hydra.Cardano.Api.StakeAddress where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (IsPlutusScriptLanguage (..), NetworkId, PlutusScript, StakeAddress, hashScript, makeStakeAddress) +import Cardano.Api qualified as Api +import Cardano.Api.Shelley (StakeCredential (StakeCredentialByScript)) -- | Construct a stake address from a Plutus script. mkScriptStakeAddress :: @@ -10,6 +12,6 @@ mkScriptStakeAddress :: PlutusScript lang -> StakeAddress mkScriptStakeAddress networkId script = - makeStakeAddress networkId $ StakeCredentialByScript $ hashScript $ PlutusScript version script + makeStakeAddress networkId $ StakeCredentialByScript $ hashScript $ Api.PlutusScript version script where version = plutusScriptVersion @lang diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Tx.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Tx.hs index 33bbf2eb426..b035b650be9 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Tx.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Tx.hs @@ -1,14 +1,26 @@ module Hydra.Cardano.Api.Tx ( -- * Extras module Hydra.Cardano.Api.Tx, - - -- * Re-export normal Tx (any era) - Tx, ) where import Hydra.Cardano.Api.Prelude +import Cardano.Api ( + IsShelleyBasedEra, + PaymentKey, + ShelleyWitnessSigningKey (..), + SigningKey (..), + Tx (..), + TxBodyContent (..), + getTxBody, + getTxBodyContent, + makeShelleyKeyWitness, + makeSignedTransaction, + shelleyBasedEra, + toCtxUTxOTxOut, + ) +import Cardano.Api.Shelley (ShelleyLedgerEra, Tx (ShelleyTx)) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api ( EraTx (mkBasicTx), diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs index f05a962e162..570df216a5d 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxBody.hs @@ -2,6 +2,7 @@ module Hydra.Cardano.Api.TxBody where import Hydra.Cardano.Api.Prelude +import Cardano.Api (Tx (..), TxBody (..), TxBodyScriptData (..), TxIn (..), getTxBody) import Cardano.Ledger.Alonzo.TxWits qualified as Ledger import Cardano.Ledger.Api ( AsItem (..), diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxId.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxId.hs index f97a2293949..704832185a0 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxId.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxId.hs @@ -2,8 +2,7 @@ module Hydra.Cardano.Api.TxId where -import Hydra.Cardano.Api.Prelude - +import Cardano.Api (AsType (..), TxId (..), deserialiseFromRawBytes, serialiseToRawBytes) import Cardano.Binary (FromCBOR (..), ToCBOR (..)) import Cardano.Crypto.Hash.Class qualified as CC import Cardano.Ledger.Hashes qualified as Ledger diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxIn.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxIn.hs index 7a4cdca7c0f..eedbe6d43e7 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxIn.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxIn.hs @@ -4,6 +4,23 @@ module Hydra.Cardano.Api.TxIn where import Hydra.Cardano.Api.Prelude +import Cardano.Api ( + BuildTx, + BuildTxWith (..), + KeyWitnessInCtx (..), + Tx, + TxBodyContent (..), + TxId (..), + TxIn (..), + TxIx (..), + WitCtxTxIn, + Witness, + getTxBody, + getTxBodyContent, + getTxId, + ) +import Cardano.Api qualified as Api +import Cardano.Api.Shelley (fromShelleyTxIn, toShelleyTxIn) import Cardano.Ledger.BaseTypes qualified as Ledger import Cardano.Ledger.Binary qualified as Ledger import Cardano.Ledger.Plutus (transSafeHash) @@ -11,7 +28,7 @@ import Cardano.Ledger.TxIn qualified as Ledger import Data.ByteString qualified as BS import Data.Set qualified as Set import PlutusLedgerApi.V3 qualified as Plutus -import Test.QuickCheck (choose, vectorOf) +import Test.QuickCheck (Arbitrary (..), Gen, choose, vectorOf) -- * Extras @@ -23,7 +40,9 @@ mkTxIn (getTxId . getTxBody -> txId) index = -- | Attach some verification-key witness to a 'TxIn'. withWitness :: TxIn -> (TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn Era)) withWitness txIn = - (txIn, BuildTxWith $ KeyWitness KeyWitnessForSpending) + -- Erik TODO: The qualified `Api.KeyWitness` may not be needed when all + -- re-exports are removed. + (txIn, BuildTxWith $ Api.KeyWitness KeyWitnessForSpending) -- | Access inputs of a transaction, as an ordered list. txIns' :: Tx era -> [TxIn] diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs index 3fe677d8179..69a94b6b3b2 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs @@ -4,6 +4,38 @@ import Hydra.Cardano.Api.Prelude import Hydra.Cardano.Api.TxIn (mkTxIn) import Hydra.Cardano.Api.TxOutValue (mkTxOutValue) +import Cardano.Api ( + Address (..), + AddressInEra (..), + AddressTypeInEra (..), + CtxTx, + CtxUTxO, + IsBabbageBasedEra, + IsMaryBasedEra, + IsPlutusScriptLanguage, + IsShelleyBasedEra, + PaymentKey, + Tx (..), + TxBodyContent (..), + TxIn (..), + TxOut (..), + TxOutDatum (..), + TxOutValue (..), + Value, + VerificationKey, + getTxBody, + getTxBodyContent, + hashScript, + maryBasedEra, + plutusScriptVersion, + shelleyBasedEra, + shelleyBasedEraConstraints, + toLedgerValue, + txOutValueToValue, + verificationKeyHash, + ) +import Cardano.Api qualified as Api +import Cardano.Api.Shelley (Hash (..), ReferenceScript (..), ShelleyLedgerEra, alonzoBasedEra, babbageBasedEra, fromShelleyTxOut, toShelleyScriptHash, toShelleyTxOut) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api qualified as Ledger import Cardano.Ledger.Babbage.TxInfo qualified as Ledger @@ -88,7 +120,7 @@ findTxOutByScript :: forall lang. IsPlutusScriptLanguage lang => UTxO -> - PlutusScript lang -> + Api.PlutusScript lang -> Maybe (TxIn, TxOut CtxUTxO Era) findTxOutByScript utxo script = List.find matchScript (UTxO.toList utxo) @@ -96,7 +128,7 @@ findTxOutByScript utxo script = version = plutusScriptVersion @lang matchScript = \case (_, TxOut (AddressInEra _ (ShelleyAddress _ (Ledger.ScriptHashObj scriptHash') _)) _ _ _) -> - let scriptHash = toShelleyScriptHash $ hashScript $ PlutusScript version script + let scriptHash = toShelleyScriptHash $ hashScript $ Api.PlutusScript version script in scriptHash == scriptHash' _ -> False @@ -125,7 +157,7 @@ isVkTxOut vk txOut = isScriptTxOut :: forall lang ctx era. IsPlutusScriptLanguage lang => - PlutusScript lang -> + Api.PlutusScript lang -> TxOut ctx era -> Bool isScriptTxOut script txOut = @@ -134,7 +166,7 @@ isScriptTxOut script txOut = scriptHash == sh _ -> False where - scriptHash = toShelleyScriptHash $ hashScript $ PlutusScript version script + scriptHash = toShelleyScriptHash $ hashScript $ Api.PlutusScript version script version = plutusScriptVersion @lang diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutDatum.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutDatum.hs index 506289fea8d..885b995b21b 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutDatum.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutDatum.hs @@ -1,6 +1,6 @@ module Hydra.Cardano.Api.TxOutDatum where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (IsAlonzoBasedEra, IsBabbageBasedEra, TxOutDatum (..), alonzoBasedEra, babbageBasedEra, hashScriptDataBytes) import Hydra.Cardano.Api.ScriptData (ToScriptData, toScriptData) diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutValue.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutValue.hs index b5118ebcc47..46e510f3432 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutValue.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/TxOutValue.hs @@ -1,6 +1,6 @@ module Hydra.Cardano.Api.TxOutValue where -import Hydra.Cardano.Api.Prelude +import Cardano.Api (IsMaryBasedEra, TxOutValue (..), Value, maryBasedEra, shelleyBasedEra, shelleyBasedEraConstraints, toLedgerValue) -- | Inject some 'Value' into a 'TxOutValue' mkTxOutValue :: diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/UTxO.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/UTxO.hs index 76990cf7df5..ccf9abb16c7 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/UTxO.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/UTxO.hs @@ -1,9 +1,10 @@ module Hydra.Cardano.Api.UTxO where -import Hydra.Cardano.Api.Prelude hiding (fromLedgerUTxO) +import Hydra.Cardano.Api.Prelude import Hydra.Cardano.Api.TxId (toLedgerTxId) import Hydra.Cardano.Api.TxIn (txIns') +import Cardano.Api (Tx (..), TxBody (..), getTxId, shelleyBasedEra) import Cardano.Api.Tx.UTxO qualified as Api.UTxO import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api (outputsTxBodyL) diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/ValidityInterval.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/ValidityInterval.hs index 10b512b5a9a..3814a434ffe 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/ValidityInterval.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/ValidityInterval.hs @@ -4,9 +4,11 @@ module Hydra.Cardano.Api.ValidityInterval where import Hydra.Cardano.Api.Prelude +import Cardano.Api.Shelley (TxValidityLowerBound (..), TxValidityUpperBound (..), allegraBasedEra, cardanoEra, shelleyBasedEra) import Cardano.Ledger.Allegra.Scripts qualified as Ledger import Cardano.Ledger.BaseTypes (StrictMaybe (..), maybeToStrictMaybe) import Test.Gen.Cardano.Api.Typed (genTxValidityLowerBound, genTxValidityUpperBound) +import Test.QuickCheck (Arbitrary (..)) import Test.QuickCheck.Hedgehog (hedgehog) toLedgerValidityInterval :: diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Value.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Value.hs index ee073311fb3..c8fbfc41dcf 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Value.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Value.hs @@ -1,8 +1,10 @@ module Hydra.Cardano.Api.Value where -import Hydra.Cardano.Api.Prelude hiding (toLedgerValue) +import Hydra.Cardano.Api.Prelude +import Cardano.Api (AssetId (..), AssetName (..), CtxTx, Quantity (..), TxOut (..), TxOutValue (..), Value, lovelaceToValue, negateValue, shelleyBasedEra, toCtxUTxOTxOut, txOutValueToValue) import Cardano.Api.Ledger (Coin (..), PParams) +import Cardano.Api.Shelley (fromMaryValue, toMaryValue, toShelleyTxOut) import Cardano.Ledger.Core (getMinCoinTxOut) import Cardano.Ledger.Mary.Value qualified as Ledger import Data.Word (Word64) diff --git a/hydra-cardano-api/src/Hydra/Cardano/Api/Witness.hs b/hydra-cardano-api/src/Hydra/Cardano/Api/Witness.hs index dda9e9e35c5..04f6c5f0ecf 100644 --- a/hydra-cardano-api/src/Hydra/Cardano/Api/Witness.hs +++ b/hydra-cardano-api/src/Hydra/Cardano/Api/Witness.hs @@ -1,6 +1,18 @@ module Hydra.Cardano.Api.Witness where -import Hydra.Cardano.Api.Prelude +import Cardano.Api.Shelley ( + ExecutionUnits (..), + HasScriptLanguageInEra, + IsPlutusScriptLanguage, + PlutusScript, + PlutusScriptOrReferenceInput (PReferenceScript, PScript), + ScriptDatum, + ScriptRedeemer, + ScriptWitness (..), + TxIn, + plutusScriptVersion, + scriptLanguageInEra, + ) -- | Construct a full script witness from a datum, a redeemer and a full -- 'PlutusScript'. That witness has no execution budget. diff --git a/hydra-chain-observer/hydra-chain-observer.cabal b/hydra-chain-observer/hydra-chain-observer.cabal index a883e006455..cafab45d2b7 100644 --- a/hydra-chain-observer/hydra-chain-observer.cabal +++ b/hydra-chain-observer/hydra-chain-observer.cabal @@ -44,6 +44,7 @@ library , base >=4.8.0 , base16-bytestring , blockfrost-client >=0.9.2.0 + , cardano-api , http-conduit , hydra-cardano-api , hydra-node diff --git a/hydra-chain-observer/src/Hydra/Blockfrost/ChainObserver.hs b/hydra-chain-observer/src/Hydra/Blockfrost/ChainObserver.hs index 83efcbd3815..de88feb2c8b 100644 --- a/hydra-chain-observer/src/Hydra/Blockfrost/ChainObserver.hs +++ b/hydra-chain-observer/src/Hydra/Blockfrost/ChainObserver.hs @@ -9,6 +9,7 @@ import Blockfrost.Client ( runBlockfrost, ) import Blockfrost.Client qualified as Blockfrost +import Cardano.Api (BlockHeader (..)) import Control.Concurrent.Class.MonadSTM ( MonadSTM (readTVarIO), writeTVar, @@ -27,9 +28,6 @@ import Hydra.Cardano.Api ( UTxO, serialiseToRawBytes, ) -import Hydra.Cardano.Api.Prelude ( - BlockHeader (..), - ) import Hydra.ChainObserver.NodeClient ( ChainObservation (..), ChainObserverLog (..), diff --git a/hydra-chain-observer/src/Hydra/ChainObserver/NodeClient.hs b/hydra-chain-observer/src/Hydra/ChainObserver/NodeClient.hs index ef2810760cf..278e2e4d284 100644 --- a/hydra-chain-observer/src/Hydra/ChainObserver/NodeClient.hs +++ b/hydra-chain-observer/src/Hydra/ChainObserver/NodeClient.hs @@ -4,6 +4,7 @@ module Hydra.ChainObserver.NodeClient where import Hydra.Prelude +import Cardano.Api (TxId) import Hydra.Cardano.Api ( BlockNo, ChainPoint, @@ -12,7 +13,6 @@ import Hydra.Cardano.Api ( Tx, UTxO, ) -import Hydra.Cardano.Api.Prelude (TxId) import Hydra.Contract (HydraScriptCatalogue) import Hydra.Ledger.Cardano (adjustUTxO) import Hydra.Tx.HeadId (HeadId (..)) diff --git a/hydra-chain-observer/test/Hydra/ChainObserverSpec.hs b/hydra-chain-observer/test/Hydra/ChainObserverSpec.hs index 1d16a82f359..6091623668e 100644 --- a/hydra-chain-observer/test/Hydra/ChainObserverSpec.hs +++ b/hydra-chain-observer/test/Hydra/ChainObserverSpec.hs @@ -15,6 +15,8 @@ import Test.Aeson.GenericSpecs ( roundtripAndGoldenADTSpecsWithSettings, roundtripAndGoldenSpecsWithSettings, ) +import Test.Hspec (Spec, parallel) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture (testNetworkId) import Test.QuickCheck (counterexample, forAll, forAllBlind, property, (=/=), (===)) import Test.QuickCheck.Property (checkCoverage) diff --git a/hydra-cluster/bench/Bench/EndToEnd.hs b/hydra-cluster/bench/Bench/EndToEnd.hs index 58d03f42d41..f9f7bae7312 100644 --- a/hydra-cluster/bench/Bench/EndToEnd.hs +++ b/hydra-cluster/bench/Bench/EndToEnd.hs @@ -6,6 +6,7 @@ import Hydra.Prelude import Test.Hydra.Prelude import Bench.Summary (Summary (..), SystemStats, makeQuantiles) +import Cardano.Api.Shelley (getVerificationKey) import CardanoNode (findRunningCardanoNode', withCardanoNodeDevnet) import Control.Concurrent.Class.MonadSTM ( MonadSTM (readTVarIO), @@ -28,7 +29,7 @@ import Data.Set ((\\)) import Data.Set qualified as Set import Data.Text (pack) import Data.Time (UTCTime (UTCTime), utctDayTime) -import Hydra.Cardano.Api (NetworkId, SocketPath, Tx, TxId, UTxO, getVerificationKey, lovelaceToValue, signTx) +import Hydra.Cardano.Api (NetworkId, SocketPath, Tx, TxId, UTxO, lovelaceToValue, signTx) import Hydra.Chain.Backend (ChainBackend) import Hydra.Chain.Backend qualified as Backend import Hydra.Cluster.Faucet (FaucetLog (..), publishHydraScriptsAs, returnFundsToFaucet', seedFromFaucet) diff --git a/hydra-cluster/hydra-cluster.cabal b/hydra-cluster/hydra-cluster.cabal index 2f0e772f051..3f267e425d8 100644 --- a/hydra-cluster/hydra-cluster.cabal +++ b/hydra-cluster/hydra-cluster.cabal @@ -87,6 +87,7 @@ library , async , base >=4.7 && <5 , bytestring + , cardano-api , cardano-ledger-alonzo , cardano-ledger-api , cardano-ledger-core @@ -95,6 +96,7 @@ library , contra-tracer , directory , filepath + , hspec , http-conduit , http-types , hydra-cardano-api @@ -164,6 +166,7 @@ test-suite tests , async , base >=4.7 && <5 , bytestring + , cardano-api , cardano-ledger-api , containers , directory @@ -210,6 +213,7 @@ benchmark bench-e2e , aeson , base >=4.7 && <5 , bytestring + , cardano-api , containers , directory , filepath diff --git a/hydra-cluster/src/CardanoClient.hs b/hydra-cluster/src/CardanoClient.hs index de07a9693b0..c3ca6f8365d 100644 --- a/hydra-cluster/src/CardanoClient.hs +++ b/hydra-cluster/src/CardanoClient.hs @@ -15,6 +15,7 @@ import Hydra.Cardano.Api hiding (Block) import Hydra.Chain.Backend qualified as Backend import Hydra.Chain.CardanoClient +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.Map qualified as Map import Hydra.Chain.Backend (ChainBackend) diff --git a/hydra-cluster/src/Hydra/Cluster/Faucet.hs b/hydra-cluster/src/Hydra/Cluster/Faucet.hs index 4dbe61ffbeb..eb524a2d192 100644 --- a/hydra-cluster/src/Hydra/Cluster/Faucet.hs +++ b/hydra-cluster/src/Hydra/Cluster/Faucet.hs @@ -6,6 +6,7 @@ import Hydra.Cardano.Api import Hydra.Prelude import Test.Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import CardanoClient ( QueryPoint (QueryTip), diff --git a/hydra-cluster/src/Hydra/Cluster/Scenarios.hs b/hydra-cluster/src/Hydra/Cluster/Scenarios.hs index a258904bba8..f17f9b0e29a 100644 --- a/hydra-cluster/src/Hydra/Cluster/Scenarios.hs +++ b/hydra-cluster/src/Hydra/Cluster/Scenarios.hs @@ -6,6 +6,7 @@ module Hydra.Cluster.Scenarios where import Hydra.Prelude import Test.Hydra.Prelude +import Cardano.Api.Shelley (LedgerProtocolParameters (..), SigningKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Tx (hashScriptIntegrity) import Cardano.Ledger.Api (RewardAccount (..), Withdrawals (..), collateralInputsTxBodyL, hashScript, scriptTxWitsL, totalCollateralTxBodyL, withdrawalsTxBodyL) @@ -45,9 +46,7 @@ import Hydra.Cardano.Api ( Coin (..), Era, File (File), - Key (SigningKey), KeyWitnessInCtx (..), - LedgerProtocolParameters (..), PaymentKey, PolicyId (..), Tx, @@ -62,7 +61,6 @@ import Hydra.Cardano.Api ( fromLedgerTx, getTxBody, getTxId, - getVerificationKey, lovelaceToValue, makeSignedTransaction, mkScriptAddress, @@ -160,6 +158,7 @@ import Network.HTTP.Types (urlEncode) import System.Environment (setEnv, unsetEnv) import System.FilePath (()) import System.Process (callProcess) +import Test.Hspec (shouldBe, shouldContain, shouldMatchList, shouldNotBe, shouldReturn, shouldSatisfy, shouldThrow) import Test.Hydra.Tx.Fixture (testNetworkId) import Test.Hydra.Tx.Gen (genDatum, genKeyPair, genTxOutWithReferenceScript, genUTxOWithAssetsSized) import Test.QuickCheck (Positive, choose, elements, generate) @@ -1390,7 +1389,7 @@ canDepositPartially tracer workDir blockTime backend hydraScriptsTxId = -- check that user balance balance contains the change from the commit tx (balance <$> Backend.queryUTxOFor backend QueryTip walletVk) `shouldReturn` lovelaceToValue (seedAmount + seedAmount - commitAmount) - <> tokenDiff + <> tokenDiff send n2 $ input "Close" [] @@ -1410,7 +1409,7 @@ canDepositPartially tracer workDir blockTime backend hydraScriptsTxId = (balance <$> Backend.queryUTxOFor backend QueryTip walletVk) -- NOTE: in the end we expect seedAmount * 2 since we seeded from faucet twice + assets we minted `shouldReturn` lovelaceToValue (seedAmount * 2) - <> tokenAssetValue + <> tokenAssetValue where hydraTracer = contramap FromHydraNode tracer diff --git a/hydra-cluster/src/Hydra/Cluster/Util.hs b/hydra-cluster/src/Hydra/Cluster/Util.hs index 452163efdf8..618cf73fd1f 100644 --- a/hydra-cluster/src/Hydra/Cluster/Util.hs +++ b/hydra-cluster/src/Hydra/Cluster/Util.hs @@ -3,13 +3,12 @@ module Hydra.Cluster.Util where import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import Data.Aeson qualified as Aeson import Data.ByteString qualified as BS import Hydra.Cardano.Api ( - Key (VerificationKey, getVerificationKey), NetworkId, PaymentKey, - SigningKey, TextEnvelopeError (TextEnvelopeAesonDecodeError), TxId, deserialiseFromTextEnvelope, diff --git a/hydra-cluster/src/Hydra/Generator.hs b/hydra-cluster/src/Hydra/Generator.hs index d36c6ba6570..9f6f382df54 100644 --- a/hydra-cluster/src/Hydra/Generator.hs +++ b/hydra-cluster/src/Hydra/Generator.hs @@ -3,6 +3,7 @@ module Hydra.Generator where import Hydra.Cardano.Api import Hydra.Prelude hiding (size) +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import CardanoClient (QueryPoint (QueryTip), mkGenesisTx, queryUTxOFor) import Control.Monad (foldM) diff --git a/hydra-cluster/src/HydraNode.hs b/hydra-cluster/src/HydraNode.hs index eae0c6decfd..becd59071c1 100644 --- a/hydra-cluster/src/HydraNode.hs +++ b/hydra-cluster/src/HydraNode.hs @@ -5,6 +5,7 @@ module HydraNode where import Hydra.Cardano.Api import Hydra.Prelude hiding (STM, delete) +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import CardanoNode (cliQueryProtocolParameters) import Control.Concurrent.Async (forConcurrently_) import Control.Concurrent.Class.MonadSTM (modifyTVar', readTVarIO) @@ -49,7 +50,8 @@ import System.Process.Typed ( waitExitCode, withProcessTerm, ) -import Test.Hydra.Prelude (failAfter, failure, shouldNotBe, withLogFile) +import Test.Hspec (shouldNotBe) +import Test.Hydra.Prelude (failAfter, failure, withLogFile) import Prelude qualified -- * Client to interact with a hydra-node diff --git a/hydra-cluster/test/Test/BlockfrostChainSpec.hs b/hydra-cluster/test/Test/BlockfrostChainSpec.hs index 0164d248753..30597cd4b1f 100644 --- a/hydra-cluster/test/Test/BlockfrostChainSpec.hs +++ b/hydra-cluster/test/Test/BlockfrostChainSpec.hs @@ -61,6 +61,7 @@ import Test.DirectChainSpec ( observesInTimeSatisfying', waitMatch, ) +import Test.Hspec (Spec, around, it, pendingWith) import Test.Hydra.Tx.Gen (genKeyPair) import Test.QuickCheck (generate) diff --git a/hydra-cluster/test/Test/CardanoClientSpec.hs b/hydra-cluster/test/Test/CardanoClientSpec.hs index ad0718b2682..95f721a5b78 100644 --- a/hydra-cluster/test/Test/CardanoClientSpec.hs +++ b/hydra-cluster/test/Test/CardanoClientSpec.hs @@ -1,6 +1,7 @@ module Test.CardanoClientSpec where import Hydra.Prelude +import Test.Hspec (Spec, around, it, shouldBe) import Test.Hydra.Prelude import CardanoNode (withCardanoNodeDevnet) diff --git a/hydra-cluster/test/Test/CardanoNodeSpec.hs b/hydra-cluster/test/Test/CardanoNodeSpec.hs index 63d10be80e9..7963c7441fa 100644 --- a/hydra-cluster/test/Test/CardanoNodeSpec.hs +++ b/hydra-cluster/test/Test/CardanoNodeSpec.hs @@ -1,6 +1,7 @@ module Test.CardanoNodeSpec where import Hydra.Prelude +import Test.Hspec (Spec, around, describe, it, pendingWith, shouldBe, shouldContain, shouldReturn, shouldSatisfy) import Test.Hydra.Prelude import CardanoNode ( diff --git a/hydra-cluster/test/Test/ChainObserverSpec.hs b/hydra-cluster/test/Test/ChainObserverSpec.hs index 98408123944..7997a2d1cce 100644 --- a/hydra-cluster/test/Test/ChainObserverSpec.hs +++ b/hydra-cluster/test/Test/ChainObserverSpec.hs @@ -30,6 +30,7 @@ import Hydra.Options (DirectOptions (..)) import HydraNode (HydraNodeLog, input, output, requestCommitTx, send, waitFor, waitMatch, withHydraNode) import System.IO.Error (isEOFError, isIllegalOperation) import System.Process (CreateProcess (std_out), StdStream (..), proc, withCreateProcess) +import Test.Hspec (Spec, it) import Test.Hydra.Tx.Fixture (aliceSk, cperiod) import Test.Hydra.Tx.Gen (genKeyPair) import Test.QuickCheck (generate) diff --git a/hydra-cluster/test/Test/DirectChainSpec.hs b/hydra-cluster/test/Test/DirectChainSpec.hs index 248c761f151..a29134bfcf2 100644 --- a/hydra-cluster/test/Test/DirectChainSpec.hs +++ b/hydra-cluster/test/Test/DirectChainSpec.hs @@ -5,6 +5,7 @@ module Test.DirectChainSpec where import Hydra.Prelude import Test.Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api (bodyTxL, reqSignerHashesTxBodyL) import CardanoClient ( @@ -20,7 +21,6 @@ import Data.Set qualified as Set import Hydra.Cardano.Api ( ChainPoint (..), CtxUTxO, - Key (SigningKey), PaymentKey, TxOut, UTxO', @@ -32,7 +32,6 @@ import Hydra.Cardano.Api ( txIns', txOutValue, unFile, - verificationKeyHash, ) import Hydra.Chain ( Chain (Chain, draftCommitTx, postTx), @@ -81,6 +80,7 @@ import Hydra.Tx.Utils ( ) import System.FilePath (()) import System.Process (proc, readCreateProcess) +import Test.Hspec (Spec, around, it, shouldBe, shouldContain, shouldMatchList, shouldThrow) import Test.Hydra.Tx.Gen (genKeyPair) import Test.QuickCheck (choose, generate) diff --git a/hydra-cluster/test/Test/EndToEndSpec.hs b/hydra-cluster/test/Test/EndToEndSpec.hs index 2ed324f1984..a11f40c808b 100644 --- a/hydra-cluster/test/Test/EndToEndSpec.hs +++ b/hydra-cluster/test/Test/EndToEndSpec.hs @@ -4,8 +4,10 @@ module Test.EndToEndSpec where import Hydra.Prelude +import Test.Hspec (Spec, around, describe, it, shouldBe, shouldContain, shouldReturn, shouldSatisfy, shouldThrow) import Test.Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey) import Cardano.Api.UTxO qualified as UTxO import CardanoClient ( waitForUTxO, diff --git a/hydra-cluster/test/Test/GeneratorSpec.hs b/hydra-cluster/test/Test/GeneratorSpec.hs index 2c37fa4fd3b..8151ca1ba65 100644 --- a/hydra-cluster/test/Test/GeneratorSpec.hs +++ b/hydra-cluster/test/Test/GeneratorSpec.hs @@ -3,7 +3,6 @@ module Test.GeneratorSpec where import Hydra.Prelude -import Test.Hydra.Prelude import Cardano.Api.UTxO qualified as UTxO import Data.Text (unpack) @@ -19,6 +18,8 @@ import Hydra.Generator ( import Hydra.Ledger (applyTransactions) import Hydra.Ledger.Cardano (Globals, LedgerEnv, Tx, cardanoLedger, newLedgerEnv) import Test.Aeson.GenericSpecs (roundtripSpecs) +import Test.Hspec (Spec, parallel) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Node.Fixture (defaultGlobals, defaultPParams) import Test.QuickCheck ( Positive (Positive), diff --git a/hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs b/hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs index 1e251868fc4..554a7793f4b 100644 --- a/hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs +++ b/hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs @@ -19,6 +19,7 @@ import Hydra.Options ( import System.Exit (ExitCode (..)) import System.FilePath (()) import System.Process (proc, readCreateProcessWithExitCode, readProcess) +import Test.Hspec (Spec, around, describe, it, shouldBe, shouldContain, shouldSatisfy) import Test.QuickCheck (generate) spec :: Spec @@ -33,7 +34,8 @@ spec = (exitCode, output, _errors) <- readCreateProcessWithExitCode (cardanoCliSign txFile) "" exitCode `shouldBe` ExitSuccess output - ^? key "type" . _String `shouldSatisfy` \case + ^? key "type" . _String + `shouldSatisfy` \case Nothing -> False Just something -> something == "Tx ConwayEra" diff --git a/hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs b/hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs index ceaf0c8cd85..082fb6a3de3 100644 --- a/hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs +++ b/hydra-cluster/test/Test/Hydra/Cluster/FaucetSpec.hs @@ -17,6 +17,7 @@ import Hydra.Cluster.Fixture (Actor (..)) import Hydra.Cluster.Scenarios (EndToEndLog (..)) import Hydra.Cluster.Util (keysFor) import Hydra.Logging (Tracer, showLogsOnFailure) +import Test.Hspec (Spec, around, describe, it, shouldBe, shouldSatisfy) import Test.Hydra.Tx.Gen (genVerificationKey) import Test.QuickCheck (choose, elements, forAll, generate, withMaxSuccess) diff --git a/hydra-cluster/test/Test/Hydra/Cluster/HydraClientSpec.hs b/hydra-cluster/test/Test/Hydra/Cluster/HydraClientSpec.hs index 2d17124b78c..25b6a05eca1 100644 --- a/hydra-cluster/test/Test/Hydra/Cluster/HydraClientSpec.hs +++ b/hydra-cluster/test/Test/Hydra/Cluster/HydraClientSpec.hs @@ -4,8 +4,10 @@ module Test.Hydra.Cluster.HydraClientSpec where import Hydra.Prelude +import Test.Hspec (Spec, around, it) import Test.Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey) import Cardano.Api.UTxO qualified as UTxO import CardanoNode ( withCardanoNodeDevnet, diff --git a/hydra-cluster/test/Test/Hydra/Cluster/MithrilSpec.hs b/hydra-cluster/test/Test/Hydra/Cluster/MithrilSpec.hs index a69e32502cb..a289bf2a4b7 100644 --- a/hydra-cluster/test/Test/Hydra/Cluster/MithrilSpec.hs +++ b/hydra-cluster/test/Test/Hydra/Cluster/MithrilSpec.hs @@ -11,6 +11,7 @@ import Hydra.Cluster.Mithril (MithrilLog (..), downloadLatestSnapshotTo) import Hydra.Logging (Envelope (..), Tracer, traceInTVar) import System.Directory (doesDirectoryExist) import System.FilePath (()) +import Test.Hspec (Spec, describe, parallel, pendingWith, shouldReturn) import Test.Hydra.Cluster.Utils (forEachKnownNetwork) spec :: Spec diff --git a/hydra-cluster/test/Test/Hydra/Cluster/Utils.hs b/hydra-cluster/test/Test/Hydra/Cluster/Utils.hs index 2dd727f9363..eb9d94a4f12 100644 --- a/hydra-cluster/test/Test/Hydra/Cluster/Utils.hs +++ b/hydra-cluster/test/Test/Hydra/Cluster/Utils.hs @@ -1,7 +1,7 @@ module Test.Hydra.Cluster.Utils where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, it) import Hydra.Cardano.Api (ChainPoint, SlotNo, chainPointToSlotNo) import Hydra.Cluster.Fixture (KnownNetwork (..)) diff --git a/hydra-cluster/test/Test/OfflineChainSpec.hs b/hydra-cluster/test/Test/OfflineChainSpec.hs index aadc049f740..fbab7843143 100644 --- a/hydra-cluster/test/Test/OfflineChainSpec.hs +++ b/hydra-cluster/test/Test/OfflineChainSpec.hs @@ -17,6 +17,7 @@ import Hydra.Cluster.Fixture (alice) import Hydra.Cluster.Util (readConfigFile) import Hydra.Options (OfflineChainConfig (..)) import System.FilePath (()) +import Test.Hspec (Spec, it, shouldBe, shouldNotBe) spec :: Spec spec = do diff --git a/hydra-node/hydra-node.cabal b/hydra-node/hydra-node.cabal index 8ae8d81b00a..ac2dac27a94 100644 --- a/hydra-node/hydra-node.cabal +++ b/hydra-node/hydra-node.cabal @@ -352,6 +352,7 @@ test-suite tests , amazonka-s3 , base , bytestring + , cardano-api , cardano-api:gen , cardano-binary , cardano-crypto-class diff --git a/hydra-node/src/Hydra/Chain/Backend.hs b/hydra-node/src/Hydra/Chain/Backend.hs index 248945fce18..e7e1dfe9748 100644 --- a/hydra-node/src/Hydra/Chain/Backend.hs +++ b/hydra-node/src/Hydra/Chain/Backend.hs @@ -2,6 +2,7 @@ module Hydra.Chain.Backend where import Hydra.Prelude +import Cardano.Api.Shelley (LedgerProtocolParameters (..), PoolId, VerificationKey) import Cardano.Api.UTxO qualified as UTxO import Data.Map.Strict qualified as Map import Hydra.Cardano.Api diff --git a/hydra-node/src/Hydra/Chain/Blockfrost/Client.hs b/hydra-node/src/Hydra/Chain/Blockfrost/Client.hs index a8c1f662204..7486a9946c5 100644 --- a/hydra-node/src/Hydra/Chain/Blockfrost/Client.hs +++ b/hydra-node/src/Hydra/Chain/Blockfrost/Client.hs @@ -29,6 +29,9 @@ import Blockfrost.Client ( unSlot, ) import Blockfrost.Client qualified as Blockfrost + +import Cardano.Api (fromNetworkMagic) +import Cardano.Api.Shelley (PoolId, StakePoolKey, VerificationKey, verificationKeyHash) import Cardano.Chain.Genesis (mainnetProtocolMagicId) import Cardano.Crypto.ProtocolMagic (ProtocolMagicId (..)) import Data.Map.Strict qualified as Map @@ -61,7 +64,6 @@ import Data.List qualified as List import Data.SOP.NonEmpty (nonEmptyFromList) import Data.Set qualified as Set import Data.Text qualified as T -import Hydra.Cardano.Api.Prelude (StakePoolKey, fromNetworkMagic) import Hydra.Options (BlockfrostOptions (..)) import Hydra.Tx (ScriptRegistry, newScriptRegistry) import Money qualified diff --git a/hydra-node/src/Hydra/Chain/CardanoClient.hs b/hydra-node/src/Hydra/Chain/CardanoClient.hs index 293dd192b37..774e10f33d1 100644 --- a/hydra-node/src/Hydra/Chain/CardanoClient.hs +++ b/hydra-node/src/Hydra/Chain/CardanoClient.hs @@ -8,6 +8,7 @@ import Hydra.Prelude import Hydra.Cardano.Api hiding (Block, queryCurrentEra) +import Cardano.Api.Shelley (AcquiringFailure, PoolId, ShelleyLedgerEra, VerificationKey) import Cardano.Api.UTxO qualified as UTxO import Data.Aeson (eitherDecode', encode) import Data.Set qualified as Set diff --git a/hydra-node/src/Hydra/Chain/Direct/State.hs b/hydra-node/src/Hydra/Chain/Direct/State.hs index dbe7a63bfe7..8541c3173a8 100644 --- a/hydra-node/src/Hydra/Chain/Direct/State.hs +++ b/hydra-node/src/Hydra/Chain/Direct/State.hs @@ -10,6 +10,7 @@ module Hydra.Chain.Direct.State where import Hydra.Prelude hiding (init) +import Cardano.Api.Shelley (Key (..), toShelleyNetwork, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.List qualified as List import Data.Map qualified as Map @@ -20,7 +21,6 @@ import Hydra.Cardano.Api ( AssetName (AssetName), ChainPoint (..), CtxUTxO, - Key (SigningKey, VerificationKey, verificationKeyHash), NetworkId (Mainnet, Testnet), NetworkMagic (NetworkMagic), PaymentKey, @@ -47,7 +47,6 @@ import Hydra.Cardano.Api ( negateValue, selectAsset, toCtxUTxOTxOut, - toShelleyNetwork, txIns', txOutScriptData, txOutValue, diff --git a/hydra-node/src/Hydra/Chain/Direct/TimeHandle.hs b/hydra-node/src/Hydra/Chain/Direct/TimeHandle.hs index ff3bb615d1b..b33f1c2f3b8 100644 --- a/hydra-node/src/Hydra/Chain/Direct/TimeHandle.hs +++ b/hydra-node/src/Hydra/Chain/Direct/TimeHandle.hs @@ -5,12 +5,12 @@ module Hydra.Chain.Direct.TimeHandle where import Hydra.Prelude +import Cardano.Api (ChainPoint (..)) import Cardano.Slotting.Slot (SlotNo (SlotNo)) import Cardano.Slotting.Time (SystemStart (SystemStart), fromRelativeTime, toRelativeTime) import Data.Time (secondsToNominalDiffTime) import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import Hydra.Cardano.Api (EraHistory (EraHistory)) -import Hydra.Cardano.Api.Prelude (ChainPoint (ChainPoint, ChainPointAtGenesis)) import Hydra.Chain.Backend (ChainBackend (..)) import Hydra.Chain.CardanoClient (QueryPoint (QueryTip)) import Hydra.Ledger.Cardano.Evaluate (eraHistoryWithHorizonAt) diff --git a/hydra-node/src/Hydra/Chain/Direct/Wallet.hs b/hydra-node/src/Hydra/Chain/Direct/Wallet.hs index de9c084422f..3b6b9fe37a6 100644 --- a/hydra-node/src/Hydra/Chain/Direct/Wallet.hs +++ b/hydra-node/src/Hydra/Chain/Direct/Wallet.hs @@ -6,6 +6,7 @@ module Hydra.Chain.Direct.Wallet where import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey, verificationKeyHash) import Cardano.Api.UTxO (UTxO) import Cardano.Ledger.Address qualified as Ledger import Cardano.Ledger.Alonzo.Plutus.Context (ContextError, EraPlutusContext) @@ -81,9 +82,7 @@ import Hydra.Cardano.Api ( PaymentCredential (PaymentCredentialByKey), PaymentKey, ShelleyAddr, - SigningKey, StakeAddressReference (NoStakeAddress), - VerificationKey, fromLedgerTx, fromLedgerTxIn, fromLedgerUTxO, @@ -93,7 +92,6 @@ import Hydra.Cardano.Api ( toLedgerAddr, toLedgerTx, toLedgerUTxO, - verificationKeyHash, ) import Hydra.Cardano.Api qualified as Api import Hydra.Chain.CardanoClient (QueryPoint (..)) diff --git a/hydra-node/src/Hydra/Chain/Offline.hs b/hydra-node/src/Hydra/Chain/Offline.hs index 251d50d1bb5..9942612e45e 100644 --- a/hydra-node/src/Hydra/Chain/Offline.hs +++ b/hydra-node/src/Hydra/Chain/Offline.hs @@ -4,12 +4,13 @@ import Hydra.Prelude import Cardano.Api.Internal.Genesis (shelleyGenesisDefaults) import Cardano.Api.Internal.GenesisParameters (fromShelleyGenesis) +import Cardano.Api.Shelley (ShelleyGenesis (..)) import Cardano.Ledger.Slot (unSlotNo) import Cardano.Slotting.Time (SystemStart (SystemStart), mkSlotLength) import Control.Monad.Class.MonadAsync (link) import Data.Aeson qualified as Aeson import Data.Aeson.Types qualified as Aeson -import Hydra.Cardano.Api (GenesisParameters (..), ShelleyEra, ShelleyGenesis (..), Tx) +import Hydra.Cardano.Api (GenesisParameters (..), ShelleyEra, Tx) import Hydra.Chain ( Chain (..), ChainComponent, diff --git a/hydra-node/src/Hydra/Chain/ScriptRegistry.hs b/hydra-node/src/Hydra/Chain/ScriptRegistry.hs index 517a457f76b..dec87f3206a 100644 --- a/hydra-node/src/Hydra/Chain/ScriptRegistry.hs +++ b/hydra-node/src/Hydra/Chain/ScriptRegistry.hs @@ -4,18 +4,16 @@ module Hydra.Chain.ScriptRegistry where import Hydra.Prelude +import Cardano.Api.Shelley (Key (..), PoolId, SigningKey) import Cardano.Api.UTxO qualified as UTxO import Data.List ((!!)) import Hydra.Cardano.Api ( Era, EraHistory, - Key (..), LedgerEra, NetworkId, PParams, PaymentKey, - PoolId, - SigningKey, SystemStart, Tx, TxBodyErrorAutoBalance, diff --git a/hydra-node/src/Hydra/Ledger/Cardano.hs b/hydra-node/src/Hydra/Ledger/Cardano.hs index 6f04f4a78ce..6fa13d1bdcd 100644 --- a/hydra-node/src/Hydra/Ledger/Cardano.hs +++ b/hydra-node/src/Hydra/Ledger/Cardano.hs @@ -14,6 +14,7 @@ import Hydra.Prelude import Hydra.Cardano.Api hiding (initialLedgerState, utxoFromTx) import Hydra.Ledger.Cardano.Builder +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Rules ( FailureDescription (..), diff --git a/hydra-node/src/Hydra/Network.hs b/hydra-node/src/Hydra/Network.hs index dc934227e0c..a1f1ae46d3c 100644 --- a/hydra-node/src/Hydra/Network.hs +++ b/hydra-node/src/Hydra/Network.hs @@ -16,13 +16,13 @@ module Hydra.Network ( import Hydra.Prelude hiding (show) +import Cardano.Api.Shelley (Key (SigningKey)) import Cardano.Ledger.Orphans () import Data.Aeson (FromJSONKeyFunction (FromJSONKeyTextParser), ToJSONKey (..)) import Data.Aeson.Types (FromJSONKey (..), toJSONKeyText) import Data.IP (IP, toIPv4w) import Data.Text (pack, unpack) import Data.Text qualified as T -import Hydra.Cardano.Api (Key (SigningKey)) import Hydra.Tx (Party) import Hydra.Tx.Crypto (HydraKey) import Network.Socket (PortNumber) diff --git a/hydra-node/src/Hydra/Node.hs b/hydra-node/src/Hydra/Node.hs index cc4f1ee9a2a..25247a54a06 100644 --- a/hydra-node/src/Hydra/Node.hs +++ b/hydra-node/src/Hydra/Node.hs @@ -10,6 +10,7 @@ module Hydra.Node where import Hydra.Prelude +import Cardano.Api.Shelley (getVerificationKey) import Conduit (MonadUnliftIO, ZipSink (..), foldMapC, foldlC, mapC, mapM_C, runConduitRes, (.|)) import Control.Concurrent.Class.MonadSTM ( stateTVar, @@ -19,9 +20,6 @@ import Control.Monad.Trans.Writer (execWriter, tell) import Data.Text (pack) import Hydra.API.ClientInput (ClientInput) import Hydra.API.Server (Server, sendMessage) -import Hydra.Cardano.Api ( - getVerificationKey, - ) import Hydra.Chain ( Chain (..), ChainEvent (..), diff --git a/hydra-node/src/Hydra/Node/Run.hs b/hydra-node/src/Hydra/Node/Run.hs index e979244854f..260ed73a96f 100644 --- a/hydra-node/src/Hydra/Node/Run.hs +++ b/hydra-node/src/Hydra/Node/Run.hs @@ -2,6 +2,7 @@ module Hydra.Node.Run where import Hydra.Prelude hiding (fromList) +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Ledger.BaseTypes (Globals (..), boundRational, mkActiveSlotCoeff, unNonZero) import Cardano.Ledger.Shelley.API (computeRandomnessStabilisationWindow, computeStabilityWindow) import Cardano.Slotting.EpochInfo (fixedEpochInfo) @@ -16,7 +17,6 @@ import Hydra.Cardano.Api ( ShelleyEra, SystemStart (..), Tx, - toShelleyNetwork, ) import Hydra.Chain (ChainComponent, ChainStateHistory, maximumNumberOfParties) import Hydra.Chain.Backend (ChainBackend (queryGenesisParameters)) diff --git a/hydra-node/src/Hydra/Node/Util.hs b/hydra-node/src/Hydra/Node/Util.hs index e6abd15f0ce..6d36659326e 100644 --- a/hydra-node/src/Hydra/Node/Util.hs +++ b/hydra-node/src/Hydra/Node/Util.hs @@ -4,13 +4,12 @@ module Hydra.Node.Util where import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) + import Hydra.Cardano.Api ( File (..), HasTextEnvelope, PaymentKey, - SigningKey, - VerificationKey, - getVerificationKey, readFileTextEnvelope, ) diff --git a/hydra-node/src/Hydra/Utils.hs b/hydra-node/src/Hydra/Utils.hs index a0aa5b66c6c..1d442354667 100644 --- a/hydra-node/src/Hydra/Utils.hs +++ b/hydra-node/src/Hydra/Utils.hs @@ -2,11 +2,12 @@ module Hydra.Utils where import Hydra.Prelude +import Cardano.Api.Shelley (Key (SigningKey), getVerificationKey, writeFileTextEnvelope) import Crypto.Random (getRandomBytes) import Data.Aeson qualified as Aeson import Data.Aeson.Types qualified as Aeson import GHC.IO.Exception (userError) -import Hydra.Cardano.Api (File (..), FileError (FileIOError), Key (SigningKey), getVerificationKey, writeFileTextEnvelope) +import Hydra.Cardano.Api (File (..), FileError (FileIOError)) import Hydra.Options (GenerateKeyPair (..)) import Hydra.Tx.Crypto (HydraKey, generateSigningKey) import System.Directory (doesFileExist) diff --git a/hydra-node/test/Hydra/API/ClientInputSpec.hs b/hydra-node/test/Hydra/API/ClientInputSpec.hs index ac522ac19bf..d3a296622fe 100644 --- a/hydra-node/test/Hydra/API/ClientInputSpec.hs +++ b/hydra-node/test/Hydra/API/ClientInputSpec.hs @@ -1,7 +1,6 @@ module Hydra.API.ClientInputSpec where import Hydra.Prelude -import Test.Hydra.Prelude import Data.Aeson (Result (..), fromJSON) import Data.Aeson.Lens (key) @@ -14,6 +13,8 @@ import Test.Aeson.GenericSpecs ( defaultSettings, roundtripAndGoldenADTSpecsWithSettings, ) +import Test.Hspec (Spec, describe, parallel) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (counterexample, forAll, property) spec :: Spec diff --git a/hydra-node/test/Hydra/API/HTTPServerSpec.hs b/hydra-node/test/Hydra/API/HTTPServerSpec.hs index b0db14b249b..3e1d8dfd602 100644 --- a/hydra-node/test/Hydra/API/HTTPServerSpec.hs +++ b/hydra-node/test/Hydra/API/HTTPServerSpec.hs @@ -1,7 +1,6 @@ module Hydra.API.HTTPServerSpec where import Hydra.Prelude hiding (delete, get) -import Test.Hydra.Prelude import Cardano.Api.UTxO qualified as UTxO import Control.Concurrent.STM (newTChanIO, writeTChan) @@ -47,6 +46,8 @@ import Hydra.Tx.Snapshot (Snapshot (..)) import System.FilePath (()) import System.IO.Unsafe (unsafePerformIO) import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs) +import Test.Hspec (Spec, describe, it, parallel, runIO) +import Test.Hspec.QuickCheck (prop) import Test.Hspec.Wai (MatchBody (..), ResponseMatcher (matchBody), delete, get, post, shouldRespondWith, with) import Test.Hspec.Wai.Internal (withApplication) import Test.Hydra.Node.Fixture (testEnvironment) diff --git a/hydra-node/test/Hydra/API/ServerOutputSpec.hs b/hydra-node/test/Hydra/API/ServerOutputSpec.hs index 8510aa92ec9..6afa499be3b 100644 --- a/hydra-node/test/Hydra/API/ServerOutputSpec.hs +++ b/hydra-node/test/Hydra/API/ServerOutputSpec.hs @@ -16,6 +16,8 @@ import Test.Aeson.GenericSpecs ( defaultSettings, roundtripAndGoldenADTSpecsWithSettings, ) +import Test.Hspec (Spec, it, parallel) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (conjoin, withMaxSuccess) spec :: Spec diff --git a/hydra-node/test/Hydra/API/ServerSpec.hs b/hydra-node/test/Hydra/API/ServerSpec.hs index 6a0c0b35134..6d7669c813a 100644 --- a/hydra-node/test/Hydra/API/ServerSpec.hs +++ b/hydra-node/test/Hydra/API/ServerSpec.hs @@ -48,6 +48,7 @@ import Network.Simple.WSS qualified as WSS import Network.TLS (ClientHooks (onServerCertificate), ClientParams (clientHooks), defaultParamsClient) import Network.WebSockets (Connection, ConnectionException, receiveData, runClient, sendBinaryData) import System.IO.Error (isAlreadyInUseError) +import Test.Hspec (Expectation, Spec, describe, it, shouldBe, shouldReturn, shouldSatisfy, shouldThrow) import Test.Hydra.Node.Fixture (testEnvironment) import Test.Hydra.Tx.Fixture (alice, defaultPParams, testHeadId) import Test.Hydra.Tx.Gen () diff --git a/hydra-node/test/Hydra/BehaviorSpec.hs b/hydra-node/test/Hydra/BehaviorSpec.hs index da837a15ec7..efb2c6ba1fa 100644 --- a/hydra-node/test/Hydra/BehaviorSpec.hs +++ b/hydra-node/test/Hydra/BehaviorSpec.hs @@ -3,8 +3,9 @@ module Hydra.BehaviorSpec where import Hydra.Prelude -import Test.Hydra.Prelude hiding (shouldBe, shouldNotBe, shouldReturn, shouldSatisfy) +import Test.Hydra.Prelude +import Cardano.Api.Shelley (SigningKey) import Control.Concurrent.Class.MonadSTM ( modifyTVar, modifyTVar', @@ -21,7 +22,6 @@ import Data.List qualified as List import Hydra.API.ClientInput import Hydra.API.Server (Server (..), mkTimedServerOutputFromStateEvent) import Hydra.API.ServerOutput (ClientMessage (..), DecommitInvalidReason (..), ServerOutput (..), TimedServerOutput (..)) -import Hydra.Cardano.Api (SigningKey) import Hydra.Chain ( Chain (..), ChainEvent (..), @@ -55,6 +55,8 @@ import Hydra.Tx.Crypto (HydraKey, aggregate, sign) import Hydra.Tx.IsTx (IsTx (..)) import Hydra.Tx.Party (Party (..), deriveParty, getParty) import Hydra.Tx.Snapshot (Snapshot (..), SnapshotNumber, getSnapshot) +import Test.Hspec (Spec, describe, it, parallel, shouldContain) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture ( alice, aliceSk, diff --git a/hydra-node/test/Hydra/Chain/Direct/HandlersSpec.hs b/hydra-node/test/Hydra/Chain/Direct/HandlersSpec.hs index c1574729ee3..7ff5cfa545b 100644 --- a/hydra-node/test/Hydra/Chain/Direct/HandlersSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/HandlersSpec.hs @@ -4,6 +4,7 @@ module Hydra.Chain.Direct.HandlersSpec where import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (VerificationKey) import Control.Concurrent.Class.MonadSTM (MonadSTM (..)) import Control.Tracer (nullTracer) import Data.Maybe (fromJust) @@ -13,7 +14,6 @@ import Hydra.Cardano.Api ( PaymentKey, SlotNo (..), Tx, - VerificationKey, fromLedgerTx, genTxIn, getChainPoint, @@ -57,6 +57,8 @@ import Hydra.Chain.Direct.State qualified as Transition import Hydra.Chain.Direct.TimeHandle (TimeHandle (slotToUTCTime), TimeHandleParams (..), genTimeParams, mkTimeHandle) import Hydra.Tx.HeadParameters (HeadParameters) import Hydra.Tx.OnChainId (OnChainId) +import Test.Hspec (Spec, describe, shouldBe, shouldThrow) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Prelude import Test.QuickCheck ( counterexample, diff --git a/hydra-node/test/Hydra/Chain/Direct/ScriptRegistrySpec.hs b/hydra-node/test/Hydra/Chain/Direct/ScriptRegistrySpec.hs index 61dc2364bc6..0601a7e5309 100644 --- a/hydra-node/test/Hydra/Chain/Direct/ScriptRegistrySpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/ScriptRegistrySpec.hs @@ -1,12 +1,13 @@ module Hydra.Chain.Direct.ScriptRegistrySpec where import Hydra.Prelude -import Test.Hydra.Prelude import Hydra.Tx.ScriptRegistry ( newScriptRegistry, registryUTxO, ) +import Test.Hspec (Spec) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Gen (genScriptRegistry) import Test.QuickCheck (forAllBlind, (===)) diff --git a/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs b/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs index 3427af4f3a9..fdb5180274f 100644 --- a/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/StateSpec.hs @@ -122,6 +122,8 @@ import Hydra.Tx.Snapshot qualified as Snapshot import Hydra.Tx.Utils (dummyValidatorScript, splitUTxO) import PlutusLedgerApi.V3 qualified as Plutus import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs) +import Test.Hspec (Spec, SpecWith, describe, it, parallel) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture (slotLength, systemStart, testNetworkId) import Test.Hydra.Tx.Gen (genOutput, genTxOut, genTxOutAdaOnly, genTxOutByron, genUTxO1, genUTxOSized) import Test.Hydra.Tx.Mutation ( diff --git a/hydra-node/test/Hydra/Chain/Direct/TimeHandleSpec.hs b/hydra-node/test/Hydra/Chain/Direct/TimeHandleSpec.hs index 7ed9f803e84..fc984e30599 100644 --- a/hydra-node/test/Hydra/Chain/Direct/TimeHandleSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/TimeHandleSpec.hs @@ -1,13 +1,14 @@ module Hydra.Chain.Direct.TimeHandleSpec where import Hydra.Prelude hiding (label) -import Test.Hydra.Prelude import Cardano.Ledger.Slot (SlotNo (SlotNo)) import Cardano.Slotting.Time (SystemStart (SystemStart)) import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import Hydra.Chain.Direct.TimeHandle (TimeHandle (..), mkTimeHandle) import Hydra.Ledger.Cardano.Evaluate (eraHistoryWithHorizonAt) +import Test.Hspec (Spec, it, shouldBe) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, counterexample, forAllBlind, property, (===)) spec :: Spec diff --git a/hydra-node/test/Hydra/Chain/Direct/TxSpec.hs b/hydra-node/test/Hydra/Chain/Direct/TxSpec.hs index 56e425efa2a..3987bd4db63 100644 --- a/hydra-node/test/Hydra/Chain/Direct/TxSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/TxSpec.hs @@ -7,6 +7,7 @@ import Hydra.Cardano.Api import Hydra.Prelude hiding (label) import Test.Hydra.Prelude +import Cardano.Api.Shelley (fromPlutusData, fromShelleyMetadata, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.TxAuxData (AlonzoTxAuxData (..)) import Cardano.Ledger.Api ( @@ -52,6 +53,8 @@ import Hydra.Tx.ScriptRegistry (registryUTxO) import Hydra.Tx.Utils (verificationKeyToOnChainId) import Test.Cardano.Ledger.Shelley.Arbitrary (genMetadata') import Test.Gen.Cardano.Api.Typed (genHashableScriptData) +import Test.Hspec (Spec, describe, parallel) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture ( pparams, testNetworkId, diff --git a/hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs b/hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs index d1a98cc4b24..eb0b2991469 100644 --- a/hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs @@ -19,8 +19,8 @@ module Hydra.Chain.Direct.TxTraceSpec where import Hydra.Prelude hiding (Any, State, label, show) -import Test.Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey) import Cardano.Api.UTxO (UTxO, totalLovelace) import Cardano.Api.UTxO qualified as UTxO import Data.List (nub, (\\)) @@ -33,7 +33,6 @@ import Hydra.Cardano.Api ( SlotNo (..), TxId, TxOutDatum, - VerificationKey, getTxBody, getTxId, lovelaceToValue, @@ -64,6 +63,8 @@ import Hydra.Tx.Party (partyToChain) import Hydra.Tx.ScriptRegistry (ScriptRegistry, registryUTxO) import Hydra.Tx.Snapshot (ConfirmedSnapshot (..), Snapshot (..), SnapshotNumber (..), SnapshotVersion (..), getSnapshot, number) import PlutusTx.Builtins (toBuiltin) +import Test.Hspec (Spec) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture (alice, bob, carol, testNetworkId) import Test.Hydra.Tx.Fixture qualified as Fixture import Test.Hydra.Tx.Gen ( diff --git a/hydra-node/test/Hydra/Chain/Direct/WalletSpec.hs b/hydra-node/test/Hydra/Chain/Direct/WalletSpec.hs index 321e687a856..4bc1cc83b54 100644 --- a/hydra-node/test/Hydra/Chain/Direct/WalletSpec.hs +++ b/hydra-node/test/Hydra/Chain/Direct/WalletSpec.hs @@ -3,8 +3,8 @@ module Hydra.Chain.Direct.WalletSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, fromShelleyPaymentCredential, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api (AlonzoEraTxWits (rdmrsTxWitsL), ConwayEra, EraTx (getMinFeeTx, witsTxL), EraTxBody (feeTxBodyL, inputsTxBodyL), PParams, bodyTxL, coinTxOutL, outputsTxBodyL) import Cardano.Ledger.Babbage.Tx (AlonzoTx (..)) @@ -27,7 +27,6 @@ import Hydra.Cardano.Api ( LedgerEra, PaymentCredential (PaymentCredentialByKey), PaymentKey, - VerificationKey, fromLedgerTx, fromLedgerTxOut, fromLedgerUTxO, @@ -36,10 +35,8 @@ import Hydra.Cardano.Api ( toLedgerTxIn, toLedgerUTxO, txOutValue, - verificationKeyHash, ) import Hydra.Cardano.Api qualified as Api -import Hydra.Cardano.Api.Prelude (fromShelleyPaymentCredential) import Hydra.Cardano.Api.Pretty (renderTx) import Hydra.Cardano.Api.Tx (signTx, toLedgerTx) import Hydra.Chain.CardanoClient (QueryPoint (..)) @@ -55,6 +52,8 @@ import Hydra.Chain.Direct.Wallet ( findLargestUTxO, newTinyWallet, ) +import Test.Hspec (Expectation, Spec, describe, parallel, shouldBe, shouldReturn, shouldSatisfy) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture qualified as Fixture import Test.Hydra.Tx.Gen (genKeyPair, genOneUTxOFor, genSigningKey) import Test.QuickCheck ( diff --git a/hydra-node/test/Hydra/CryptoSpec.hs b/hydra-node/test/Hydra/CryptoSpec.hs index 10364c9c35a..32f9f0e997c 100644 --- a/hydra-node/test/Hydra/CryptoSpec.hs +++ b/hydra-node/test/Hydra/CryptoSpec.hs @@ -6,7 +6,8 @@ module Hydra.CryptoSpec where import Hydra.Tx.Crypto import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, describe, it, shouldContain, shouldEndWith, shouldNotBe) +import Test.Hspec.QuickCheck (prop) import Cardano.Crypto.DSIGN (SigDSIGN (SigEd25519DSIGN)) import Cardano.Crypto.PinnedSizedBytes (psbFromByteString) diff --git a/hydra-node/test/Hydra/Events/FileBasedSpec.hs b/hydra-node/test/Hydra/Events/FileBasedSpec.hs index bec5feebf1c..82410ec2395 100644 --- a/hydra-node/test/Hydra/Events/FileBasedSpec.hs +++ b/hydra-node/test/Hydra/Events/FileBasedSpec.hs @@ -24,6 +24,8 @@ import Test.Aeson.GenericSpecs ( roundtripAndGoldenSpecsWithSettings, sampleSize, ) +import Test.Hspec (Spec, describe) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (forAllShrink, ioProperty, sublistOf, (===)) import Test.QuickCheck.Gen (listOf) diff --git a/hydra-node/test/Hydra/Events/RotationSpec.hs b/hydra-node/test/Hydra/Events/RotationSpec.hs index 3b30affac05..317ea67b811 100644 --- a/hydra-node/test/Hydra/Events/RotationSpec.hs +++ b/hydra-node/test/Hydra/Events/RotationSpec.hs @@ -17,6 +17,8 @@ import Hydra.Node (DraftHydraNode, hydrate) import Hydra.Node.State (NodeState (..), initNodeState) import Hydra.NodeSpec (createMockEventStore, inputsToOpenHead, notConnect, observationInput, primeWith, runToCompletion) import Hydra.Tx.ContestationPeriod (toNominalDiffTime) +import Test.Hspec (Spec, around, describe, it, parallel, shouldBe) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Node.Fixture (testEnvironment, testHeadId) import Test.Hydra.Tx.Fixture (cperiod) import Test.QuickCheck (Positive (..), choose, sized) diff --git a/hydra-node/test/Hydra/Events/S3Spec.hs b/hydra-node/test/Hydra/Events/S3Spec.hs index 8eef11fc773..f62a5cffbd8 100644 --- a/hydra-node/test/Hydra/Events/S3Spec.hs +++ b/hydra-node/test/Hydra/Events/S3Spec.hs @@ -9,6 +9,8 @@ import Amazonka.Auth qualified as AWS import Amazonka.S3 qualified as AWS import Hydra.Events (EventId, EventSink (..), EventSource, HasEventId, getEvents) import Hydra.Events.S3 (fromObjectKey, newS3EventStore, purgeEvents, toObjectKey) +import Test.Hspec (Spec, around, around_, describe, it, pendingWith, shouldBe, shouldReturn) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (chooseBoundedIntegral, counterexample, forAllShrink, ioProperty, sized, sublistOf, withMaxSuccess, (===)) spec :: Spec diff --git a/hydra-node/test/Hydra/Events/UDPSpec.hs b/hydra-node/test/Hydra/Events/UDPSpec.hs index 9328ba77239..9f6fd3ef800 100644 --- a/hydra-node/test/Hydra/Events/UDPSpec.hs +++ b/hydra-node/test/Hydra/Events/UDPSpec.hs @@ -2,13 +2,13 @@ module Hydra.Events.UDPSpec where import Hydra.Prelude -import Test.Hydra.Prelude import Control.Monad.Trans.Resource (runResourceT) import Data.ByteString.Char8 qualified as BS8 import Hydra.Events (EventId, EventSink (..), putEvent) import Hydra.Events.UDP (newUDPEventSink, withUDPEventSink) import Network.UDP (recvFrom, serverSocket, stop) +import Test.Hspec (Spec, describe, it, shouldContain) import Test.Network.Ports (withFreePort) spec :: Spec diff --git a/hydra-node/test/Hydra/HeadLogicSnapshotSpec.hs b/hydra-node/test/Hydra/HeadLogicSnapshotSpec.hs index 5c9fedab19a..9b2da016754 100644 --- a/hydra-node/test/Hydra/HeadLogicSnapshotSpec.hs +++ b/hydra-node/test/Hydra/HeadLogicSnapshotSpec.hs @@ -4,7 +4,6 @@ module Hydra.HeadLogicSnapshotSpec where import Hydra.Prelude hiding (label) -import Test.Hydra.Prelude import Data.List qualified as List import Data.Map.Strict qualified as Map @@ -20,6 +19,8 @@ import Hydra.Tx.HeadParameters (HeadParameters (..)) import Hydra.Tx.IsTx (txId) import Hydra.Tx.Party (Party, deriveParty) import Hydra.Tx.Snapshot (ConfirmedSnapshot (..), Snapshot (..), getSnapshot) +import Test.Hspec (Spec, describe, expectationFailure, it, parallel, shouldBe) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture ( alice, aliceSk, diff --git a/hydra-node/test/Hydra/HeadLogicSpec.hs b/hydra-node/test/Hydra/HeadLogicSpec.hs index 3eedb66a8fd..0d0291109d2 100644 --- a/hydra-node/test/Hydra/HeadLogicSpec.hs +++ b/hydra-node/test/Hydra/HeadLogicSpec.hs @@ -49,6 +49,8 @@ import Hydra.Tx.HeadParameters (HeadParameters (..)) import Hydra.Tx.IsTx (IsTx (..)) import Hydra.Tx.Party (Party (..), deriveParty) import Hydra.Tx.Snapshot (ConfirmedSnapshot (..), Snapshot (..), SnapshotNumber, SnapshotVersion, getSnapshot) +import Test.Hspec (Spec, describe, it, parallel, shouldBe, shouldNotBe, shouldSatisfy) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Node.Fixture qualified as Fixture import Test.Hydra.Tx.Fixture (alice, aliceSk, bob, bobSk, carol, carolSk, deriveOnChainId, testHeadId, testHeadSeed) import Test.Hydra.Tx.Gen (genKeyPair, genOutput) diff --git a/hydra-node/test/Hydra/JSONSchemaSpec.hs b/hydra-node/test/Hydra/JSONSchemaSpec.hs index 330ab92c461..10087c5bc82 100644 --- a/hydra-node/test/Hydra/JSONSchemaSpec.hs +++ b/hydra-node/test/Hydra/JSONSchemaSpec.hs @@ -9,6 +9,7 @@ import Data.Aeson (Value (..), object, (.=)) import Data.Aeson.Lens (key) import Hydra.JSONSchema (prop_validateJSONSchema, validateJSON, withJsonSpecifications) import System.FilePath (()) +import Test.Hspec (Spec, describe, it, shouldThrow) import Test.QuickCheck.Instances.Time () spec :: Spec diff --git a/hydra-node/test/Hydra/Ledger/CardanoSpec.hs b/hydra-node/test/Hydra/Ledger/CardanoSpec.hs index 09fc5d95118..77e4eef24bf 100644 --- a/hydra-node/test/Hydra/Ledger/CardanoSpec.hs +++ b/hydra-node/test/Hydra/Ledger/CardanoSpec.hs @@ -4,8 +4,11 @@ module Hydra.Ledger.CardanoSpec where import Hydra.Cardano.Api import Hydra.Prelude hiding (toList) +import Test.Hspec (Expectation, Spec, describe, it, parallel) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey) import Cardano.Ledger.Api (ensureMinCoinTxOut) import Cardano.Ledger.Credential (Credential (..)) import Data.Aeson (eitherDecode, encode) diff --git a/hydra-node/test/Hydra/Ledger/SimpleSpec.hs b/hydra-node/test/Hydra/Ledger/SimpleSpec.hs index e4d47672ab7..61e0983d5aa 100644 --- a/hydra-node/test/Hydra/Ledger/SimpleSpec.hs +++ b/hydra-node/test/Hydra/Ledger/SimpleSpec.hs @@ -1,7 +1,6 @@ module Hydra.Ledger.SimpleSpec where import Hydra.Prelude -import Test.Hydra.Prelude import Data.Foldable (maximum) import Data.Set qualified as Set @@ -9,6 +8,8 @@ import Hydra.Chain.ChainState (ChainSlot (ChainSlot)) import Hydra.Ledger (applyTransactions) import Hydra.Ledger.Simple import Hydra.Tx.IsTx (IsTx (..)) +import Test.Hspec (Spec) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, choose, forAllShrink, getSize, shrinkList, sublistOf) spec :: Spec diff --git a/hydra-node/test/Hydra/Logging/MonitoringSpec.hs b/hydra-node/test/Hydra/Logging/MonitoringSpec.hs index 7ed632acb1b..1fff47f075f 100644 --- a/hydra-node/test/Hydra/Logging/MonitoringSpec.hs +++ b/hydra-node/test/Hydra/Logging/MonitoringSpec.hs @@ -17,6 +17,7 @@ import Hydra.Node (HydraNodeLog (..)) -- import Network.Socket (PortNumber(PortNumber)) import Network.HTTP.Req (GET (..), NoReqBody (..), bsResponse, defaultHttpConfig, http, port, req, responseBody, runReq, (/:)) +import Test.Hspec (Spec, it, shouldContain) import Test.Hydra.Tx.Fixture (alice, testHeadId) import Test.Network.Ports (randomUnusedTCPPorts) diff --git a/hydra-node/test/Hydra/LoggingSpec.hs b/hydra-node/test/Hydra/LoggingSpec.hs index 4106e178e29..85f245a7054 100644 --- a/hydra-node/test/Hydra/LoggingSpec.hs +++ b/hydra-node/test/Hydra/LoggingSpec.hs @@ -1,11 +1,11 @@ module Hydra.LoggingSpec where import Hydra.Prelude -import Test.Hydra.Prelude import Data.Aeson (object, (.=)) import Hydra.Logging (Verbosity (Verbose), traceWith, withTracer) import System.IO.Silently (capture_) +import Test.Hspec (Spec, it, shouldContain) spec :: Spec spec = do diff --git a/hydra-node/test/Hydra/Model.hs b/hydra-node/test/Hydra/Model.hs index 1858378913e..4d6cf7e4622 100644 --- a/hydra-node/test/Hydra/Model.hs +++ b/hydra-node/test/Hydra/Model.hs @@ -20,6 +20,7 @@ module Hydra.Model where import Hydra.Cardano.Api hiding (utxoFromTx) import Hydra.Prelude hiding (Any, label, lookup, toList) +import Cardano.Api.Shelley (SigningKey, VerificationKey, fromShelleyPaymentCredential, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Binary (serialize', unsafeDeserialize') import Control.Concurrent.Class.MonadSTM ( @@ -47,7 +48,6 @@ import Hydra.BehaviorSpec ( shortLabel, waitUntilMatch, ) -import Hydra.Cardano.Api.Prelude (fromShelleyPaymentCredential) import Hydra.Chain (maximumNumberOfParties) import Hydra.Chain.Direct.State (initialChainState) import Hydra.HeadLogic (Committed ()) diff --git a/hydra-node/test/Hydra/Model/MockChain.hs b/hydra-node/test/Hydra/Model/MockChain.hs index b54d3ce8e5a..e0793837e1a 100644 --- a/hydra-node/test/Hydra/Model/MockChain.hs +++ b/hydra-node/test/Hydra/Model/MockChain.hs @@ -6,6 +6,7 @@ module Hydra.Model.MockChain where import Hydra.Cardano.Api hiding (Network) import Hydra.Prelude hiding (Any, label) +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import Control.Concurrent.Class.MonadSTM ( MonadSTM (writeTVar), diff --git a/hydra-node/test/Hydra/Model/MockChainSpec.hs b/hydra-node/test/Hydra/Model/MockChainSpec.hs index 8c1f7dab8cf..d9be6c743a0 100644 --- a/hydra-node/test/Hydra/Model/MockChainSpec.hs +++ b/hydra-node/test/Hydra/Model/MockChainSpec.hs @@ -10,7 +10,8 @@ import Hydra.Ledger.Cardano (genSequenceOfSimplePaymentTransactions) import Hydra.Model.MockChain (scriptLedger) import Hydra.Prelude import Hydra.Tx.IsTx (IsTx (txId)) -import Test.Hydra.Prelude +import Test.Hspec (Spec) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, Testable (property), counterexample, forAllBlind, (===)) spec :: Spec diff --git a/hydra-node/test/Hydra/Model/Payment.hs b/hydra-node/test/Hydra/Model/Payment.hs index 8e782d5ea94..19de3d4e5a5 100644 --- a/hydra-node/test/Hydra/Model/Payment.hs +++ b/hydra-node/test/Hydra/Model/Payment.hs @@ -8,6 +8,7 @@ module Hydra.Model.Payment where import Hydra.Cardano.Api import Hydra.Prelude hiding (Any, label, toList) +import Cardano.Api.Shelley (SigningKey, getVerificationKey, verificationKeyHash) import Data.List qualified as List import Data.Set ((\\)) import Data.Set qualified as Set diff --git a/hydra-node/test/Hydra/ModelSpec.hs b/hydra-node/test/Hydra/ModelSpec.hs index 45af405e136..e3af65ad1b0 100644 --- a/hydra-node/test/Hydra/ModelSpec.hs +++ b/hydra-node/test/Hydra/ModelSpec.hs @@ -78,7 +78,6 @@ module Hydra.ModelSpec where import Hydra.Cardano.Api import Hydra.Prelude -import Test.Hydra.Prelude hiding (after) import Cardano.Api.UTxO qualified as UTxO import Control.Monad.Class.MonadTimer () @@ -111,7 +110,9 @@ import Hydra.Model.Payment qualified as Payment import Hydra.Tx.Party (Party (..), deriveParty) import System.IO.Temp (writeSystemTempFile) import System.IO.Unsafe (unsafePerformIO) -import Test.HUnit.Lang (formatFailureReason) +import Test.HUnit.Lang (HUnitFailure (..), formatFailureReason) +import Test.Hspec (Spec, context) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, Testable, counterexample, forAllShrink, property, withMaxSuccess, within) import Test.QuickCheck.DynamicLogic ( DL, diff --git a/hydra-node/test/Hydra/Network/AuthenticateSpec.hs b/hydra-node/test/Hydra/Network/AuthenticateSpec.hs index e5a55f1e642..4e20a5941b1 100644 --- a/hydra-node/test/Hydra/Network/AuthenticateSpec.hs +++ b/hydra-node/test/Hydra/Network/AuthenticateSpec.hs @@ -13,7 +13,8 @@ import Hydra.NetworkSpec (prop_canRoundtripCBOREncoding) import Hydra.Prelude import Hydra.Tx.Crypto (sign) import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs) -import Test.Hydra.Prelude +import Test.Hspec (Spec, describe, it, parallel, runIO, shouldBe, shouldContain) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture (alice, aliceSk, bob, bobSk, carol, carolSk) import Test.QuickCheck (listOf) import Test.QuickCheck.Gen (generate) diff --git a/hydra-node/test/Hydra/NetworkSpec.hs b/hydra-node/test/Hydra/NetworkSpec.hs index a2beda152ce..5f033289913 100644 --- a/hydra-node/test/Hydra/NetworkSpec.hs +++ b/hydra-node/test/Hydra/NetworkSpec.hs @@ -4,6 +4,8 @@ module Hydra.NetworkSpec where import Hydra.Prelude +import Test.Hspec (Spec, around, describe, it, shouldReturn, shouldSatisfy, xit) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Prelude import Codec.CBOR.Read (deserialiseFromBytes) diff --git a/hydra-node/test/Hydra/NetworkVersionsSpec.hs b/hydra-node/test/Hydra/NetworkVersionsSpec.hs index cc24337f7a8..774bb50c172 100644 --- a/hydra-node/test/Hydra/NetworkVersionsSpec.hs +++ b/hydra-node/test/Hydra/NetworkVersionsSpec.hs @@ -5,6 +5,8 @@ import Test.Hydra.Prelude import Data.Version (Version, makeVersion) import Hydra.NetworkVersions (hydraNodeVersion, parseNetworkTxIds) +import Test.Hspec (Spec, describe, it, shouldSatisfy) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, counterexample, forAll, property) spec :: Spec diff --git a/hydra-node/test/Hydra/Node/RunSpec.hs b/hydra-node/test/Hydra/Node/RunSpec.hs index 861c65ed10e..d64b836401f 100644 --- a/hydra-node/test/Hydra/Node/RunSpec.hs +++ b/hydra-node/test/Hydra/Node/RunSpec.hs @@ -1,7 +1,7 @@ module Hydra.Node.RunSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Selector, Spec, it, shouldThrow) import Hydra.Node.Run (ConfigurationException, run) import Hydra.Options ( diff --git a/hydra-node/test/Hydra/NodeSpec.hs b/hydra-node/test/Hydra/NodeSpec.hs index 954972d430c..e93345f00d5 100644 --- a/hydra-node/test/Hydra/NodeSpec.hs +++ b/hydra-node/test/Hydra/NodeSpec.hs @@ -5,12 +5,12 @@ module Hydra.NodeSpec where import Hydra.Prelude hiding (label) import Test.Hydra.Prelude +import Cardano.Api.Shelley (SigningKey) import Conduit (MonadUnliftIO, yieldMany) import Control.Concurrent.Class.MonadSTM (modifyTVar, readTVarIO, writeTVar) import Hydra.API.ClientInput (ClientInput (..)) import Hydra.API.Server (Server (..), mkTimedServerOutputFromStateEvent) import Hydra.API.ServerOutput (ClientMessage (..), ServerOutput (..), TimedServerOutput (..)) -import Hydra.Cardano.Api (SigningKey) import Hydra.Chain (Chain (..), ChainEvent (..), OnChainTx (..), PostTxError (..)) import Hydra.Chain.ChainState (ChainSlot (ChainSlot), IsChainState) import Hydra.Events (EventSink (..), EventSource (..), getEventId) @@ -42,6 +42,7 @@ import Hydra.Tx.ContestationPeriod (ContestationPeriod (..)) import Hydra.Tx.Crypto (HydraKey, sign) import Hydra.Tx.HeadParameters (HeadParameters (..)) import Hydra.Tx.Party (Party, deriveParty) +import Test.Hspec (Spec, around, describe, it, parallel, shouldBe, shouldContain, shouldNotBe, shouldReturn, shouldSatisfy, shouldThrow) import Test.Hydra.Node.Fixture (testEnvironment) import Test.Hydra.Tx.Fixture ( alice, diff --git a/hydra-node/test/Hydra/OptionsSpec.hs b/hydra-node/test/Hydra/OptionsSpec.hs index 45022d3f40a..df3099d4446 100644 --- a/hydra-node/test/Hydra/OptionsSpec.hs +++ b/hydra-node/test/Hydra/OptionsSpec.hs @@ -43,6 +43,8 @@ import Hydra.Options ( validateRunOptions, ) import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs) +import Test.Hspec (Expectation, Spec, describe, it, parallel, pendingWith, shouldBe, shouldSatisfy) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Positive (..), Property, chooseEnum, counterexample, forAll, property, vectorOf, (===)) import Text.Regex.TDFA ((=~)) diff --git a/hydra-node/test/Hydra/PartySpec.hs b/hydra-node/test/Hydra/PartySpec.hs index 342d29affa4..e5f1896c575 100644 --- a/hydra-node/test/Hydra/PartySpec.hs +++ b/hydra-node/test/Hydra/PartySpec.hs @@ -1,10 +1,11 @@ module Hydra.PartySpec where import Hydra.Prelude -import Test.Hydra.Prelude import Hydra.Tx.Party (Party (..)) import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs) +import Test.Hspec (Spec, describe, it, shouldBe) +import Test.Hspec.QuickCheck (prop) import Test.Hydra.Tx.Fixture (alice, bob, carol) import Test.QuickCheck ((==>)) diff --git a/hydra-node/test/Hydra/PersistenceSpec.hs b/hydra-node/test/Hydra/PersistenceSpec.hs index 1012c910de5..a0810c2a624 100644 --- a/hydra-node/test/Hydra/PersistenceSpec.hs +++ b/hydra-node/test/Hydra/PersistenceSpec.hs @@ -11,6 +11,7 @@ import Data.Text qualified as Text import Hydra.Logging (Envelope (..), Verbosity (Verbose), withTracer) import Hydra.Persistence (Persistence (..), PersistenceIncremental (..), createPersistence, createPersistenceIncremental, loadAll) import Hydra.PersistenceLog +import Test.Hspec (Spec, describe, it, shouldReturn, shouldSatisfy) import Test.QuickCheck (checkCoverage, cover, elements, oneof, suchThat, (===)) import Test.QuickCheck.Gen (listOf) import Test.QuickCheck.Monadic (monadicIO, monitor, pick, run) diff --git a/hydra-node/test/Hydra/PersistentQueueSpec.hs b/hydra-node/test/Hydra/PersistentQueueSpec.hs index 739fee44110..d566b210697 100644 --- a/hydra-node/test/Hydra/PersistentQueueSpec.hs +++ b/hydra-node/test/Hydra/PersistentQueueSpec.hs @@ -5,6 +5,8 @@ import Hydra.Prelude import Test.Hydra.Prelude import Hydra.Network.Etcd (newPersistentQueue, peekPersistentQueue, writePersistentQueue) +import Test.Hspec (Spec, it, shouldReturn) +import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (counterexample, generate, ioProperty) spec :: Spec diff --git a/hydra-node/test/Hydra/UtilsSpec.hs b/hydra-node/test/Hydra/UtilsSpec.hs index b654cd37090..862a5325651 100644 --- a/hydra-node/test/Hydra/UtilsSpec.hs +++ b/hydra-node/test/Hydra/UtilsSpec.hs @@ -5,6 +5,7 @@ import Hydra.Options (GenerateKeyPair (GenerateKeyPair)) import Hydra.Prelude import Hydra.Utils (genHydraKeys) import System.FilePath (()) +import Test.Hspec (Spec, expectationFailure, it) import Test.Hydra.Prelude spec :: Spec diff --git a/hydra-node/test/Test/Util.hs b/hydra-node/test/Test/Util.hs index fb49c067b02..a52b9117269 100644 --- a/hydra-node/test/Test/Util.hs +++ b/hydra-node/test/Test/Util.hs @@ -3,7 +3,9 @@ module Test.Util where import Hydra.Prelude -import Test.Hydra.Prelude hiding (shouldBe) +import Test.Hspec (Spec) +import Test.Hspec.QuickCheck (prop) +import Test.Hydra.Prelude import Control.Concurrent.Class.MonadSTM (modifyTVar', readTVarIO) import Control.Monad.Class.MonadSay (say) diff --git a/hydra-plutus/exe/inspect-script/Main.hs b/hydra-plutus/exe/inspect-script/Main.hs index 19891c76d10..6bc62eb57c2 100644 --- a/hydra-plutus/exe/inspect-script/Main.hs +++ b/hydra-plutus/exe/inspect-script/Main.hs @@ -3,6 +3,7 @@ module Main where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (fromPlutusData) import Data.Aeson qualified as Aeson import Data.ByteString.Lazy qualified as BL import Data.Text (pack) diff --git a/hydra-plutus/hydra-plutus.cabal b/hydra-plutus/hydra-plutus.cabal index eac7994cf68..2f7939a64d9 100644 --- a/hydra-plutus/hydra-plutus.cabal +++ b/hydra-plutus/hydra-plutus.cabal @@ -121,6 +121,7 @@ executable inspect-script build-depends: , aeson , bytestring + , cardano-api , hydra-cardano-api , hydra-plutus , hydra-prelude diff --git a/hydra-plutus/test/Hydra/Plutus/GoldenSpec.hs b/hydra-plutus/test/Hydra/Plutus/GoldenSpec.hs index 43a76ed228e..e44bcf21a85 100644 --- a/hydra-plutus/test/Hydra/Plutus/GoldenSpec.hs +++ b/hydra-plutus/test/Hydra/Plutus/GoldenSpec.hs @@ -11,7 +11,7 @@ module Hydra.Plutus.GoldenSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, it, shouldBe) import Hydra.Cardano.Api ( File (..), diff --git a/hydra-test-utils/src/Test/Hydra/Prelude.hs b/hydra-test-utils/src/Test/Hydra/Prelude.hs index 9f0dacfeb69..143a362bb7e 100644 --- a/hydra-test-utils/src/Test/Hydra/Prelude.hs +++ b/hydra-test-utils/src/Test/Hydra/Prelude.hs @@ -7,8 +7,6 @@ module Test.Hydra.Prelude ( ReasonablySized (..), genericCoverTable, pickBlind, - module Test.Hspec, - module Test.Hspec.QuickCheck, createTempDir, withTempDir, withLogFile, @@ -20,7 +18,6 @@ module Test.Hydra.Prelude ( import Hydra.Prelude import Test.Hspec -import Test.Hspec.QuickCheck import Data.List (isInfixOf) import Data.Ratio ((%)) diff --git a/hydra-tui/hydra-tui.cabal b/hydra-tui/hydra-tui.cabal index c482495ead8..48838776388 100644 --- a/hydra-tui/hydra-tui.cabal +++ b/hydra-tui/hydra-tui.cabal @@ -58,6 +58,7 @@ library , async , base , brick >=1.10 + , cardano-api , containers , hydra-cardano-api , hydra-node @@ -99,6 +100,7 @@ test-suite tests build-depends: , blaze-builder , bytestring + , cardano-api , filepath , hspec , hydra-cardano-api diff --git a/hydra-tui/src/Hydra/Client.hs b/hydra-tui/src/Hydra/Client.hs index a75535b1d91..4ccda91b345 100644 --- a/hydra-tui/src/Hydra/Client.hs +++ b/hydra-tui/src/Hydra/Client.hs @@ -4,6 +4,7 @@ module Hydra.Client where import Hydra.Prelude +import Cardano.Api (PaymentKey, SigningKey) import Cardano.Api.UTxO qualified as UTxO import Control.Concurrent.Async (link) import Control.Concurrent.Class.MonadSTM (readTBQueue, writeTBQueue) @@ -13,10 +14,6 @@ import Hydra.API.ClientInput (ClientInput) import Hydra.API.HTTPServer (DraftCommitTxRequest (..), DraftCommitTxResponse (..)) import Hydra.API.ServerOutput (ClientMessage, Greetings, InvalidInput, TimedServerOutput) import Hydra.Cardano.Api (TxId) -import Hydra.Cardano.Api.Prelude ( - PaymentKey, - SigningKey, - ) import Hydra.Cardano.Api.Tx (signTx) import Hydra.Chain.CardanoClient (submitTransaction) import Hydra.Chain.ChainState (IsChainState) diff --git a/hydra-tui/src/Hydra/TUI/Drawing.hs b/hydra-tui/src/Hydra/TUI/Drawing.hs index eb55ef9fe1b..6a2ceb97b4f 100644 --- a/hydra-tui/src/Hydra/TUI/Drawing.hs +++ b/hydra-tui/src/Hydra/TUI/Drawing.hs @@ -8,6 +8,7 @@ module Hydra.TUI.Drawing where import Hydra.Prelude hiding (Down, State) import Brick +import Cardano.Api.Shelley (VerificationKey, getVerificationKey) import Hydra.Cardano.Api hiding (Active) import Brick.Forms ( diff --git a/hydra-tui/src/Hydra/TUI/Handlers.hs b/hydra-tui/src/Hydra/TUI/Handlers.hs index c3d63cdc8aa..27bba958fe5 100644 --- a/hydra-tui/src/Hydra/TUI/Handlers.hs +++ b/hydra-tui/src/Hydra/TUI/Handlers.hs @@ -9,6 +9,7 @@ import Hydra.Prelude hiding (Down) import Brick import Brick.Forms (Form (formState), editField, editShowableFieldWithValidate, handleFormEvent, newForm) +import Cardano.Api.Shelley (VerificationKey, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.List (nub, (\\)) import Data.Map qualified as Map diff --git a/hydra-tui/test/Hydra/TUI/OptionsSpec.hs b/hydra-tui/test/Hydra/TUI/OptionsSpec.hs index bf9731c8ee2..a2bbdba89f7 100644 --- a/hydra-tui/test/Hydra/TUI/OptionsSpec.hs +++ b/hydra-tui/test/Hydra/TUI/OptionsSpec.hs @@ -17,6 +17,7 @@ import Options.Applicative ( info, renderFailure, ) +import Test.Hspec (Expectation, Spec, it, parallel, shouldBe, shouldSatisfy) import Text.Regex.TDFA ((=~)) spec :: Spec diff --git a/hydra-tui/test/Hydra/TUISpec.hs b/hydra-tui/test/Hydra/TUISpec.hs index 8c393ce4197..3709358bc87 100644 --- a/hydra-tui/test/Hydra/TUISpec.hs +++ b/hydra-tui/test/Hydra/TUISpec.hs @@ -7,6 +7,7 @@ import Hydra.Prelude import Test.Hydra.Prelude import Blaze.ByteString.Builder.Char8 (writeChar) +import Cardano.Api.Shelley (getVerificationKey) import CardanoNode (NodeLog, withCardanoNodeDevnet) import Control.Concurrent.Class.MonadMVar (MonadMVar (..)) import Control.Concurrent.Class.MonadSTM (readTQueue, tryReadTQueue, writeTQueue) @@ -29,7 +30,7 @@ import Graphics.Vty.Image (DisplayRegion) import Graphics.Vty.Platform.Unix.Input (buildInput) import Graphics.Vty.Platform.Unix.Output (buildOutput) import Graphics.Vty.Platform.Unix.Settings (defaultSettings) -import Hydra.Cardano.Api (Coin, Key (getVerificationKey)) +import Hydra.Cardano.Api (Coin) import Hydra.Chain.Direct (DirectBackend (..)) import Hydra.Cluster.Faucet ( FaucetLog, @@ -57,6 +58,7 @@ import HydraNode ( ) import System.FilePath (()) import System.Posix (OpenMode (WriteOnly), closeFd, defaultFileFlags, openFd) +import Test.Hspec (Expectation, Spec, around, context, it, pendingWith, shouldBe) import Test.QuickCheck (Positive (..)) tuiContestationPeriod :: ContestationPeriod diff --git a/hydra-tx/exe/Main.hs b/hydra-tx/exe/Main.hs index cc06b5575ec..dfaa629bb93 100644 --- a/hydra-tx/exe/Main.hs +++ b/hydra-tx/exe/Main.hs @@ -2,10 +2,11 @@ module Main where import Hydra.Prelude +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Api.UTxO (UTxO) import Cardano.Api.UTxO qualified as UTxO import Data.Aeson (eitherDecodeFileStrict) -import Hydra.Cardano.Api (TxIx (..), textEnvelopeToJSON, toShelleyNetwork, pattern TxIn) +import Hydra.Cardano.Api (TxIx (..), textEnvelopeToJSON, pattern TxIn) import Hydra.Tx.BlueprintTx (mkSimpleBlueprintTx) import Hydra.Tx.Deposit (depositTx, observeDepositTxOut) import Hydra.Tx.Recover (recoverTx) diff --git a/hydra-tx/hydra-tx.cabal b/hydra-tx/hydra-tx.cabal index ca07ddfb5ce..3298d05089f 100644 --- a/hydra-tx/hydra-tx.cabal +++ b/hydra-tx/hydra-tx.cabal @@ -77,6 +77,7 @@ library , base , base16-bytestring , bytestring + , cardano-api , cardano-crypto-class , cardano-ledger-alonzo , cardano-ledger-api @@ -122,6 +123,7 @@ library testlib build-depends: , base , bytestring + , cardano-api , cardano-crypto-class , cardano-ledger-alonzo , cardano-ledger-api @@ -182,6 +184,7 @@ test-suite tests , aeson , base , base16-bytestring + , cardano-api , cardano-binary , cardano-crypto-class , cardano-ledger-alonzo @@ -219,6 +222,7 @@ executable hydra-tx , attoparsec , base , bytestring + , cardano-api , hydra-cardano-api , hydra-prelude , hydra-tx diff --git a/hydra-tx/src/Hydra/Ledger/Cardano/Evaluate.hs b/hydra-tx/src/Hydra/Ledger/Cardano/Evaluate.hs index 2fb670a5e28..6e979c07cfe 100644 --- a/hydra-tx/src/Hydra/Ledger/Cardano/Evaluate.hs +++ b/hydra-tx/src/Hydra/Ledger/Cardano/Evaluate.hs @@ -16,6 +16,7 @@ module Hydra.Ledger.Cardano.Evaluate where import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (LedgerProtocolParameters (..)) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Scripts (CostModel, Prices (..), mkCostModel, mkCostModels, txscriptfee) import Cardano.Ledger.Api (CoinPerByte (..), ppCoinsPerUTxOByteL, ppCostModelsL, ppMaxBlockExUnitsL, ppMaxTxExUnitsL, ppMaxValSizeL, ppMinFeeAL, ppMinFeeBL, ppPricesL, ppProtocolVersionL) @@ -43,7 +44,6 @@ import Hydra.Cardano.Api ( IsCardanoEra (cardanoEra), LedgerEpochInfo (..), LedgerEra, - LedgerProtocolParameters (..), ProtocolParametersConversionError, ScriptExecutionError, ScriptWitnessIndex, diff --git a/hydra-tx/src/Hydra/Tx/Abort.hs b/hydra-tx/src/Hydra/Tx/Abort.hs index 173821bf2dc..f58298a397d 100644 --- a/hydra-tx/src/Hydra/Tx/Abort.hs +++ b/hydra-tx/src/Hydra/Tx/Abort.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Abort where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.Map qualified as Map import Hydra.Contract.Commit qualified as Commit diff --git a/hydra-tx/src/Hydra/Tx/Close.hs b/hydra-tx/src/Hydra/Tx/Close.hs index e299fd7f8e1..1dba2ffdc86 100644 --- a/hydra-tx/src/Hydra/Tx/Close.hs +++ b/hydra-tx/src/Hydra/Tx/Close.hs @@ -5,6 +5,7 @@ module Hydra.Tx.Close where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Hydra.Contract.Head qualified as Head import Hydra.Contract.HeadState qualified as Head import Hydra.Data.ContestationPeriod (addContestationPeriod) diff --git a/hydra-tx/src/Hydra/Tx/CollectCom.hs b/hydra-tx/src/Hydra/Tx/CollectCom.hs index fa5ba400ff4..d8ea0376bc0 100644 --- a/hydra-tx/src/Hydra/Tx/CollectCom.hs +++ b/hydra-tx/src/Hydra/Tx/CollectCom.hs @@ -8,6 +8,7 @@ import Data.Map qualified as Map import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Data.ByteString qualified as BS import Hydra.Contract.Commit qualified as Commit import Hydra.Contract.Head qualified as Head diff --git a/hydra-tx/src/Hydra/Tx/Commit.hs b/hydra-tx/src/Hydra/Tx/Commit.hs index c1f74cd837b..2cb3e348ff5 100644 --- a/hydra-tx/src/Hydra/Tx/Commit.hs +++ b/hydra-tx/src/Hydra/Tx/Commit.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Commit where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Core (AlonzoEraTxBody, AlonzoEraTxWits, AsIxItem (..)) import Cardano.Ledger.Alonzo.Scripts (PlutusPurpose) diff --git a/hydra-tx/src/Hydra/Tx/Contest.hs b/hydra-tx/src/Hydra/Tx/Contest.hs index 5332703f457..8a75a7f6d1a 100644 --- a/hydra-tx/src/Hydra/Tx/Contest.hs +++ b/hydra-tx/src/Hydra/Tx/Contest.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Contest where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Hydra.Contract.Head qualified as Head import Hydra.Contract.HeadState qualified as Head import Hydra.Data.ContestationPeriod (addContestationPeriod) diff --git a/hydra-tx/src/Hydra/Tx/Crypto.hs b/hydra-tx/src/Hydra/Tx/Crypto.hs index 22bbf27731c..9755639e572 100644 --- a/hydra-tx/src/Hydra/Tx/Crypto.hs +++ b/hydra-tx/src/Hydra/Tx/Crypto.hs @@ -24,6 +24,7 @@ module Hydra.Tx.Crypto ( import Hydra.Prelude hiding (Key, show) +import Cardano.Api.Shelley (Key (..)) import Cardano.Crypto.DSIGN ( ContextDSIGN, Ed25519DSIGN, @@ -58,7 +59,6 @@ import Hydra.Cardano.Api ( HasTextEnvelope (..), HasTypeProxy (..), Hash, - Key (..), SerialiseAsCBOR, SerialiseAsRawBytes (..), SerialiseAsRawBytesError (..), diff --git a/hydra-tx/src/Hydra/Tx/Decrement.hs b/hydra-tx/src/Hydra/Tx/Decrement.hs index 6b6083c823c..8f41ad22648 100644 --- a/hydra-tx/src/Hydra/Tx/Decrement.hs +++ b/hydra-tx/src/Hydra/Tx/Decrement.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Decrement where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Hydra.Contract.Head qualified as Head import Hydra.Contract.HeadState qualified as Head diff --git a/hydra-tx/src/Hydra/Tx/Deposit.hs b/hydra-tx/src/Hydra/Tx/Deposit.hs index c027b596d98..b9e721f0980 100644 --- a/hydra-tx/src/Hydra/Tx/Deposit.hs +++ b/hydra-tx/src/Hydra/Tx/Deposit.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Deposit where import Hydra.Cardano.Api import Hydra.Prelude hiding (toList) +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api (AllegraEraTxBody (vldtTxBodyL), ValidityInterval (..), bodyTxL, inputsTxBodyL, outputsTxBodyL) import Control.Lens ((.~), (^.)) diff --git a/hydra-tx/src/Hydra/Tx/Increment.hs b/hydra-tx/src/Hydra/Tx/Increment.hs index 555f5710c3a..0a507d6afa4 100644 --- a/hydra-tx/src/Hydra/Tx/Increment.hs +++ b/hydra-tx/src/Hydra/Tx/Increment.hs @@ -3,6 +3,7 @@ module Hydra.Tx.Increment where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.List qualified as List import Hydra.Contract.Deposit qualified as Deposit diff --git a/hydra-tx/src/Hydra/Tx/IsTx.hs b/hydra-tx/src/Hydra/Tx/IsTx.hs index d85c6f775de..12bbe0400fe 100644 --- a/hydra-tx/src/Hydra/Tx/IsTx.hs +++ b/hydra-tx/src/Hydra/Tx/IsTx.hs @@ -9,6 +9,7 @@ module Hydra.Tx.IsTx where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api qualified as Api import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Binary (decCBOR, decodeFullAnnotator) import Cardano.Ledger.Shelley.UTxO qualified as Ledger @@ -20,8 +21,7 @@ import Data.Aeson.KeyMap qualified as KeyMap import Data.Aeson.Types (withObject) import Data.Text.Lazy.Builder (toLazyText) import Formatting.Buildable (build) -import Hydra.Cardano.Api.Tx qualified as Api -import Hydra.Cardano.Api.UTxO qualified as Api +import Hydra.Cardano.Api qualified as Hydra import Hydra.Contract.Util qualified as Util import PlutusLedgerApi.V3 (fromBuiltin) @@ -167,9 +167,9 @@ instance IsTx Tx where -- NOTE: See note from `Util.hashTxOuts`. hashUTxO = fromBuiltin . Util.hashTxOuts . mapMaybe toPlutusTxOut . UTxO.txOutputs - txSpendingUTxO = Api.txSpendingUTxO + txSpendingUTxO = Hydra.txSpendingUTxO - utxoFromTx = Api.utxoFromTx + utxoFromTx = Hydra.utxoFromTx outputsOfUTxO = UTxO.txOutputs diff --git a/hydra-tx/src/Hydra/Tx/Party.hs b/hydra-tx/src/Hydra/Tx/Party.hs index c0f821532fc..468cb1851ba 100644 --- a/hydra-tx/src/Hydra/Tx/Party.hs +++ b/hydra-tx/src/Hydra/Tx/Party.hs @@ -5,9 +5,7 @@ module Hydra.Tx.Party where import Hydra.Prelude -import Data.Aeson (FromJSONKeyFunction (FromJSONKeyTextParser), ToJSONKey (..)) -import Data.Aeson.Types (FromJSONKey (..), toJSONKeyText) -import Hydra.Cardano.Api ( +import Cardano.Api ( AsType (AsVerificationKey), SerialiseAsRawBytes (..), SigningKey, @@ -17,6 +15,8 @@ import Hydra.Cardano.Api ( serialiseToRawBytesHexText, verificationKeyHash, ) +import Data.Aeson (FromJSONKeyFunction (FromJSONKeyTextParser), ToJSONKey (..)) +import Data.Aeson.Types (FromJSONKey (..), toJSONKeyText) import Hydra.Data.Party qualified as OnChain import Hydra.Tx.Crypto (AsType (AsHydraKey), HydraKey) diff --git a/hydra-tx/src/Hydra/Tx/Recover.hs b/hydra-tx/src/Hydra/Tx/Recover.hs index 2aa44925862..581c4582513 100644 --- a/hydra-tx/src/Hydra/Tx/Recover.hs +++ b/hydra-tx/src/Hydra/Tx/Recover.hs @@ -2,6 +2,7 @@ module Hydra.Tx.Recover where import Hydra.Prelude +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Api.UTxO qualified as UTxO import Hydra.Cardano.Api import Hydra.Contract.Commit qualified as Commit diff --git a/hydra-tx/src/Hydra/Tx/Snapshot.hs b/hydra-tx/src/Hydra/Tx/Snapshot.hs index f8d8444dca8..384e372b7d2 100644 --- a/hydra-tx/src/Hydra/Tx/Snapshot.hs +++ b/hydra-tx/src/Hydra/Tx/Snapshot.hs @@ -5,11 +5,12 @@ module Hydra.Tx.Snapshot where import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey) import Cardano.Crypto.Util (SignableRepresentation (..)) import Codec.Serialise (serialise) import Data.Aeson (object, withObject, (.:), (.:?), (.=)) import Data.ByteString.Lazy qualified as LBS -import Hydra.Cardano.Api (SerialiseAsRawBytes (..), SigningKey) +import Hydra.Cardano.Api (SerialiseAsRawBytes (..)) import Hydra.Contract.HeadState qualified as Onchain import Hydra.Tx.Crypto (HydraKey, MultiSignature, aggregate, sign) import Hydra.Tx.HeadId (HeadId) diff --git a/hydra-tx/src/Hydra/Tx/Utils.hs b/hydra-tx/src/Hydra/Tx/Utils.hs index e799dbb9798..9707a5f21e2 100644 --- a/hydra-tx/src/Hydra/Tx/Utils.hs +++ b/hydra-tx/src/Hydra/Tx/Utils.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Utils ( import Hydra.Cardano.Api import Hydra.Prelude hiding (toList) +import Cardano.Api.Shelley (VerificationKey, toShelleyMetadata, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Tx qualified as Ledger import Cardano.Ledger.Api (AlonzoTxAuxData (..), auxDataHashTxBodyL, auxDataTxL, bodyTxL, hashTxAuxData) diff --git a/hydra-tx/test/Hydra/Tx/Contract/Abort.hs b/hydra-tx/test/Hydra/Tx/Contract/Abort.hs index 5a42e3de575..20fc7b59f3f 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Abort.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Abort.hs @@ -7,6 +7,7 @@ module Hydra.Tx.Contract.Abort where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.List qualified as List import Data.Map qualified as Map diff --git a/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUnused.hs b/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUnused.hs index b7ab2e633d0..8cf809686e3 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUnused.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUnused.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Contract.Close.CloseUnused where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.Maybe (fromJust) import Hydra.Contract.Error (toErrorCode) diff --git a/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUsed.hs b/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUsed.hs index 77a3c31d278..6fd42279e3e 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUsed.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Close/CloseUsed.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Contract.Close.CloseUsed where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (verificationKeyHash) import Cardano.Api.UTxO as UTxO import Data.Maybe (fromJust) import Hydra.Contract.Error (toErrorCode) diff --git a/hydra-tx/test/Hydra/Tx/Contract/Close/Healthy.hs b/hydra-tx/test/Hydra/Tx/Contract/Close/Healthy.hs index 4444ce1a69e..e6435150a86 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Close/Healthy.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Close/Healthy.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Contract.Close.Healthy where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (SigningKey, VerificationKey) import Hydra.Data.ContestationPeriod qualified as OnChain import Hydra.Data.Party qualified as OnChain import Hydra.Ledger.Cardano.Evaluate (genValidityBoundsFromContestationPeriod) diff --git a/hydra-tx/test/Hydra/Tx/Contract/CollectCom.hs b/hydra-tx/test/Hydra/Tx/Contract/CollectCom.hs index 584bfd8a22e..b79f3067a2b 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/CollectCom.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/CollectCom.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Contract.CollectCom where import Hydra.Cardano.Api import Hydra.Prelude hiding (label, toList) +import Cardano.Api.Shelley (VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.List qualified as List import Data.Map qualified as Map diff --git a/hydra-tx/test/Hydra/Tx/Contract/Commit.hs b/hydra-tx/test/Hydra/Tx/Contract/Commit.hs index ac20c4b28fe..b0694f8b116 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Commit.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Commit.hs @@ -5,6 +5,7 @@ module Hydra.Tx.Contract.Commit where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Api (bodyTxL) import Cardano.Ledger.Api.Tx.Body (EraTxBody (outputsTxBodyL), setMinCoinTxOut) diff --git a/hydra-tx/test/Hydra/Tx/Contract/Contest/ContestCurrent.hs b/hydra-tx/test/Hydra/Tx/Contract/Contest/ContestCurrent.hs index 4516611656e..618eb626751 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Contest/ContestCurrent.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Contest/ContestCurrent.hs @@ -6,8 +6,8 @@ module Hydra.Tx.Contract.Contest.ContestCurrent where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (verificationKeyHash) import Data.Maybe (fromJust) - import Hydra.Contract.Error (toErrorCode) import Hydra.Contract.HeadError (HeadError (..)) import Hydra.Contract.HeadState qualified as Head diff --git a/hydra-tx/test/Hydra/Tx/Contract/Contest/Healthy.hs b/hydra-tx/test/Hydra/Tx/Contract/Contest/Healthy.hs index 7835dbd0425..40eab2b5631 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Contest/Healthy.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Contest/Healthy.hs @@ -5,6 +5,7 @@ module Hydra.Tx.Contract.Contest.Healthy where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (SigningKey, VerificationKey) import Cardano.Api.UTxO as UTxO import Hydra.Contract.HeadState qualified as Head import Hydra.Data.ContestationPeriod qualified as OnChain diff --git a/hydra-tx/test/Hydra/Tx/Contract/ContractSpec.hs b/hydra-tx/test/Hydra/Tx/Contract/ContractSpec.hs index 0dc09c70ab0..7f1d69e37b4 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/ContractSpec.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/ContractSpec.hs @@ -4,8 +4,11 @@ module Hydra.Tx.Contract.ContractSpec where import Hydra.Prelude hiding (label) +import Test.Hspec (Spec, describe, parallel) +import Test.Hspec.QuickCheck (modifyMaxSuccess, prop) import Test.Hydra.Prelude +import Cardano.Api.Shelley (toShelleyNetwork) import Cardano.Api.UTxO qualified as UTxO import Cardano.Crypto.Util (SignableRepresentation (getSignableRepresentation)) import Cardano.Ledger.Alonzo.Plutus.TxInfo (TxOutSource (TxOutFromOutput)) @@ -19,7 +22,6 @@ import Hydra.Cardano.Api ( serialiseToRawBytesHexText, toLedgerTxOut, toPlutusTxOut, - toShelleyNetwork, ) import Hydra.Cardano.Api.Pretty (renderTxWithUTxO) import Hydra.Contract.Commit qualified as Commit diff --git a/hydra-tx/test/Hydra/Tx/Contract/Decrement.hs b/hydra-tx/test/Hydra/Tx/Contract/Decrement.hs index 836d3e5b6cc..5c45fc9272e 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Decrement.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Decrement.hs @@ -13,6 +13,7 @@ import Test.Hydra.Tx.Mutation ( replaceSnapshotVersion, ) +import Cardano.Api.Shelley (SigningKey, VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.Maybe (fromJust) import Hydra.Contract.Error (ToErrorCode (..)) diff --git a/hydra-tx/test/Hydra/Tx/Contract/FanOut.hs b/hydra-tx/test/Hydra/Tx/Contract/FanOut.hs index 88366be23ad..1a2b60914f1 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/FanOut.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/FanOut.hs @@ -6,6 +6,7 @@ module Hydra.Tx.Contract.FanOut where import Hydra.Cardano.Api import Hydra.Prelude hiding (label, toList) +import Cardano.Api.Shelley (verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import GHC.IsList (IsList (..)) import Hydra.Contract.Error (toErrorCode) diff --git a/hydra-tx/test/Hydra/Tx/Contract/Increment.hs b/hydra-tx/test/Hydra/Tx/Contract/Increment.hs index 00ba11be234..3892ce2d0f7 100644 --- a/hydra-tx/test/Hydra/Tx/Contract/Increment.hs +++ b/hydra-tx/test/Hydra/Tx/Contract/Increment.hs @@ -5,6 +5,7 @@ module Hydra.Tx.Contract.Increment where import Hydra.Cardano.Api import Hydra.Prelude hiding (label) +import Cardano.Api.Shelley (SigningKey, VerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Data.Maybe (fromJust) import Hydra.Contract.Commit (Commit) diff --git a/hydra-tx/test/Hydra/Tx/DepositSpec.hs b/hydra-tx/test/Hydra/Tx/DepositSpec.hs index a20e175a555..3bccb818731 100644 --- a/hydra-tx/test/Hydra/Tx/DepositSpec.hs +++ b/hydra-tx/test/Hydra/Tx/DepositSpec.hs @@ -1,7 +1,8 @@ module Hydra.Tx.DepositSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, describe, it, parallel, shouldBe, shouldSatisfy) +import Test.Hspec.QuickCheck (prop) import Cardano.Api.UTxO qualified as UTxO import Data.Map.Strict qualified as Map diff --git a/hydra-tx/test/Hydra/Tx/HeadIdSpec.hs b/hydra-tx/test/Hydra/Tx/HeadIdSpec.hs index 6b978d813aa..865a6017fbc 100644 --- a/hydra-tx/test/Hydra/Tx/HeadIdSpec.hs +++ b/hydra-tx/test/Hydra/Tx/HeadIdSpec.hs @@ -1,7 +1,8 @@ module Hydra.Tx.HeadIdSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, describe, parallel) +import Test.Hspec.QuickCheck (prop) import Hydra.Contract.HeadTokens (headPolicyId) import Hydra.Tx.HeadId (currencySymbolToHeadId, headIdToCurrencySymbol, headIdToPolicyId, headSeedToTxIn, mkHeadId, txInToHeadSeed) diff --git a/hydra-tx/test/Hydra/Tx/IsTxSpec.hs b/hydra-tx/test/Hydra/Tx/IsTxSpec.hs index e9af25f475e..04a4887abff 100644 --- a/hydra-tx/test/Hydra/Tx/IsTxSpec.hs +++ b/hydra-tx/test/Hydra/Tx/IsTxSpec.hs @@ -1,7 +1,8 @@ module Hydra.Tx.IsTxSpec where import Hydra.Prelude -import Test.Hydra.Prelude +import Test.Hspec (Spec, describe, parallel) +import Test.Hspec.QuickCheck (prop) -- NOTE: Arbitrary UTxO and Tx instances import Test.Hydra.Tx.Gen () diff --git a/hydra-tx/testlib/Test/Hydra/Tx/Fixture.hs b/hydra-tx/testlib/Test/Hydra/Tx/Fixture.hs index 2b10e7330bb..965a6877933 100644 --- a/hydra-tx/testlib/Test/Hydra/Tx/Fixture.hs +++ b/hydra-tx/testlib/Test/Hydra/Tx/Fixture.hs @@ -11,6 +11,7 @@ module Test.Hydra.Tx.Fixture ( import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, verificationKeyHash) import Cardano.Ledger.Alonzo.Core (ppPricesL) import Cardano.Ledger.Alonzo.Scripts (Prices (..)) import Cardano.Ledger.BaseTypes (BoundedRational (..)) @@ -23,12 +24,10 @@ import Hydra.Cardano.Api ( NetworkId (Testnet), NetworkMagic (NetworkMagic), PolicyId, - SigningKey, TxIn, deserialiseFromRawBytes, genTxIn, serialiseToRawBytes, - verificationKeyHash, ) import Hydra.Contract.HeadTokens (headPolicyId) import Hydra.Ledger.Cardano.Evaluate (epochInfo, pparams, slotLength, systemStart) diff --git a/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs b/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs index b00936a0caf..7fa1319ac6a 100644 --- a/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs +++ b/hydra-tx/testlib/Test/Hydra/Tx/Gen.hs @@ -6,6 +6,7 @@ module Test.Hydra.Tx.Gen where import Hydra.Cardano.Api import Hydra.Prelude hiding (toList) +import Cardano.Api.Shelley (SigningKey, VerificationKey, getVerificationKey, verificationKeyHash) import Cardano.Api.UTxO qualified as UTxO import Cardano.Crypto.DSIGN qualified as CC import Cardano.Crypto.Hash (hashToBytes) diff --git a/hydra-tx/testlib/Test/Hydra/Tx/Mutation.hs b/hydra-tx/testlib/Test/Hydra/Tx/Mutation.hs index 7fdb25064a6..1de8e1d9b78 100644 --- a/hydra-tx/testlib/Test/Hydra/Tx/Mutation.hs +++ b/hydra-tx/testlib/Test/Hydra/Tx/Mutation.hs @@ -130,6 +130,7 @@ module Test.Hydra.Tx.Mutation where import Hydra.Cardano.Api +import Cardano.Api.Shelley (VerificationKey) import Cardano.Api.UTxO qualified as UTxO import Cardano.Ledger.Alonzo.Scripts qualified as Ledger import Cardano.Ledger.Alonzo.TxWits qualified as Ledger diff --git a/hydraw/hydraw.cabal b/hydraw/hydraw.cabal index 43f134071d8..3508e2bfefb 100644 --- a/hydraw/hydraw.cabal +++ b/hydraw/hydraw.cabal @@ -32,6 +32,7 @@ library build-depends: , aeson , base + , cardano-api , http-conduit , hydra-cardano-api , hydra-node diff --git a/hydraw/src/Hydra/Painter.hs b/hydraw/src/Hydra/Painter.hs index be740b89672..fe45fc18373 100644 --- a/hydraw/src/Hydra/Painter.hs +++ b/hydraw/src/Hydra/Painter.hs @@ -3,6 +3,7 @@ module Hydra.Painter where import Hydra.Cardano.Api import Hydra.Prelude +import Cardano.Api.Shelley (SigningKey, getVerificationKey) import Cardano.Api.UTxO qualified as UTxO import Control.Exception (IOException) import Data.Aeson qualified as Aeson