Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2025-06-22T20:18:27Z
, hackage.haskell.org 2025-06-27T07:48:39Z
, cardano-haskell-packages 2025-06-22T22:27:17Z

packages:
Expand Down
4 changes: 3 additions & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ library cardano-cli-test-lib
Test.Cardano.CLI.Aeson
Test.Cardano.CLI.Hash
Test.Cardano.CLI.Util
Test.Cardano.CLI.Workspace

build-depends:
aeson,
Expand All @@ -332,14 +333,15 @@ library cardano-cli-test-lib
exceptions,
filepath,
hedgehog,
hedgehog-extras >=0.7.1,
hedgehog-extras >=0.9,
http-types,
lifted-base,
mmorph,
monad-control,
network,
process,
resourcet,
temporary,
text,
utf8-string,
vector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import Control.Monad (void)
import Data.ByteString.Lazy qualified as LB

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (Property, property, success)
import Hedgehog qualified as H
import Hedgehog.Extras.Test.Base qualified as H
import Hedgehog.Internal.Property (failWith)

hprop_deserialise_legacy_signing_Key :: Property
Expand Down Expand Up @@ -107,7 +107,7 @@ hprop_generate_and_read_nonlegacy_signingkeys =

hprop_migrate_legacy_to_nonlegacy_signingkeys :: Property
hprop_migrate_legacy_to_nonlegacy_signingkeys =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
let legKeyFp = "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"
nonLegacyKeyFp <- noteTempFile tempDir "nonlegacy.skey"

Expand Down
6 changes: 3 additions & 3 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import Data.ByteString (ByteString)
import GHC.Stack

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (MonadTest, Property, (===))
import Hedgehog.Extras.Test.Base qualified as H
import Hedgehog.Internal.Property (failWith)

{- HLINT ignore "Use camelCase" -}

hprop_byronTx_legacy :: Property
hprop_byronTx_legacy =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"
expectedTx <- noteInputFile "test/cardano-cli-golden/files/input/byron/tx/legacy.tx"
createdTx <- noteTempFile tempDir "tx"
Expand All @@ -45,7 +45,7 @@ hprop_byronTx_legacy =

hprop_byronTx :: Property
hprop_byronTx =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
expectedTx <- noteInputFile "test/cardano-cli-golden/files/input/byron/tx/normal.tx"
createdTx <- noteTempFile tempDir "tx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Cardano.CLI.Byron.UpdateProposal
import RIO

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (Property, (===))
import Hedgehog.Extras.Test.Base qualified as H

{- HLINT ignore "Use camelCase" -}

hprop_byron_update_proposal :: Property
hprop_byron_update_proposal =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
expectedUpdateProposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
createdUpdateProposal <- noteTempFile tempDir "byron-update-proposal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Cardano.CLI.Byron.Vote
import RIO

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (Property, (===))
import Hedgehog.Extras.Test.Base qualified as H

{- HLINT ignore "Use camelCase" -}

hprop_byron_yes_vote :: Property
hprop_byron_yes_vote =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
expectedYesVote <- noteInputFile "test/cardano-cli-golden/files/input/byron/votes/vote-yes"
proposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
Expand Down Expand Up @@ -43,7 +43,7 @@ hprop_byron_yes_vote =

hprop_byron_no_vote :: Property
hprop_byron_no_vote =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
expectedNoVote <- noteInputFile "test/cardano-cli-golden/files/input/byron/votes/vote-no"
proposal <- noteInputFile "test/cardano-cli-golden/files/input/byron/update-proposal"
signingKey <- noteInputFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Test.Golden.Conway.Transaction.Assemble where
import Control.Monad (void)

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (Property)
import Hedgehog.Extras.Test qualified as H
Expand All @@ -15,7 +16,7 @@ import Hedgehog.Extras.Test qualified as H

hprop_golden_conway_transaction_assemble_witness_signing_key :: Property
hprop_golden_conway_transaction_assemble_witness_signing_key =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
witnessTx <- noteTempFile tempDir "single-signing-key-witness-tx"
txBodyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/txbody"
signingKeyWitnessFile <-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Data.List (isInfixOf)
import System.Exit (ExitCode (..))

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog
import Hedgehog qualified as H
Expand All @@ -18,7 +19,7 @@ import Hedgehog.Extras.Test qualified as H
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw treasury donation/"'@
hprop_golden_conway_build_raw_treasury_donation :: Property
hprop_golden_conway_build_raw_treasury_donation =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
let goldenFile = "test/cardano-cli-golden/files/golden/conway/build-raw-out.tx"

-- Key filepaths
Expand Down Expand Up @@ -53,7 +54,7 @@ hprop_golden_conway_build_raw_treasury_donation =
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw donation no current treasury value/"'@
hprop_golden_conway_build_raw_donation_no_current_treasury_value :: Property
hprop_golden_conway_build_raw_donation_no_current_treasury_value =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
-- Key filepaths
outFile <- noteTempFile tempDir "out.json"

Expand Down Expand Up @@ -86,7 +87,7 @@ hprop_golden_conway_build_raw_donation_no_current_treasury_value =
-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw donation no treasury donation/"'@
hprop_golden_conway_build_raw_donation_no_treasury_donation :: Property
hprop_golden_conway_build_raw_donation_no_treasury_donation =
watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce . moduleWorkspace2 "tmp" $ \tempDir -> do
-- Key filepaths
outFile <- noteTempFile tempDir "out.json"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Test.Golden.Conway.Transaction.CreateWitness where
import Control.Monad (void)

import Test.Cardano.CLI.Util
import Test.Cardano.CLI.Workspace

import Hedgehog (Property)
import Hedgehog.Extras.Test qualified as H
Expand All @@ -20,7 +21,7 @@ txOut =

hprop_golden_shelley_transaction_signing_key_witness :: Property
hprop_golden_shelley_transaction_signing_key_witness =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
txBodyOutFile <- noteTempFile tempDir "tx-body-out"

-- Create tx body file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import System.Directory
import System.FilePath

import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp)
import Test.Cardano.CLI.Workspace

import Hedgehog (Property)
import Hedgehog qualified as H
import Hedgehog.Extras (moduleWorkspace, propertyOnce)
import Hedgehog.Extras (propertyOnce)
import Hedgehog.Extras qualified as H

{- HLINT ignore "Use camelCase" -}
Expand All @@ -33,7 +34,7 @@ tree root = do

hprop_golden_create_staked :: Property
hprop_golden_create_staked =
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
let alonzo = "genesis.alonzo.spec.json"
conway = "genesis.conway.spec.json"
networkMagic = 42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import System.FilePath

import Test.Cardano.CLI.Aeson
import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp)
import Test.Cardano.CLI.Workspace

import Hedgehog (Property)
import Hedgehog qualified as H
import Hedgehog.Extras (moduleWorkspace, propertyOnce)
import Hedgehog.Extras (propertyOnce)
import Hedgehog.Extras qualified as H

{- HLINT ignore "Redundant bracket" -}
Expand Down Expand Up @@ -105,7 +106,7 @@ golden_create_testnet_data
-- ^ The path to the shelley template use, if any
-> Property
golden_create_testnet_data mShelleyTemplate =
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
let outputDir = tempDir </> "out"
templateArg :: [String] =
case mShelleyTemplate of
Expand Down Expand Up @@ -159,7 +160,7 @@ golden_create_testnet_data mShelleyTemplate =
-- @cabal test cardano-cli-golden --test-options '-p "/golden create testnet data deleg non deleg/"'@
hprop_golden_create_testnet_data_deleg_non_deleg :: Property
hprop_golden_create_testnet_data_deleg_non_deleg =
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
let outputDir = tempDir </> "out"
totalSupply :: Int = 2_000_000_000_000 -- 2*10^12
delegatedSupply :: Int = 500_000_000_000 -- 5*10^11, i.e. totalSupply / 4
Expand Down Expand Up @@ -205,7 +206,7 @@ hprop_golden_create_testnet_data_deleg_non_deleg =
-- is not specified. It was broken in the past (see https://github.com/IntersectMBO/cardano-node/issues/5953).
hprop_golden_create_testnet_data_shelley_genesis_output :: Property
hprop_golden_create_testnet_data_shelley_genesis_output =
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
watchdogProp . propertyOnce $ moduleWorkspace2 "tmp" $ \tempDir -> do
vanillaShelleyGenesis :: ShelleyGenesis <-
H.readJsonFileOk "test/cardano-cli-golden/files/input/shelley/genesis/genesis.spec.json"
let tweakedValue = 3_123_456_000_000
Expand Down
Loading
Loading