Skip to content
Merged
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
3 changes: 2 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2025-04-08T10:52:25Z
, cardano-haskell-packages 2025-04-16T15:55:07Z
, cardano-haskell-packages 2025-04-22T08:40:01Z

packages:
cardano-api
Expand Down Expand Up @@ -64,3 +64,4 @@ if impl (ghc >= 9.12)

-- https://github.com/kapralVV/Unique/issues/11
, Unique:hashable

6 changes: 3 additions & 3 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ library
network-mux,
nothunks,
ordered-containers,
ouroboros-consensus ^>=0.25,
ouroboros-consensus-cardano ^>=0.24,
ouroboros-consensus ^>=0.26,
ouroboros-consensus-cardano ^>=0.25,
ouroboros-consensus-diffusion ^>=0.22,
ouroboros-consensus-protocol ^>=0.11,
ouroboros-consensus-protocol ^>=0.12,
ouroboros-network,
ouroboros-network-api >=0.13,
ouroboros-network-framework,
Expand Down
12 changes: 7 additions & 5 deletions cardano-api/src/Cardano/Api/Internal/LedgerState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,13 +1353,13 @@ pattern ConwayLedgerState
pattern ConwayLedgerState x = S (S (S (S (S (S (Z x))))))

encodeLedgerState :: LedgerState -> CBOR.Encoding
encodeLedgerState (LedgerState (HFC.HardForkLedgerState st) tbs) =
encodeLedgerState (LedgerState hst@(HFC.HardForkLedgerState st) tbs) =
mconcat
[ CBOR.encodeListLen 2
, HFC.encodeTelescope
(byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* Nil)
st
, Ledger.valuesMKEncoder tbs
, Ledger.valuesMKEncoder hst tbs
]
where
byron = fn (K . Byron.encodeByronLedgerState . unFlip)
Expand All @@ -1373,9 +1373,11 @@ encodeLedgerState (LedgerState (HFC.HardForkLedgerState st) tbs) =
decodeLedgerState :: forall s. CBOR.Decoder s LedgerState
decodeLedgerState = do
2 <- CBOR.decodeListLen
LedgerState . HFC.HardForkLedgerState
<$> HFC.decodeTelescope (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* Nil)
<*> Ledger.valuesMKDecoder
hst <-
HFC.HardForkLedgerState
<$> HFC.decodeTelescope (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* Nil)
tbs <- Ledger.valuesMKDecoder hst
pure (LedgerState hst tbs)
where
byron = Comp $ Flip <$> Byron.decodeByronLedgerState
shelley = Comp $ Flip <$> Shelley.decodeShelleyLedgerState
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading