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
2 changes: 1 addition & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ library cardano-cli-test-lib
exceptions,
filepath,
hedgehog,
hedgehog-extras >=0.7.1,
hedgehog-extras >=0.9,
http-types,
lifted-base,
mmorph,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ import Hedgehog.Internal.Property (failWith)

hprop_deserialise_legacy_signing_Key :: Property
hprop_deserialise_legacy_signing_Key =
watchdogProp . propertyOnce $ do
propertyOnce $ do
legSkeyBs <- H.evalIO $ LB.readFile "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"
case deserialiseFromBytes decodeLegacyDelegateKey legSkeyBs of
Left deSerFail -> failWith Nothing $ show deSerFail
Right _ -> success

hprop_deserialise_nonLegacy_signing_Key :: Property
hprop_deserialise_nonLegacy_signing_Key =
watchdogProp . propertyOnce $ do
propertyOnce $ do
skeyBs <- H.evalIO $ LB.readFile "test/cardano-cli-golden/files/input/byron/keys/byron.skey"
case deserialiseFromBytes Crypto.fromCBORXPrv skeyBs of
Left deSerFail -> failWith Nothing $ show deSerFail
Right _ -> success

hprop_print_legacy_signing_key_address :: Property
hprop_print_legacy_signing_key_address =
watchdogProp . propertyOnce $ do
propertyOnce $ do
let legKeyFp = "test/cardano-cli-golden/files/input/byron/keys/legacy.skey"

void $
Expand All @@ -75,7 +75,7 @@ hprop_print_legacy_signing_key_address =

hprop_print_nonLegacy_signing_key_address :: Property
hprop_print_nonLegacy_signing_key_address =
watchdogProp . propertyOnce $ do
propertyOnce $ do
let nonLegKeyFp = "test/cardano-cli-golden/files/input/byron/keys/byron.skey"

void $
Expand All @@ -99,15 +99,15 @@ hprop_print_nonLegacy_signing_key_address =

hprop_generate_and_read_nonlegacy_signingkeys :: Property
hprop_generate_and_read_nonlegacy_signingkeys =
watchdogProp . property $ do
property $ do
byronSkey <- H.evalIO $ generateSigningKey AsByronKey
case deserialiseFromRawBytes (AsSigningKey AsByronKey) (serialiseToRawBytes byronSkey) of
Left _ -> failWith Nothing "Failed to deserialise non-legacy Byron signing key. "
Right _ -> success

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

Expand All @@ -130,7 +130,7 @@ hprop_migrate_legacy_to_nonlegacy_signingkeys =

hprop_deserialise_NonLegacy_Signing_Key_API :: Property
hprop_deserialise_NonLegacy_Signing_Key_API =
watchdogProp . propertyOnce $ do
propertyOnce $ do
eFailOrWit <-
H.evalIO . runExceptT $
readByronSigningKey
Expand All @@ -142,7 +142,7 @@ hprop_deserialise_NonLegacy_Signing_Key_API =

hprop_deserialiseLegacy_Signing_Key_API :: Property
hprop_deserialiseLegacy_Signing_Key_API =
watchdogProp . propertyOnce $ do
propertyOnce $ do
eFailOrWit <-
H.evalIO . runExceptT $
readByronSigningKey
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/test/cardano-cli-golden/Test/Golden/Byron/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Hedgehog.Internal.Property (failWith)

hprop_byronTx_legacy :: Property
hprop_byronTx_legacy =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ H.moduleWorkspace "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
propertyOnce $ H.moduleWorkspace "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
@@ -1,11 +1,11 @@
module Test.Golden.Byron.TxBody where

import Test.Cardano.CLI.Util (propertyOnce, watchdogProp)
import Test.Cardano.CLI.Util (propertyOnce)

import Hedgehog (Property, success)

{- HLINT ignore "Use camelCase" -}

hprop_golden_byronTxBody :: Property
hprop_golden_byronTxBody =
watchdogProp . propertyOnce $ success -- TODO
propertyOnce success -- TODO
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Hedgehog.Extras.Test.Base qualified as H

hprop_byron_update_proposal :: Property
hprop_byron_update_proposal =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ H.moduleWorkspace "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 @@ -18,7 +18,7 @@ import Hedgehog.Internal.Property (failWith)

hprop_byron_yes_vote :: Property
hprop_byron_yes_vote =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ H.moduleWorkspace "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 @@ -52,7 +52,7 @@ hprop_byron_yes_vote =

hprop_byron_no_vote :: Property
hprop_byron_no_vote =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ H.moduleWorkspace "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
@@ -1,11 +1,11 @@
module Test.Golden.Byron.Witness where

import Test.Cardano.CLI.Util (propertyOnce, watchdogProp)
import Test.Cardano.CLI.Util (propertyOnce)

import Hedgehog (Property, success)

{- HLINT ignore "Use camelCase" -}

golden_byronWitness :: Property
golden_byronWitness =
watchdogProp . propertyOnce $ success -- TODO
propertyOnce success -- TODO
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
propertyOnce $ H.moduleWorkspace "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 @@ -18,7 +18,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
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
let goldenFile = "test/cardano-cli-golden/files/golden/conway/build-raw-out.tx"

-- Key filepaths
Expand Down Expand Up @@ -53,7 +53,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
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
-- Key filepaths
outFile <- noteTempFile tempDir "out.json"

Expand Down Expand Up @@ -86,7 +86,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
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
-- Key filepaths
outFile <- noteTempFile tempDir "out.json"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ txOut =

hprop_golden_shelley_transaction_signing_key_witness :: Property
hprop_golden_shelley_transaction_signing_key_witness =
watchdogProp . propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ H.moduleWorkspace "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 @@ -11,7 +11,7 @@ import Data.List (intercalate, sort)
import System.Directory
import System.FilePath

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

import Hedgehog (Property)
import Hedgehog qualified as H
Expand All @@ -33,7 +33,7 @@ tree root = do

hprop_golden_create_staked :: Property
hprop_golden_create_staked =
watchdogProp . propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
propertyOnce $ moduleWorkspace "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 @@ -18,7 +18,7 @@ import System.Directory.Extra (listDirectories)
import System.FilePath

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

import Hedgehog (Property)
import Hedgehog qualified as H
Expand Down Expand Up @@ -105,7 +105,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
propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do
let outputDir = tempDir </> "out"
templateArg :: [String] =
case mShelleyTemplate of
Expand Down Expand Up @@ -159,7 +159,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
propertyOnce $ moduleWorkspace "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 +205,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
propertyOnce $ moduleWorkspace "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