Skip to content

Commit f4fe4fe

Browse files
author
Aniket Deshpande
committed
Latest ledger, network, consensus and plutus
1 parent dc5eacc commit f4fe4fe

70 files changed

Lines changed: 702 additions & 782 deletions

Some content is hidden

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

cabal.project

Lines changed: 1 addition & 1 deletion
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-17T12:01:29Z
17-
, cardano-haskell-packages 2025-03-03T04:46:42Z
17+
, cardano-haskell-packages 2025-03-25T16:05:50Z
1818

1919
packages:
2020
cardano-api

cardano-api/cardano-api.cabal

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,20 @@ library
117117
cardano-addresses ^>=4.0.0,
118118
cardano-binary,
119119
cardano-crypto,
120-
cardano-crypto-class ^>=2.1.2,
121-
cardano-crypto-wrapper ^>=1.5,
120+
cardano-crypto-class ^>=2.2.1,
121+
cardano-crypto-wrapper ^>=1.6,
122122
cardano-data >=1.0,
123-
cardano-ledger-allegra >=1.6,
124-
cardano-ledger-alonzo >=1.10.2,
125-
cardano-ledger-api >=1.9.3,
126-
cardano-ledger-babbage >=1.9,
127-
cardano-ledger-binary >=1.3,
128-
cardano-ledger-byron >=1.0.1,
129-
cardano-ledger-conway >=1.16,
130-
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
131-
cardano-ledger-mary >=1.7,
132-
cardano-ledger-shelley >=1.13,
133-
cardano-protocol-tpraos >=1.2,
123+
cardano-ledger-allegra >=1.7,
124+
cardano-ledger-alonzo >=1.13,
125+
cardano-ledger-api >=1.11,
126+
cardano-ledger-babbage >=1.11,
127+
cardano-ledger-binary >=1.6,
128+
cardano-ledger-byron >=1.1,
129+
cardano-ledger-conway >=1.19,
130+
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
131+
cardano-ledger-mary >=1.8,
132+
cardano-ledger-shelley >=1.16,
133+
cardano-protocol-tpraos >=1.4,
134134
cardano-slotting >=0.2.0.0,
135135
cardano-strict-containers >=0.1,
136136
cborg,
@@ -156,21 +156,20 @@ library
156156
network-mux,
157157
nothunks,
158158
ordered-containers,
159-
ouroboros-consensus ^>=0.22,
160-
ouroboros-consensus-cardano ^>=0.21,
161-
ouroboros-consensus-diffusion ^>=0.19 || ^>=0.20,
162-
ouroboros-consensus-protocol ^>=0.10,
159+
ouroboros-consensus ^>=0.23,
160+
ouroboros-consensus-cardano ^>=0.22,
161+
ouroboros-consensus-diffusion ^>=0.19 || ^>=0.21,
162+
ouroboros-consensus-protocol ^>=0.11,
163163
ouroboros-network,
164-
ouroboros-network-api ^>=0.12,
164+
ouroboros-network-api >=0.13,
165165
ouroboros-network-framework,
166166
ouroboros-network-protocols,
167167
parsec,
168-
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.40,
168+
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.43,
169169
prettyprinter,
170170
prettyprinter-ansi-terminal,
171171
prettyprinter-configurable ^>=1.36,
172172
random,
173-
reflection,
174173
safe-exceptions,
175174
scientific,
176175
serialise,
@@ -288,8 +287,8 @@ library gen
288287
bytestring,
289288
cardano-api,
290289
cardano-binary >=1.6 && <1.8,
291-
cardano-crypto-class ^>=2.1.2,
292-
cardano-crypto-test ^>=1.5,
290+
cardano-crypto-class ^>=2.2.1,
291+
cardano-crypto-test ^>=1.6,
293292
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.8.1,
294293
cardano-ledger-byron-test >=1.5,
295294
cardano-ledger-conway:testlib,
@@ -319,9 +318,9 @@ test-suite cardano-api-test
319318
cardano-api:gen,
320319
cardano-binary,
321320
cardano-crypto,
322-
cardano-crypto-class ^>=2.1.2,
323-
cardano-crypto-test ^>=1.5,
324-
cardano-crypto-tests ^>=2.1,
321+
cardano-crypto-class ^>=2.2.1,
322+
cardano-crypto-test ^>=1.6,
323+
cardano-crypto-tests ^>=2.2,
325324
cardano-ledger-alonzo,
326325
cardano-ledger-api >=1.9,
327326
cardano-ledger-binary,
@@ -391,14 +390,15 @@ test-suite cardano-api-golden
391390
cardano-api,
392391
cardano-api:gen,
393392
cardano-binary,
394-
cardano-crypto-class ^>=2.1.2,
393+
cardano-crypto-class ^>=2.2.1,
395394
cardano-data >=1.0,
396395
cardano-ledger-alonzo,
397396
cardano-ledger-api >=1.9,
398397
cardano-ledger-binary,
399398
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
400399
cardano-ledger-shelley,
401400
cardano-ledger-shelley-test >=1.2.0.1,
401+
cardano-protocol-tpraos,
402402
cardano-slotting ^>=0.2.0.0,
403403
containers,
404404
errors,
@@ -407,7 +407,7 @@ test-suite cardano-api-golden
407407
hedgehog-extras ^>=0.7,
408408
microlens,
409409
parsec,
410-
plutus-core ^>=1.40,
410+
plutus-core ^>=1.43,
411411
plutus-ledger-api,
412412
tasty,
413413
tasty-hedgehog,

cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ genLedgerValueForTxOut sbe = do
518518
)
519519
sbe
520520

521-
genLedgerMultiAssetValue :: Gen (L.MultiAsset L.StandardCrypto)
521+
genLedgerMultiAssetValue :: Gen L.MultiAsset
522522
genLedgerMultiAssetValue = Q.arbitrary
523523

524524
-- Note that we expect to sometimes generate duplicate policy id keys since we

cardano-api/src/Cardano/Api.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,6 @@ module Cardano.Api
10391039
, queryPoolDistribution
10401040
, queryPoolState
10411041
, queryProtocolParameters
1042-
, queryProtocolParametersUpdate
10431042
, queryProtocolState
10441043
, queryStakeAddresses
10451044
, queryStakeDelegDeposits
@@ -1059,6 +1058,8 @@ module Cardano.Api
10591058
, queryProposals
10601059
, queryCommitteeMembersState
10611060
, queryStakeVoteDelegatees
1061+
, queryStakePoolDefaultVote
1062+
, queryLedgerConfig
10621063

10631064
-- ** Committee State Query
10641065
, MemberStatus (..)

cardano-api/src/Cardano/Api/Internal/Address.hs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ import Cardano.Chain.Common qualified as Byron
106106
import Cardano.Ledger.Address qualified as Shelley
107107
import Cardano.Ledger.BaseTypes qualified as Shelley
108108
import Cardano.Ledger.Credential qualified as Shelley
109-
import Cardano.Ledger.Crypto (StandardCrypto)
110109
import Cardano.Ledger.Plutus.TxInfo qualified as Plutus
111110
import PlutusLedgerApi.V1 qualified as PlutusAPI
112111

@@ -188,8 +187,8 @@ data Address addrtype where
188187
-- in Shelley era and are thus supported from the Shelley era onwards
189188
ShelleyAddress
190189
:: Shelley.Network
191-
-> Shelley.PaymentCredential StandardCrypto
192-
-> Shelley.StakeReference StandardCrypto
190+
-> Shelley.PaymentCredential
191+
-> Shelley.StakeReference
193192
-> Address ShelleyAddr
194193

195194
-- Note that the two ledger credential types here are parametrised by
@@ -231,7 +230,7 @@ instance SerialiseAsRawBytes (Address ByronAddr) where
231230
$ addr
232231

233232
deserialiseFromRawBytes (AsAddress AsByronAddr) bs =
234-
case Shelley.decodeAddr bs :: Maybe (Shelley.Addr StandardCrypto) of
233+
case Shelley.decodeAddr bs :: Maybe Shelley.Addr of
235234
Nothing -> Left (SerialiseAsRawBytesError "Unable to deserialise Address ByronAddr")
236235
Just Shelley.Addr{} -> Left (SerialiseAsRawBytesError "Unable to deserialise Address ByronAddr")
237236
Just (Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)) ->
@@ -352,7 +351,7 @@ instance SerialiseAddress AddressAny where
352351
(AddressByron <$> deserialiseAddress (AsAddress AsByronAddr) t)
353352
<|> (AddressShelley <$> deserialiseAddress (AsAddress AsShelleyAddr) t)
354353

355-
fromShelleyAddrToAny :: Shelley.Addr StandardCrypto -> AddressAny
354+
fromShelleyAddrToAny :: Shelley.Addr -> AddressAny
356355
fromShelleyAddrToAny (Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)) =
357356
AddressByron $ ByronAddress addr
358357
fromShelleyAddrToAny (Shelley.Addr nw pc scr) =
@@ -531,7 +530,7 @@ makeShelleyAddressInEra sbe nw pc scr =
531530
data StakeAddress where
532531
StakeAddress
533532
:: Shelley.Network
534-
-> Shelley.StakeCredential StandardCrypto
533+
-> Shelley.StakeCredential
535534
-> StakeAddress
536535
deriving (Eq, Ord, Show)
537536

@@ -634,7 +633,7 @@ shelleyPayAddrToPlutusPubKHash (ShelleyAddress _ payCred _) =
634633
-- Internal conversion functions
635634
--
636635

637-
toShelleyAddr :: AddressInEra era -> Shelley.Addr StandardCrypto
636+
toShelleyAddr :: AddressInEra era -> Shelley.Addr
638637
toShelleyAddr (AddressInEra ByronAddressInAnyEra (ByronAddress addr)) =
639638
Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)
640639
toShelleyAddr
@@ -644,7 +643,7 @@ toShelleyAddr
644643
) =
645644
Shelley.Addr nw pc scr
646645

647-
toShelleyStakeAddr :: StakeAddress -> Shelley.RewardAccount StandardCrypto
646+
toShelleyStakeAddr :: StakeAddress -> Shelley.RewardAccount
648647
toShelleyStakeAddr (StakeAddress nw sc) =
649648
Shelley.RewardAccount
650649
{ Shelley.raNetwork = nw
@@ -653,23 +652,23 @@ toShelleyStakeAddr (StakeAddress nw sc) =
653652

654653
toShelleyPaymentCredential
655654
:: PaymentCredential
656-
-> Shelley.PaymentCredential StandardCrypto
655+
-> Shelley.PaymentCredential
657656
toShelleyPaymentCredential (PaymentCredentialByKey (PaymentKeyHash kh)) =
658657
Shelley.KeyHashObj kh
659658
toShelleyPaymentCredential (PaymentCredentialByScript sh) =
660659
Shelley.ScriptHashObj (toShelleyScriptHash sh)
661660

662661
toShelleyStakeCredential
663662
:: StakeCredential
664-
-> Shelley.StakeCredential StandardCrypto
663+
-> Shelley.StakeCredential
665664
toShelleyStakeCredential (StakeCredentialByKey (StakeKeyHash kh)) =
666665
Shelley.KeyHashObj kh
667666
toShelleyStakeCredential (StakeCredentialByScript sh) =
668667
Shelley.ScriptHashObj (toShelleyScriptHash sh)
669668

670669
toShelleyStakeReference
671670
:: StakeAddressReference
672-
-> Shelley.StakeReference StandardCrypto
671+
-> Shelley.StakeReference
673672
toShelleyStakeReference (StakeAddressByValue stakecred) =
674673
Shelley.StakeRefBase (toShelleyStakeCredential stakecred)
675674
toShelleyStakeReference (StakeAddressByPointer ptr) =
@@ -680,7 +679,7 @@ toShelleyStakeReference NoStakeAddress =
680679
fromShelleyAddrIsSbe
681680
:: ()
682681
=> ShelleyBasedEra era
683-
-> Shelley.Addr StandardCrypto
682+
-> Shelley.Addr
684683
-> AddressInEra era
685684
fromShelleyAddrIsSbe sbe = \case
686685
Shelley.AddrBootstrap (Shelley.BootstrapAddress addr) ->
@@ -690,7 +689,7 @@ fromShelleyAddrIsSbe sbe = \case
690689

691690
fromShelleyAddr
692691
:: ShelleyBasedEra era
693-
-> Shelley.Addr StandardCrypto
692+
-> Shelley.Addr
694693
-> AddressInEra era
695694
fromShelleyAddr _ (Shelley.AddrBootstrap (Shelley.BootstrapAddress addr)) =
696695
AddressInEra ByronAddressInAnyEra (ByronAddress addr)
@@ -699,27 +698,27 @@ fromShelleyAddr sBasedEra (Shelley.Addr nw pc scr) =
699698
(ShelleyAddressInEra sBasedEra)
700699
(ShelleyAddress nw pc scr)
701700

702-
fromShelleyStakeAddr :: Shelley.RewardAccount StandardCrypto -> StakeAddress
701+
fromShelleyStakeAddr :: Shelley.RewardAccount -> StakeAddress
703702
fromShelleyStakeAddr (Shelley.RewardAccount nw sc) = StakeAddress nw sc
704703

705704
fromShelleyStakeCredential
706-
:: Shelley.StakeCredential StandardCrypto
705+
:: Shelley.StakeCredential
707706
-> StakeCredential
708707
fromShelleyStakeCredential (Shelley.KeyHashObj kh) =
709708
StakeCredentialByKey (StakeKeyHash kh)
710709
fromShelleyStakeCredential (Shelley.ScriptHashObj sh) =
711710
StakeCredentialByScript (fromShelleyScriptHash sh)
712711

713712
fromShelleyPaymentCredential
714-
:: Shelley.PaymentCredential StandardCrypto
713+
:: Shelley.PaymentCredential
715714
-> PaymentCredential
716715
fromShelleyPaymentCredential (Shelley.KeyHashObj kh) =
717716
PaymentCredentialByKey (PaymentKeyHash kh)
718717
fromShelleyPaymentCredential (Shelley.ScriptHashObj sh) =
719718
PaymentCredentialByScript (ScriptHash sh)
720719

721720
fromShelleyStakeReference
722-
:: Shelley.StakeReference StandardCrypto
721+
:: Shelley.StakeReference
723722
-> StakeAddressReference
724723
fromShelleyStakeReference (Shelley.StakeRefBase stakecred) =
725724
StakeAddressByValue (fromShelleyStakeCredential stakecred)

cardano-api/src/Cardano/Api/Internal/Anchor.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module Cardano.Api.Internal.Anchor
55
where
66

77
import Cardano.Ledger.BaseTypes qualified as L
8-
import Cardano.Ledger.Crypto qualified as Crypto
9-
import Cardano.Ledger.SafeHash qualified as L
8+
import Cardano.Ledger.Hashes qualified as L
109

1110
-- | The URL to build the anchor to pass to DRep registration certificate
1211
newtype AnchorUrl = AnchorUrl
@@ -16,6 +15,6 @@ newtype AnchorUrl = AnchorUrl
1615

1716
-- | The hash to build the anchor to pass to DRep registration certificate
1817
newtype AnchorDataHash = AnchorDataHash
19-
{ unAnchorDataHash :: L.SafeHash Crypto.StandardCrypto L.AnchorData
18+
{ unAnchorDataHash :: L.SafeHash L.AnchorData
2019
}
2120
deriving (Eq, Show)

cardano-api/src/Cardano/Api/Internal/Block.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ import Cardano.Api.Internal.Tx.Sign
6363

6464
import Cardano.Crypto.Hash.Class qualified as Crypto
6565
import Cardano.Crypto.Hashing qualified
66-
import Cardano.Ledger.Api qualified as L
6766
import Cardano.Ledger.Block qualified as Ledger
6867
import Cardano.Ledger.Core qualified as Ledger
68+
import Cardano.Protocol.Crypto qualified as L
6969
import Cardano.Slotting.Block (BlockNo)
7070
import Cardano.Slotting.Slot (EpochNo, SlotNo, WithOrigin (..))
7171
import Ouroboros.Consensus.Block qualified as Consensus

0 commit comments

Comments
 (0)