Skip to content

Commit f18e5cb

Browse files
committed
Fix most compilation errors
1 parent 7ae44e9 commit f18e5cb

File tree

11 files changed

+32
-27
lines changed

11 files changed

+32
-27
lines changed

cardano-api/cardano-api.cabal

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ library
131131
cardano-ledger-byron >=1.2,
132132
cardano-ledger-conway >=1.19,
133133
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
134-
cardano-ledger-dijkstra >=0.1,
134+
cardano-ledger-dijkstra:{cardano-ledger-dijkstra, testlib} >=0.1,
135135
cardano-ledger-mary >=1.8,
136-
cardano-ledger-shelley >=1.16,
136+
cardano-ledger-shelley:{cardano-ledger-shelley, testlib} >=1.16,
137137
cardano-protocol-tpraos >=1.4,
138138
cardano-slotting >=0.2.0.0,
139139
cardano-strict-containers >=0.1,
@@ -348,6 +348,7 @@ test-suite cardano-api-test
348348
cardano-ledger-conway,
349349
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
350350
cardano-ledger-mary,
351+
cardano-ledger-api >=1.11,
351352
cardano-protocol-tpraos,
352353
cardano-slotting,
353354
cborg,
@@ -419,6 +420,7 @@ test-suite cardano-api-golden
419420
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
420421
cardano-ledger-shelley,
421422
cardano-ledger-shelley-test >=1.2.0.1,
423+
cardano-ledger-api >=1.11,
422424
cardano-protocol-tpraos,
423425
containers,
424426
errors,

cardano-api/src/Cardano/Api/Consensus/Internal/InMode.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,3 @@ fromConsensusApplyTxErr = \case
317317
TxValidationErrorInCardanoMode $ ShelleyTxValidationError ShelleyBasedEraDijkstra err
318318
Consensus.ApplyTxErrWrongEra err ->
319319
TxValidationEraMismatch err
320-
_ -> undefined

cardano-api/src/Cardano/Api/Experimental/Tx.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ newtype UnsignedTxError
214214
= UnsignedTxError TxBodyError
215215

216216
makeUnsignedTx
217-
:: Era era
217+
:: Ledger.ProtVerAtMost (LedgerEra era) 11
218+
=> Era era
218219
-> TxBodyContent BuildTx era
219220
-> Either TxBodyError (UnsignedTx era)
220221
makeUnsignedTx era bc = obtainCommonConstraints era $ do

cardano-api/src/Cardano/Api/Experimental/Tx/Internal/AnyWitness.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,4 @@ getPlutusDatum L.SPlutusV3 (SpendingScriptDatum d) = d
185185
getPlutusDatum L.SPlutusV4 (SpendingScriptDatum _d) = error "dijkstra"
186186
getPlutusDatum _ InlineDatum = Nothing
187187
getPlutusDatum _ NoScriptDatum = Nothing
188-
getPlutusDatum _ _ = undefined
189188

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ decodeAlonzoGenesis (Just era) genesisBs = modifyError ("Cannot decode era-sensi
312312
-- use all available parameters >= conway
313313
| isConwayOnwards = length allCostModelParams
314314
-- use only required params in < conway
315-
| otherwise = L.costModelParamsCount L.PlutusV2 -- Babbage
315+
| otherwise = L.costModelInitParamCount L.PlutusV2 -- Babbage
316316

317317
-- A list-like of tuples (param name, value) with default maxBound value
318318
optionalCostModelDefaultValues :: (Item l ~ (V2.ParamName, Int64), IsList l) => l

cardano-api/src/Cardano/Api/Internal/Orphans/Serialisation.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,22 @@ deriving anyclass instance
195195
ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
196196
=> ToJSON (L.ShelleyPpupPredFailure ledgerera)
197197

198-
deriving anyclass instance
198+
instance
199199
( ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
200200
, ToJSON (L.PlutusPurpose L.AsItem ledgerera)
201201
, ToJSON (L.PlutusPurpose L.AsIx ledgerera)
202202
)
203-
=> ToJSON (L.AlonzoUtxowPredFailure ledgerera)
203+
=> ToJSON (L.AlonzoUtxowPredFailure ledgerera) where
204+
toJSON = undefined
204205

205-
deriving anyclass instance
206+
instance
206207
( ToJSON (L.PredicateFailure (L.EraRule "UTXO" ledgerera))
207208
, ToJSON (L.TxCert ledgerera)
208209
, ToJSON (L.PlutusPurpose L.AsItem ledgerera)
209210
, ToJSON (L.PlutusPurpose L.AsIx ledgerera)
210211
)
211-
=> ToJSON (L.BabbageUtxowPredFailure ledgerera)
212+
=> ToJSON (L.BabbageUtxowPredFailure ledgerera) where
213+
toJSON = undefined
212214

213215
deriving anyclass instance
214216
ToJSON (L.PredicateFailure (L.EraRule "LEDGER" ledgerera))

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ import Network.Mux qualified as Mux
263263
import Network.TypedProtocol.Core (Nat (..))
264264
import System.FilePath
265265

266-
import Test.Cardano.Ledger.Api.Examples.Consensus.Dijkstra
266+
import Test.Cardano.Ledger.Dijkstra.Examples qualified as Dijkstra
267+
import Test.Cardano.Ledger.Shelley.Examples qualified as Shelley
267268

268269
data InitialLedgerStateError
269270
= -- | Failed to read or parse the network config file.
@@ -1401,12 +1402,8 @@ decodeLedgerState = do
14011402
2 <- CBOR.decodeListLen
14021403
hst <-
14031404
HFC.HardForkLedgerState
1404-
<<<<<<< HEAD
14051405
<$> HFC.decodeTelescope
14061406
(byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* dijkstra :* Nil)
1407-
=======
1408-
<$> HFC.decodeTelescope (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* undefined :* Nil)
1409-
>>>>>>> origin/fraser-iohk/cardano-api-kes-agent
14101407
tbs <- Ledger.valuesMKDecoder hst
14111408
pure (LedgerState hst tbs)
14121409
where
@@ -1503,7 +1500,7 @@ readCardanoGenesisConfig mEra enc = do
15031500
ShelleyConfig shelleyGenesis shelleyGenesisHash <- readShelleyGenesisConfig enc
15041501
alonzoGenesis <- readAlonzoGenesisConfig mEra enc
15051502
conwayGenesis <- readConwayGenesisConfig enc
1506-
let dijkstraGenesis = exampleDijkstraGenesis -- TODO: Dijkstra - add plumbing to read Dijkstra genesis
1503+
let dijkstraGenesis = Shelley.leTranslationContext Dijkstra.ledgerExamples -- TODO: Dijkstra - add plumbing to read Dijkstra genesis
15071504
let transCfg = Ledger.mkLatestTransitionConfig shelleyGenesis alonzoGenesis conwayGenesis dijkstraGenesis
15081505
pure $ GenesisCardano enc byronGenesis shelleyGenesisHash transCfg
15091506

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ module Cardano.Api.Query.Internal.Convenience
2020
)
2121
where
2222

23+
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch (..))
24+
25+
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..))
26+
2327
import Cardano.Api.Address
2428
import Cardano.Api.Certificate.Internal
2529
import Cardano.Api.Consensus.Internal.Mode
@@ -49,6 +53,7 @@ import Data.Maybe (mapMaybe)
4953
import Data.Set (Set)
5054
import Data.Text (Text)
5155
import GHC.Exts (IsList (..), IsString (..))
56+
import Control.Exception (SomeException, displayException)
5257

5358
data QueryConvenienceError
5459
= AcqFailure AcquiringFailure
@@ -109,7 +114,7 @@ queryStateForBalancedTx
109114
, SystemStart
110115
, Set PoolId
111116
, Map StakeCredential L.Coin
112-
, Map (L.Credential L.DRepRole) L.Coin
117+
, Map (L.Credential L.DRepRole) (L.CompactForm L.Coin)
113118
, Maybe (Featured ConwayEraOnwards era TxCurrentTreasuryValue)
114119
)
115120
)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ import Data.Text qualified as Text
139139
import Data.Word (Word64)
140140
import GHC.Exts (IsList (..))
141141
import GHC.Stack
142-
import Data.Coerce (coerce)
143142

144143
-- ----------------------------------------------------------------------------
145144
-- Queries
@@ -648,7 +647,7 @@ toConsensusQueryShelleyBased sbe = \case
648647
caseShelleyToBabbageOrConwayEraOnwards
649648
(const $ error "toConsensusQueryShelleyBased: QueryDRepState is only available in the Conway era")
650649
( \w ->
651-
Some (consensusQueryInEraInMode era (conwayEraOnwardsConstraints w $ Consensus.GetDRepState creds))
650+
Some (consensusQueryInEraInMode era (conwayEraOnwardsConstraints w $ Consensus.GetDRepState _creds))
652651
)
653652
sbe
654653
QueryDRepStakeDistr dreps ->
@@ -937,7 +936,7 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' =
937936
Consensus.GetStakePoolParams{} ->
938937
Map.map fromShelleyPoolParams
939938
. Map.mapKeysMonotonic StakePoolKeyHash
940-
$ r'
939+
$ undefined -- r'
941940
_ -> fromConsensusQueryResultMismatch
942941
QueryDebugLedgerState{} ->
943942
case q' of

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ import Cardano.Crypto.Hashing qualified as Byron
272272
import Cardano.Ledger.Allegra.Core qualified as L
273273
import Cardano.Ledger.Alonzo.Core qualified as L
274274
import Cardano.Ledger.Alonzo.Scripts qualified as Alonzo
275-
import Cardano.Ledger.Alonzo.Tx qualified as Alonzo (hashScriptIntegrity)
275+
-- import Cardano.Ledger.Alonzo.Tx qualified as Alonzo (hashScriptIntegrity)
276276
import Cardano.Ledger.Alonzo.TxWits qualified as Alonzo
277277
import Cardano.Ledger.Api qualified as L
278278
import Cardano.Ledger.Babbage.UTxO qualified as L
@@ -1739,14 +1739,14 @@ fromLedgerTxExtraKeyWitnesses sbe body =
17391739
caseShelleyToMaryOrAlonzoEraOnwards
17401740
(const TxExtraKeyWitnessesNone)
17411741
( \w ->
1742-
let keyhashes = body ^. L.reqSignerHashesTxBodyL
1742+
let keyhashes = body ^. L.reqSignerHashesTxBodyG
17431743
in if Set.null keyhashes
17441744
then TxExtraKeyWitnessesNone
17451745
else
17461746
TxExtraKeyWitnesses
17471747
w
17481748
[ PaymentKeyHash (Shelley.coerceKeyRole keyhash)
1749-
| keyhash <- toList $ body ^. L.reqSignerHashesTxBodyL
1749+
| keyhash <- toList $ body ^. L.reqSignerHashesTxBodyG
17501750
]
17511751
)
17521752
sbe
@@ -1981,12 +1981,13 @@ convPParamsToScriptIntegrityHash
19811981
-> Alonzo.TxDats (ShelleyLedgerEra era)
19821982
-> Set Plutus.Language
19831983
-> StrictMaybe L.ScriptIntegrityHash
1984-
convPParamsToScriptIntegrityHash w (BuildTxWith mTxProtocolParams) redeemers datums languages =
1984+
convPParamsToScriptIntegrityHash w (BuildTxWith mTxProtocolParams) _ _ _ = -- redeemers datums languages =
19851985
alonzoEraOnwardsConstraints w $
19861986
case mTxProtocolParams of
19871987
Nothing -> SNothing
1988-
Just (LedgerProtocolParameters pp) ->
1989-
Alonzo.hashScriptIntegrity (Set.map (L.getLanguageView pp) languages) redeemers datums
1988+
Just (LedgerProtocolParameters _) -> undefined
1989+
-- Just (LedgerProtocolParameters pp) ->
1990+
-- Alonzo.hashScriptIntegrity (Set.map (L.getLanguageView pp) languages) redeemers datums
19901991

19911992
convLanguages :: [(ScriptWitnessIndex, AnyScriptWitness era)] -> Set Plutus.Language
19921993
convLanguages witnesses =

0 commit comments

Comments
 (0)