Skip to content

Commit 5ef342e

Browse files
authored
Merge pull request #1235 from IntersectMBO/jordan/fix-getLedgerTablesUTxOValues-use-getOriginalTxIn
getLedgerTablesUTxOValues: use getOriginalTxIn instead of coerceMapKeys
2 parents 77d6f58 + 25faeed commit 5ef342e

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
project: cardano-api
2+
3+
pr: 1235
4+
5+
kind:
6+
- maintenance
7+
8+
description: |
9+
In getLedgerTablesUTxOValues, replace coerceMapKeys with Shelley.getOriginalTxIn for TxIn key conversion, removing the Wno-x-ord-preserving-coercions suppression pragma.

cardano-api/src/Cardano/Api/LedgerState.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE DataKinds #-}
43
{-# LANGUAGE DerivingStrategies #-}
54
{-# LANGUAGE FlexibleContexts #-}
@@ -12,10 +11,6 @@
1211
{-# LANGUAGE TypeApplications #-}
1312
{-# LANGUAGE TypeOperators #-}
1413

15-
#if __GLASGOW_HASKELL__ >= 910
16-
{-# OPTIONS_GHC -Wno-x-ord-preserving-coercions #-}
17-
#endif
18-
1914
module Cardano.Api.LedgerState
2015
( -- * Initialization / Accumulation
2116
envSecurityParam
@@ -213,7 +208,6 @@ import Ouroboros.Consensus.Shelley.HFEras qualified as Shelley
213208
import Ouroboros.Consensus.Shelley.Ledger.Block qualified as Shelley
214209
import Ouroboros.Consensus.Shelley.Ledger.Ledger qualified as Shelley
215210
import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent))
216-
import Ouroboros.Consensus.Util (coerceMapKeys)
217211
import Ouroboros.Network.Block (blockNo)
218212
import Ouroboros.Network.Block qualified
219213
import Ouroboros.Network.Protocol.ChainSync.Client qualified as CS
@@ -2295,7 +2289,7 @@ getLedgerTablesUTxOValues sbe tbs =
22952289
-> Map TxIn (TxOut CtxUTxO era)
22962290
ejectTables idx =
22972291
let Consensus.LedgerTables (Ledger.ValuesMK values) = HFC.ejectLedgerTables idx tbs
2298-
in Map.mapKeys fromShelleyTxIn $ coerceMapKeys $ Map.map (fromShelleyTxOut sbe) values
2292+
in Map.mapKeys (fromShelleyTxIn . Shelley.getOriginalTxIn) $ Map.map (fromShelleyTxOut sbe) values
22992293
in
23002294
case sbe of
23012295
ShelleyBasedEraShelley -> ejectTables (IS IZ)

0 commit comments

Comments
 (0)