Skip to content

Commit 14524f9

Browse files
authored
Merge pull request #1075 from IntersectMBO/aniketd/release-10-3
Release 10.3
2 parents a142e98 + 40e1b89 commit 14524f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+476
-231
lines changed

cabal.project

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository cardano-haskell-packages
1414
-- you need to run if you change them
1515
index-state:
1616
, hackage.haskell.org 2025-03-18T07:42:38Z
17-
, cardano-haskell-packages 2025-03-19T18:08:29Z
17+
, cardano-haskell-packages 2025-04-02T12:52:59Z
1818

1919

2020
packages:
@@ -23,7 +23,7 @@ packages:
2323
program-options
2424
ghc-options: -Werror
2525

26-
package cryptonite
26+
package crypton
2727
-- Using RDRAND instead of /dev/urandom as an entropy source for key
2828
-- generation is dubious. Set the flag so we use /dev/urandom by default.
2929
flags: -support_rdrand
@@ -77,3 +77,11 @@ if impl (ghc >= 9.12)
7777
-- https://github.com/fizruk/http-api-data/pull/146
7878
, http-api-data:base
7979

80+
-- https://github.com/IntersectMBO/ouroboros-consensus/blob/main/cabal.project#L70-L74
81+
, ouroboros-network-protocols:base
82+
, ouroboros-network-framework:base
83+
, ouroboros-network-api:base
84+
, network-mux:base
85+
, ouroboros-network:base
86+
, cardano-ping:base
87+

cardano-cli/cardano-cli.cabal

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,22 +236,25 @@ library
236236
binary,
237237
bytestring,
238238
canonical-json,
239-
cardano-api ^>=10.11.1,
239+
cardano-api ^>=10.12,
240240
cardano-binary,
241241
cardano-crypto,
242-
cardano-crypto-class ^>=2.1.2,
243-
cardano-crypto-wrapper ^>=1.5.1,
242+
cardano-crypto-class ^>=2.2,
243+
cardano-crypto-wrapper ^>=1.6,
244244
cardano-data >=1.1,
245245
cardano-git-rev ^>=0.2.2,
246246
cardano-ledger-api,
247-
cardano-ping ^>=0.7,
247+
cardano-ledger-conway,
248+
cardano-ledger-core,
249+
cardano-ping ^>=0.8,
248250
cardano-prelude,
251+
cardano-protocol-tpraos,
249252
cardano-slotting ^>=0.2.0.0,
250253
cardano-strict-containers ^>=0.1,
251254
cborg >=0.2.4 && <0.3,
252255
containers,
253256
contra-tracer,
254-
cryptonite,
257+
crypton,
255258
deepseq,
256259
directory,
257260
exceptions,
@@ -296,7 +299,7 @@ executable cardano-cli
296299
build-depends:
297300
cardano-api,
298301
cardano-cli,
299-
cardano-crypto-class ^>=2.1.2,
302+
cardano-crypto-class ^>=2.2,
300303
optparse-applicative-fork,
301304
transformers-except,
302305

cardano-cli/src/Cardano/CLI/Compatible/Command.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import Cardano.CLI.Compatible.StakePool.Command
2020
import Cardano.CLI.Compatible.Transaction.Command
2121

2222
import Data.Text
23+
import Data.Typeable (Typeable)
2324

2425
data AnyCompatibleCommand where
25-
AnyCompatibleCommand :: CompatibleCommand era -> AnyCompatibleCommand
26+
AnyCompatibleCommand :: Typeable era => CompatibleCommand era -> AnyCompatibleCommand
2627

2728
renderAnyCompatibleCommand :: AnyCompatibleCommand -> Text
2829
renderAnyCompatibleCommand = \case

cardano-cli/src/Cardano/CLI/Compatible/Governance/Run.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import Cardano.CLI.Compatible.Exception
1111
import Cardano.CLI.Compatible.Governance.Command
1212
import Cardano.CLI.EraBased.Governance.Run
1313

14-
runCompatibleGovernanceCmds :: CompatibleGovernanceCmds era -> CIO e ()
14+
import Data.Typeable (Typeable)
15+
16+
runCompatibleGovernanceCmds :: Typeable era => CompatibleGovernanceCmds era -> CIO e ()
1517
runCompatibleGovernanceCmds = \case
1618
CreateCompatibleProtocolUpdateCmd cmd -> fromExceptTCli $ runGovernanceCmds cmd

cardano-cli/src/Cardano/CLI/Compatible/Run.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import Cardano.CLI.Compatible.StakeAddress.Run
1515
import Cardano.CLI.Compatible.StakePool.Run
1616
import Cardano.CLI.Compatible.Transaction.Run
1717

18+
import Data.Typeable (Typeable)
19+
1820
runAnyCompatibleCommand :: AnyCompatibleCommand -> CIO e ()
1921
runAnyCompatibleCommand (AnyCompatibleCommand cmd) = runCompatibleCommand cmd
2022

21-
runCompatibleCommand :: CompatibleCommand era -> CIO e ()
23+
runCompatibleCommand :: Typeable era => CompatibleCommand era -> CIO e ()
2224
runCompatibleCommand = \case
2325
CompatibleTransactionCmds txCmd ->
2426
runCompatibleTransactionCmd txCmd

cardano-cli/src/Cardano/CLI/Compatible/StakePool/Run.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ runStakePoolRegistrationCertificateCmd
110110
createStakePoolRegistrationRequirements
111111
:: ()
112112
=> ShelleyBasedEra era
113-
-> L.PoolParams (L.EraCrypto (ShelleyLedgerEra era))
113+
-> L.PoolParams
114114
-> StakePoolRegistrationRequirements era
115115
createStakePoolRegistrationRequirements sbe pparams =
116116
caseShelleyToBabbageOrConwayEraOnwards

cardano-cli/src/Cardano/CLI/EraBased/Common/Option.hs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
module Cardano.CLI.EraBased.Common.Option where
1414

1515
import Cardano.Api
16-
import Cardano.Api.Ledger (StandardCrypto)
1716
import Cardano.Api.Ledger qualified as L
1817
import Cardano.Api.Network qualified as Consensus
1918
import Cardano.Api.Shelley
@@ -36,6 +35,7 @@ import Cardano.CLI.Type.Common
3635
import Cardano.CLI.Type.Governance
3736
import Cardano.CLI.Type.Key
3837
import Cardano.CLI.Type.Key.VerificationKey
38+
import Cardano.Ledger.BaseTypes (NonZero, nonZero)
3939

4040
import Control.Monad (void, when)
4141
import Data.Aeson qualified as Aeson
@@ -895,7 +895,7 @@ pConstitutionUrl =
895895
ConstitutionUrl
896896
<$> pUrl "constitution-url" "Constitution URL."
897897

898-
pConstitutionHash :: Parser (L.SafeHash L.StandardCrypto L.AnchorData)
898+
pConstitutionHash :: Parser (L.SafeHash L.AnchorData)
899899
pConstitutionHash =
900900
Opt.option readSafeHash $
901901
mconcat
@@ -2209,7 +2209,7 @@ pRefScriptFp =
22092209
pMintMultiAsset
22102210
:: ShelleyBasedEra era
22112211
-> BalanceTxExecUnits
2212-
-> Parser (Maybe (L.MultiAsset StandardCrypto, [CliMintScriptRequirements]))
2212+
-> Parser (Maybe (L.MultiAsset, [CliMintScriptRequirements]))
22132213
pMintMultiAsset w balanceExecUnits =
22142214
caseShelleyToAllegraOrMaryEraOnwards
22152215
(const $ pure Nothing)
@@ -2926,6 +2926,16 @@ integralParsecParser = do
29262926
where
29272927
typeName = show $ typeRep (Proxy @a)
29282928

2929+
nonZeroReader :: ReadM (NonZero Word64)
2930+
nonZeroReader = readerFromParsecParser nonZeroParsecParser
2931+
2932+
nonZeroParsecParser :: Parsec.Parser (NonZero Word64)
2933+
nonZeroParsecParser = do
2934+
i <- decimal -- Parses a non-negative whole number, so we only need to check for zero.
2935+
case nonZero $ fromIntegral i of
2936+
Nothing -> fail $ "Cannot parse " <> show i <> " as a (NonZero Word64)"
2937+
Just nz -> return nz
2938+
29292939
pMaxBlockHeaderSize :: Parser Word16
29302940
pMaxBlockHeaderSize =
29312941
Opt.option integralReader $
@@ -3439,12 +3449,12 @@ pAlwaysAbstain =
34393449
, Opt.help "Abstain from voting on all proposals."
34403450
]
34413451

3442-
pVoteAnchor :: Parser (VoteUrl, L.SafeHash L.StandardCrypto L.AnchorData)
3452+
pVoteAnchor :: Parser (VoteUrl, L.SafeHash L.AnchorData)
34433453
pVoteAnchor =
34443454
((,) . VoteUrl <$> pUrl "anchor-url" "Vote anchor URL")
34453455
<*> pVoteAnchorDataHash
34463456

3447-
pVoteAnchorDataHash :: Parser (L.SafeHash L.StandardCrypto L.AnchorData)
3457+
pVoteAnchorDataHash :: Parser (L.SafeHash L.AnchorData)
34483458
pVoteAnchorDataHash =
34493459
Opt.option readSafeHash $
34503460
mconcat
@@ -3558,7 +3568,7 @@ pAllOrOnlySPOHashSource = pAll <|> pOnly
35583568
pAllOrOnlyGovActionIds
35593569
:: ()
35603570
=> ConwayEraOnwards era
3561-
-> Parser (AllOrOnly (L.GovActionId L.StandardCrypto))
3571+
-> Parser (AllOrOnly L.GovActionId)
35623572
pAllOrOnlyGovActionIds era = pAll <|> pOnly
35633573
where
35643574
pOnly = Only <$> pGovActionIds era
@@ -3573,13 +3583,13 @@ pGovActionIds
35733583
:: forall era
35743584
. ()
35753585
=> ConwayEraOnwards era
3576-
-> Parser [L.GovActionId L.StandardCrypto]
3586+
-> Parser [L.GovActionId]
35773587
pGovActionIds era = conwayEraOnwardsConstraints era (some pLedgerGovernanceAction)
35783588
where
3579-
pLedgerGovernanceAction :: Parser (L.GovActionId L.StandardCrypto)
3589+
pLedgerGovernanceAction :: Parser L.GovActionId
35803590
pLedgerGovernanceAction = uncurry L.GovActionId <$> pairParser
35813591

3582-
pairParser :: Parser (L.TxId L.StandardCrypto, L.GovActionIx)
3592+
pairParser :: Parser (L.TxId, L.GovActionIx)
35833593
pairParser = bimap toShelleyTxId L.GovActionIx <$> pGovernanceActionId
35843594

35853595
pDRepVerificationKeyHash :: Parser (Hash DRepKey)
@@ -3645,10 +3655,10 @@ pAnchorUrl =
36453655
ProposalUrl
36463656
<$> pUrl "anchor-url" "Anchor URL"
36473657

3648-
pExpectedAnchorDataHash :: Parser (L.SafeHash L.StandardCrypto L.AnchorData)
3658+
pExpectedAnchorDataHash :: Parser (L.SafeHash L.AnchorData)
36493659
pExpectedAnchorDataHash = pExpectedHash id "anchor data"
36503660

3651-
pExpectedHash :: (L.SafeHash L.StandardCrypto L.AnchorData -> a) -> String -> Parser a
3661+
pExpectedHash :: (L.SafeHash L.AnchorData -> a) -> String -> Parser a
36523662
pExpectedHash adaptor hashedDataName =
36533663
Opt.option (adaptor <$> readSafeHash) $
36543664
mconcat
@@ -3661,7 +3671,7 @@ pExpectedHash adaptor hashedDataName =
36613671
]
36623672
]
36633673

3664-
pAnchorDataHash :: Parser (L.SafeHash L.StandardCrypto L.AnchorData)
3674+
pAnchorDataHash :: Parser (L.SafeHash L.AnchorData)
36653675
pAnchorDataHash =
36663676
Opt.option readSafeHash $
36673677
mconcat

cardano-cli/src/Cardano/CLI/EraBased/Genesis/Command.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ module Cardano.CLI.EraBased.Genesis.Command
1919
)
2020
where
2121

22-
import Cardano.Api.Byron qualified as Byron
2322
import Cardano.Api.Experimental qualified as Exp
2423
import Cardano.Api.Ledger (Coin)
2524
import Cardano.Api.Shelley
2625

2726
import Cardano.CLI.Type.Common
27+
import Cardano.Ledger.BaseTypes (NonZero)
2828

2929
import Data.Text (Text)
30+
import Data.Word (Word64)
3031

3132
data GenesisCmds era
3233
= GenesisCreate !(GenesisCreateCmdArgs era)
@@ -62,7 +63,7 @@ data GenesisCreateCardanoCmdArgs era = GenesisCreateCardanoCmdArgs
6263
, numUTxOKeys :: !Word
6364
, mSystemStart :: !(Maybe SystemStart)
6465
, mSupply :: !(Maybe Coin)
65-
, security :: !Byron.BlockCount
66+
, security :: !(NonZero Word64)
6667
, slotLength :: !Word
6768
, slotCoeff :: !Rational
6869
, network :: !NetworkId

0 commit comments

Comments
 (0)