Skip to content

Commit ae8a93f

Browse files
committed
Fix non-test compilation errors
1 parent eed7d01 commit ae8a93f

9 files changed

Lines changed: 28 additions & 25 deletions

File tree

cardano-api/cardano-api.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ library gen
326326
cardano-crypto-wrapper:{cardano-crypto-wrapper, testlib} ^>=1.7,
327327
cardano-ledger-alonzo >=1.8.1,
328328
cardano-ledger-babbage,
329-
cardano-ledger-byron,
330-
cardano-ledger-conway,
331-
cardano-ledger-core >=1.14,
332-
cardano-ledger-dijkstra >=0.1,
329+
cardano-ledger-byron:{cardano-ledger-byron, testlib},
330+
cardano-ledger-conway:{cardano-ledger-conway, testlib},
331+
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
332+
cardano-ledger-dijkstra:{cardano-ledger-dijkstra, testlib} >=0.1,
333333
cardano-ledger-mary,
334334
cardano-ledger-shelley >=1.13,
335335
cardano-strict-containers,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import Data.ByteString qualified as BS
8080
import Data.ByteString.Short qualified as SBS
8181
import Data.Foldable (Foldable (toList))
8282
import Data.Text (Text)
83+
import Lens.Micro ((^.))
8384

8485
-- ----------------------------------------------------------------------------
8586
-- Blocks in an era
@@ -174,9 +175,7 @@ getShelleyBlockTxs
174175
-> [Tx era]
175176
getShelleyBlockTxs era (Ledger.Block _header txs) =
176177
[ ShelleyTx era txinblock
177-
| txinblock <- toList (Ledger.fromTxSeq txs)
178-
-- TODO: Need to Ledger.fromTxSeq -> txSeqBlockBodyL,
179-
-- but the latter causes a blow-up of constraints
178+
| txinblock <- toList (txs ^. Ledger.txSeqBlockBodyL)
180179
]
181180

182181
-- ----------------------------------------------------------------------------

cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ module Cardano.Api.Ledger.Internal.Reexport
143143
, EraGov
144144
, EraTx (witsTxL, bodyTxL)
145145
, Tx
146+
, TopTx
146147
, TxDats (..)
147148
, costModelsValid
148149
, getCostModelParams
@@ -316,6 +317,7 @@ import Cardano.Ledger.Core
316317
, EraTxOut
317318
, PParams (..)
318319
, PoolCert (..)
320+
, TopTx
319321
, Value
320322
, fromEraCBOR
321323
, ppMinFeeAL

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,7 @@ renderHash
17921792
:: Cardano.Crypto.Hash.Class.Hash Cardano.Crypto.Hash.Blake2b.Blake2b_256 ByteString -> Text
17931793
renderHash h = Text.decodeUtf8 $ Base16.encode (Cardano.Crypto.Hash.Class.hashToBytes h)
17941794

1795-
newtype StakeCred = StakeCred {_unStakeCred :: Ledger.Credential 'Ledger.Staking}
1795+
newtype StakeCred = StakeCred {_unStakeCred :: Ledger.Credential Ledger.Staking}
17961796
deriving (Eq, Ord)
17971797

17981798
data Env = Env
@@ -2096,7 +2096,7 @@ nextEpochEligibleLeadershipSlots sbe sGen serCurrEpochState ptclState poolid (Vr
20962096
snapshot = ShelleyAPI.ssStakeMark $ ShelleyAPI.esSnapshots cEstate
20972097
markSnapshotPoolDistr
20982098
:: Map
2099-
(SL.KeyHash 'SL.StakePool)
2099+
(SL.KeyHash SL.StakePool)
21002100
SL.IndividualPoolStake
21012101
markSnapshotPoolDistr = ShelleyAPI.unPoolDistr . ShelleyAPI.calculatePoolDistr $ snapshot
21022102

@@ -2133,7 +2133,7 @@ isLeadingSlotsTPraos
21332133
=> Set SlotNo
21342134
-> PoolId
21352135
-> Map
2136-
(SL.KeyHash 'SL.StakePool)
2136+
(SL.KeyHash SL.StakePool)
21372137
SL.IndividualPoolStake
21382138
-> Consensus.Nonce
21392139
-> Crypto.SignKeyVRF v
@@ -2158,7 +2158,7 @@ isLeadingSlotsPraos
21582158
=> Set SlotNo
21592159
-> PoolId
21602160
-> Map
2161-
(SL.KeyHash 'SL.StakePool)
2161+
(SL.KeyHash SL.StakePool)
21622162
SL.IndividualPoolStake
21632163
-> Consensus.Nonce
21642164
-> Crypto.SignKeyVRF (Crypto.VRF Consensus.StandardCrypto)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ data LedgerEvent
7272
Ledger.TxId
7373
(Set (Ledger.Voter, Ledger.GovActionId))
7474
-- ^ Votes that were replaced in this tx.
75-
(Set (Ledger.Credential 'Ledger.DRepRole))
75+
(Set (Ledger.Credential Ledger.DRepRole))
7676
-- ^ Any votes from these DReps in this or in previous txs are removed
7777
| -- | The current state of governance matters at the epoch boundary.
7878
-- I.E the current constitution, committee, protocol parameters, etc.
@@ -110,7 +110,7 @@ data PoolReapDetails = PoolReapDetails
110110

111111
convertRetiredPoolsMap
112112
:: Map
113-
Ledger.StakeCredential
113+
(Ledger.Credential Ledger.Staking)
114114
(Map (Ledger.KeyHash Ledger.StakePool) (Ledger.CompactForm Ledger.Coin))
115115
-> Map StakeCredential (Map (Hash StakePoolKey) L.Coin)
116116
convertRetiredPoolsMap =

cardano-api/src/Cardano/Api/Query/Internal/Expr.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ queryDRepStakeDistribution eon = querySbe eon . QueryDRepStakeDistr
429429

430430
querySPOStakeDistribution
431431
:: ConwayEraOnwards era
432-
-> Set (L.KeyHash 'L.StakePool)
432+
-> Set (L.KeyHash L.StakePool)
433433
-- ^ An empty SPO key hash set means that distributions for all SPOs will be returned
434434
-> LocalStateQueryExpr
435435
block
@@ -439,7 +439,7 @@ querySPOStakeDistribution
439439
IO
440440
( Either
441441
UnsupportedNtcVersionError
442-
(Either EraMismatch (Map (L.KeyHash 'L.StakePool) L.Coin))
442+
(Either EraMismatch (Map (L.KeyHash L.StakePool) L.Coin))
443443
)
444444
querySPOStakeDistribution eon = querySbe eon . QuerySPOStakeDistr
445445

@@ -507,7 +507,7 @@ queryProposals eon = querySbe eon . QueryProposals
507507
queryStakePoolDefaultVote
508508
:: forall era block point r
509509
. ConwayEraOnwards era
510-
-> L.KeyHash 'L.StakePool
510+
-> L.KeyHash L.StakePool
511511
-> LocalStateQueryExpr
512512
block
513513
point

cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ data QueryInShelleyBasedEra era result where
301301
:: Set Ledger.DRep
302302
-> QueryInShelleyBasedEra era (Map Ledger.DRep L.Coin)
303303
QuerySPOStakeDistr
304-
:: Set (Ledger.KeyHash 'Ledger.StakePool)
305-
-> QueryInShelleyBasedEra era (Map (Ledger.KeyHash 'Ledger.StakePool) L.Coin)
304+
:: Set (Ledger.KeyHash Ledger.StakePool)
305+
-> QueryInShelleyBasedEra era (Map (Ledger.KeyHash Ledger.StakePool) L.Coin)
306306
QueryCommitteeMembersState
307307
:: Set (Shelley.Credential Shelley.ColdCommitteeRole)
308308
-> Set (Shelley.Credential Shelley.HotCommitteeRole)
@@ -317,7 +317,7 @@ data QueryInShelleyBasedEra era result where
317317
QueryLedgerPeerSnapshot
318318
:: QueryInShelleyBasedEra era (Serialised LedgerPeerSnapshot)
319319
QueryStakePoolDefaultVote
320-
:: Ledger.KeyHash 'Ledger.StakePool
320+
:: Ledger.KeyHash Ledger.StakePool
321321
-> QueryInShelleyBasedEra era L.DefaultVote
322322

323323
deriving instance Show (QueryInShelleyBasedEra era result)
@@ -501,7 +501,7 @@ fromShelleyDelegations =
501501
. toList
502502

503503
fromShelleyRewardAccounts
504-
:: Map (Shelley.Credential 'Core.Staking) L.Coin
504+
:: Map (Shelley.Credential Core.Staking) L.Coin
505505
-> Map StakeCredential L.Coin
506506
fromShelleyRewardAccounts =
507507
-- TODO: write an appropriate property to show it is safe to use

cardano-api/src/Cardano/Api/Tx/Internal/Body.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,9 @@ fromLedgerTxInsCollateral sbe body =
16221622
sbe
16231623

16241624
fromLedgerTxInsReference
1625-
:: ShelleyBasedEra era -> Ledger.TxBody Ledger.TopTx (ShelleyLedgerEra era) -> TxInsReference ViewTx era
1625+
:: ShelleyBasedEra era
1626+
-> Ledger.TxBody Ledger.TopTx (ShelleyLedgerEra era)
1627+
-> TxInsReference ViewTx era
16261628
fromLedgerTxInsReference sbe txBody =
16271629
caseShelleyToAlonzoOrBabbageEraOnwards
16281630
(const TxInsReferenceNone)
@@ -1913,13 +1915,13 @@ convMintValue txMintValue = do
19131915
multiAsset
19141916

19151917
convExtraKeyWitnesses
1916-
:: TxExtraKeyWitnesses era -> Set (Shelley.KeyHash Shelley.Witness)
1918+
:: TxExtraKeyWitnesses era -> Set (Shelley.KeyHash Shelley.Guard)
19171919
convExtraKeyWitnesses txExtraKeyWits =
19181920
case txExtraKeyWits of
19191921
TxExtraKeyWitnessesNone -> Set.empty
19201922
TxExtraKeyWitnesses _ khs ->
19211923
fromList
1922-
[ Shelley.asWitness kh
1924+
[ Shelley.coerceKeyRole kh
19231925
| PaymentKeyHash kh <- khs
19241926
]
19251927

cardano-api/src/Cardano/Api/Tx/Internal/Fee.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,12 @@ evaluateTransactionBalance sbe pp poolids stakeDelegDeposits drepDelegDeposits u
836836
isRegPool kh = StakePoolKeyHash kh `Set.member` poolids
837837

838838
lookupDelegDeposit
839-
:: Ledger.Credential 'Ledger.Staking -> Maybe L.Coin
839+
:: Ledger.Credential Ledger.Staking -> Maybe L.Coin
840840
lookupDelegDeposit stakeCred =
841841
Map.lookup (fromShelleyStakeCredential stakeCred) stakeDelegDeposits
842842

843843
lookupDRepDeposit
844-
:: Ledger.Credential 'Ledger.DRepRole -> Maybe L.Coin
844+
:: Ledger.Credential Ledger.DRepRole -> Maybe L.Coin
845845
lookupDRepDeposit drepCred =
846846
Map.lookup drepCred drepDelegDeposits
847847

0 commit comments

Comments
 (0)