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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project: cardano-api
pr: 1187
kind:
- maintenance
description: |
Unify Dijkstra-era placeholder `error` messages and `TODO` comments under a single greppable token `TODO Dijkstra:`, so `grep -r 'TODO Dijkstra'` finds every Dijkstra-era placeholder in one shot. No behaviour change.
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/Certificate/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ getAnchorDataFromCertificate c =
Ledger.RetirePoolTxCert _ _ -> return Nothing
Ledger.GenesisDelegTxCert{} -> return Nothing
Ledger.MirTxCert _ -> return Nothing
_ -> error "getAnchorDataFromCertificate: Dijkstra era not supported"
_ -> error "TODO Dijkstra: getAnchorDataFromCertificate: era not supported"
ConwayCertificate ceo ccert ->
conwayEraOnwardsConstraints ceo $
case ccert of
Expand All @@ -843,7 +843,7 @@ getAnchorDataFromCertificate c =
Ledger.UpdateDRepTxCert _ mAnchor -> return $ Ledger.strictMaybeToMaybe mAnchor
Ledger.AuthCommitteeHotKeyTxCert _ _ -> return Nothing
Ledger.ResignCommitteeColdTxCert _ mAnchor -> return $ Ledger.strictMaybeToMaybe mAnchor
_ -> error "getAnchorDataFromCertificate: Dijkstra era not supported"
_ -> error "TODO Dijkstra: getAnchorDataFromCertificate: era not supported"
where
anchorDataFromPoolMetadata
:: MonadError AnchorDataFromCertificateError m
Expand Down
14 changes: 7 additions & 7 deletions cardano-api/src/Cardano/Api/Era/Internal/Case.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ caseByronOrShelleyBasedEra l r = \case
AlonzoEra -> r ShelleyBasedEraAlonzo
BabbageEra -> r ShelleyBasedEraBabbage
ConwayEra -> r ShelleyBasedEraConway
DijkstraEra -> error "caseByronOrShelleyBasedEra: DijkstraEra is not supported"
DijkstraEra -> error "TODO Dijkstra: caseByronOrShelleyBasedEra: era not supported"

-- | @caseByronToAlonzoOrBabbageEraOnwards f g era@ applies @f@ to byron, shelley, allegra, mary, and alonzo;
-- and @g@ to babbage and later eras.
Expand All @@ -70,7 +70,7 @@ caseByronToAlonzoOrBabbageEraOnwards l r = \case
AlonzoEra -> l ByronToAlonzoEraAlonzo
BabbageEra -> r BabbageEraOnwardsBabbage
ConwayEra -> r BabbageEraOnwardsConway
DijkstraEra -> error "caseByronToAlonzoOrBabbageEraOnwards: DijkstraEra is not supported"
DijkstraEra -> error "TODO Dijkstra: caseByronToAlonzoOrBabbageEraOnwards: era not supported"

-- | @caseShelleyEraOnlyOrAllegraEraOnwards f g era@ applies @f@ to shelley;
-- and applies @g@ to allegra and later eras.
Expand All @@ -87,7 +87,7 @@ caseShelleyEraOnlyOrAllegraEraOnwards l r = \case
ShelleyBasedEraAlonzo -> r AllegraEraOnwardsAlonzo
ShelleyBasedEraBabbage -> r AllegraEraOnwardsBabbage
ShelleyBasedEraConway -> r AllegraEraOnwardsConway
ShelleyBasedEraDijkstra -> error "caseShelleyEraOnlyOrAllegraEraOnwards: DijkstraEra is not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: caseShelleyEraOnlyOrAllegraEraOnwards: era not supported"

-- | @caseShelleyToAllegraOrMaryEraOnwards f g era@ applies @f@ to shelley and allegra;
-- and applies @g@ to mary and later eras.
Expand All @@ -104,7 +104,7 @@ caseShelleyToAllegraOrMaryEraOnwards l r = \case
ShelleyBasedEraAlonzo -> r MaryEraOnwardsAlonzo
ShelleyBasedEraBabbage -> r MaryEraOnwardsBabbage
ShelleyBasedEraConway -> r MaryEraOnwardsConway
ShelleyBasedEraDijkstra -> error "caseShelleyToAllegraOrMaryEraOnwards: DijkstraEra is not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: caseShelleyToAllegraOrMaryEraOnwards: era not supported"

-- | @caseShelleyToMaryOrAlonzoEraOnwards f g era@ applies @f@ to shelley, allegra, and mary;
-- and applies @g@ to alonzo and later eras.
Expand All @@ -121,7 +121,7 @@ caseShelleyToMaryOrAlonzoEraOnwards l r = \case
ShelleyBasedEraAlonzo -> r AlonzoEraOnwardsAlonzo
ShelleyBasedEraBabbage -> r AlonzoEraOnwardsBabbage
ShelleyBasedEraConway -> r AlonzoEraOnwardsConway
ShelleyBasedEraDijkstra -> error "caseShelleyToMaryOrAlonzoEraOnwards: DijkstraEra is not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: caseShelleyToMaryOrAlonzoEraOnwards: era not supported"

-- | @caseShelleyToAlonzoOrBabbageEraOnwards f g era@ applies @f@ to shelley, allegra, mary, and alonzo;
-- and applies @g@ to babbage and later eras.
Expand All @@ -138,7 +138,7 @@ caseShelleyToAlonzoOrBabbageEraOnwards l r = \case
ShelleyBasedEraAlonzo -> l ShelleyToAlonzoEraAlonzo
ShelleyBasedEraBabbage -> r BabbageEraOnwardsBabbage
ShelleyBasedEraConway -> r BabbageEraOnwardsConway
ShelleyBasedEraDijkstra -> error "caseShelleyToAlonzoOrBabbageEraOnwards: DijkstraEra is not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: caseShelleyToAlonzoOrBabbageEraOnwards: era not supported"

-- | @caseShelleyToBabbageOrConwayEraOnwards f g era@ applies @f@ to eras before conway;
-- and applies @g@ to conway and later eras.
Expand All @@ -155,7 +155,7 @@ caseShelleyToBabbageOrConwayEraOnwards l r = \case
ShelleyBasedEraAlonzo -> l ShelleyToBabbageEraAlonzo
ShelleyBasedEraBabbage -> l ShelleyToBabbageEraBabbage
ShelleyBasedEraConway -> r ConwayEraOnwardsConway
ShelleyBasedEraDijkstra -> error "caseShelleyToBabbageOrConwayEraOnwards: DijkstraEra is not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: caseShelleyToBabbageOrConwayEraOnwards: era not supported"

{-# DEPRECATED shelleyToAlonzoEraToShelleyToBabbageEra "Use convert instead" #-}
shelleyToAlonzoEraToShelleyToBabbageEra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ allegraEraOnwardsConstraints = \case
AllegraEraOnwardsAlonzo -> id
AllegraEraOnwardsBabbage -> id
AllegraEraOnwardsConway -> id
_ -> const $ error "allegraEraOnwardsConstraints: Dijkstra era not supported"
_ -> const $ error "TODO Dijkstra: allegraEraOnwardsConstraints: era not supported"

{-# DEPRECATED allegraEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
allegraEraOnwardsToShelleyBasedEra :: AllegraEraOnwards era -> ShelleyBasedEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ babbageEraOnwardsConstraints
babbageEraOnwardsConstraints = \case
BabbageEraOnwardsBabbage -> id
BabbageEraOnwardsConway -> id
BabbageEraOnwardsDijkstra -> const $ error "babbageEraOnwardsConstraints: DijkstraEra is currently not supported"
BabbageEraOnwardsDijkstra -> const $ error "TODO Dijkstra: babbageEraOnwardsConstraints: era not supported"

{-# DEPRECATED babbageEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
babbageEraOnwardsToShelleyBasedEra :: BabbageEraOnwards era -> ShelleyBasedEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ conwayEraOnwardsConstraints
-> a
conwayEraOnwardsConstraints = \case
ConwayEraOnwardsConway -> id
_ -> const $ error "conwayEraOnwardsConstraints: Dijkstra era is not yet supported"
_ -> const $ error "TODO Dijkstra: conwayEraOnwardsConstraints: era not supported"

{-# DEPRECATED conwayEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
conwayEraOnwardsToShelleyBasedEra :: ConwayEraOnwards era -> ShelleyBasedEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ maryEraOnwardsConstraints = \case
MaryEraOnwardsAlonzo -> id
MaryEraOnwardsBabbage -> id
MaryEraOnwardsConway -> id
MaryEraOnwardsDijkstra -> const $ error "maryEraOnwardsConstraints: Dijkstra era is not yet supported"
MaryEraOnwardsDijkstra -> const $ error "TODO Dijkstra: maryEraOnwardsConstraints: era not supported"

{-# DEPRECATED maryEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-}
maryEraOnwardsToShelleyBasedEra :: MaryEraOnwards era -> ShelleyBasedEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ shelleyBasedEraConstraints = \case
ShelleyBasedEraAlonzo -> id
ShelleyBasedEraBabbage -> id
ShelleyBasedEraConway -> id
ShelleyBasedEraDijkstra -> const $ error "shelleyBasedEraConstraints: Dijkstra is not yet supported"
ShelleyBasedEraDijkstra -> const $ error "TODO Dijkstra: shelleyBasedEraConstraints: era not supported"

data AnyShelleyBasedEra where
AnyShelleyBasedEra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ getPlutusDatum
getPlutusDatum L.SPlutusV1 (SpendingScriptDatum d) = Just d
getPlutusDatum L.SPlutusV2 (SpendingScriptDatum d) = Just d
getPlutusDatum L.SPlutusV3 (SpendingScriptDatum d) = d
getPlutusDatum L.SPlutusV4 (SpendingScriptDatum _d) = error "getPlutusDatum: Dijkstra era not supported"
getPlutusDatum L.SPlutusV4 (SpendingScriptDatum _d) = error "TODO Dijkstra: getPlutusDatum: era not supported"
getPlutusDatum _ InlineDatum = Nothing
getPlutusDatum _ NoScriptDatum = Nothing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ makeUnsignedTx
. Era era
-> TxBodyContent (LedgerEra era)
-> Either MakeUnsignedTxError (UnsignedTx (LedgerEra era))
makeUnsignedTx DijkstraEra _ = error "makeUnsignedTx: Dijkstra era not supported yet"
makeUnsignedTx DijkstraEra _ = error "TODO Dijkstra: makeUnsignedTx: era not supported"
makeUnsignedTx era@ConwayEra bc = obtainCommonConstraints era $ do
let TxScriptWitnessRequirements languages scripts datums redeemers = collectTxBodyScriptWitnessRequirements bc

Expand Down Expand Up @@ -846,7 +846,7 @@ extractWitnessableVotes
extractWitnessableVotes Nothing = []
extractWitnessableVotes (Just txVoteProc) =
case useEra @era of
DijkstraEra -> error "extractWitnessableVotes: Dijkstra era not supported"
DijkstraEra -> error "TODO Dijkstra: extractWitnessableVotes: era not supported"
ConwayEra ->
List.nub
[ (WitVote vote, wit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ makeStakeAddressDelegationCertificate sCred delegatee =
e@ShelleyBasedEraMary -> cert e delegatee
e@ShelleyBasedEraAllegra -> cert e delegatee
e@ShelleyBasedEraShelley -> cert e delegatee
ShelleyBasedEraDijkstra -> error "makeStakeAddressDelegationCertificate: Dijkstra era not supported"
ShelleyBasedEraDijkstra -> error "TODO Dijkstra: makeStakeAddressDelegationCertificate: era not supported"
where
cert
:: Delegatee era ~ Api.Hash Api.StakePoolKey
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Fee.hs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ estimateBalancedTxBody'
obtainCommonConstraints (useEra @era) $
TxOut (L.mkBasicTxOut (toShelleyAddr changeaddr) balance)
case useEra @era of
DijkstraEra -> error "estimateBalancedTxBody: DijkstraEra is not supported for fee estimation"
DijkstraEra -> error "TODO Dijkstra: estimateBalancedTxBody: era not supported for fee estimation"
ConwayEra -> do
when (coinBalance < 0) $
Left $
Expand Down Expand Up @@ -1542,7 +1542,7 @@ makeTransactionBodyAutoBalance
}

case useEra @era of
DijkstraEra -> error "makeTransactionBodyAutoBalance: DijkstraEra not supported"
DijkstraEra -> error "TODO Dijkstra: makeTransactionBodyAutoBalance: era not supported"
ConwayEra -> do
let balance :: L.MaryValue = evaluateTransactionBalance pp poolids stakeDelegDeposits drepDelegDeposits utxo txbody2
adaBalance = getAda (useEra @era) balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ deriving newtype instance ToJSON (Babbage.ApplyTxError Consensus.BabbageEra)

deriving newtype instance ToJSON (Conway.ApplyTxError Consensus.ConwayEra)

-- TODO: fix this instance when the Dijkstra era is stable in Ledger
-- TODO Dijkstra: fix this ToJSON instance when the era is stable in Ledger
instance ToJSON (Dijkstra.ApplyTxError Consensus.DijkstraEra) where
toJSON = error "Dijkstra era is not active yet"
toJSON = error "TODO Dijkstra: toJSON @(ApplyTxError DijkstraEra): era not active"

deriving via
ShowOf (L.Keys.VKey L.Keys.Witness)
Expand Down
6 changes: 3 additions & 3 deletions cardano-api/src/Cardano/Api/LedgerState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ instance FromJSON NodeConfig where
<*> parseAlonzoHardForkEpoch o
<*> parseBabbageHardForkEpoch o
<*> parseConwayHardForkEpoch o
<*> pure Consensus.CardanoTriggerHardForkAtDefaultVersion -- TODO: Dijkstra
<*> pure Consensus.CardanoTriggerHardForkAtDefaultVersion -- TODO Dijkstra
parseShelleyHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk)
parseShelleyHardForkEpoch o =
asum
Expand Down Expand Up @@ -1511,8 +1511,8 @@ readCardanoGenesisConfig enc = do
ShelleyConfig shelleyGenesis shelleyGenesisHash <- readShelleyGenesisConfig enc
alonzoGenesis <- readAlonzoGenesisConfig enc
conwayGenesis <- readConwayGenesisConfig enc
-- TODO: Build dummy dijkstra genesis value
let dijkstraGenesis = exampleDijkstraGenesis -- TODO: Dijkstra - add plumbing to read Dijkstra genesis
-- TODO Dijkstra: build real genesis value
let dijkstraGenesis = exampleDijkstraGenesis -- TODO Dijkstra: add plumbing to read genesis
let transCfg = Ledger.mkLatestTransitionConfig shelleyGenesis alonzoGenesis conwayGenesis dijkstraGenesis
pure $ GenesisCardano enc byronGenesis shelleyGenesisHash transCfg

Expand Down
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ fromShelleyMultiSig = go
go (Shelley.RequireAllOf s) = RequireAllOf (map go $ toList s)
go (Shelley.RequireAnyOf s) = RequireAnyOf (map go $ toList s)
go (Shelley.RequireMOf m s) = RequireMOf m (map go $ toList s)
go _ = error "fromShelleyMultiSig: Dijkstra era not supported"
go _ = error "TODO Dijkstra: fromShelleyMultiSig: era not supported"

-- | Conversion for the 'Timelock.Timelock' language that is shared between the
-- Allegra and Mary eras.
Expand Down Expand Up @@ -1460,7 +1460,7 @@ fromAllegraTimelock = go
go (Shelley.RequireAllOf s) = RequireAllOf (map go (toList s))
go (Shelley.RequireAnyOf s) = RequireAnyOf (map go (toList s))
go (Shelley.RequireMOf i s) = RequireMOf i (map go (toList s))
go _ = error "fromAllegraTimelock: Dijkstra era not supported"
go _ = error "TODO Dijkstra: fromAllegraTimelock: era not supported"

type family ToLedgerPlutusLanguage lang where
ToLedgerPlutusLanguage PlutusScriptV1 = Plutus.PlutusV1
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/Tx/Internal/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ makeShelleyTransactionBody

txAuxData :: Maybe (L.TxAuxData E.ConwayEra)
txAuxData = toAuxiliaryData sbe txMetadata txAuxScripts
makeShelleyTransactionBody ShelleyBasedEraDijkstra _ = error "makeShelleyTransactionBody: Dijkstra era not supported"
makeShelleyTransactionBody ShelleyBasedEraDijkstra _ = error "TODO Dijkstra: makeShelleyTransactionBody: era not supported"

-- ----------------------------------------------------------------------------
-- Script witnesses within the tx body
Expand Down Expand Up @@ -3104,7 +3104,7 @@ extractWitnessableVotes
:: ConwayEraOnwards era
-> Maybe (Featured eon era (TxVotingProcedures BuildTx era))
-> [(Witnessable VoterItem (ShelleyLedgerEra era), BuildTxWith BuildTx (Witness WitCtxStake era))]
extractWitnessableVotes ConwayEraOnwardsDijkstra _ = error "extractWitnessableVotes: Dijkstra era not supported"
extractWitnessableVotes ConwayEraOnwardsDijkstra _ = error "TODO Dijkstra: extractWitnessableVotes: era not supported"
extractWitnessableVotes e@ConwayEraOnwardsConway txVotingProcedures =
List.nub
[ (conwayEraOnwardsConstraints e $ WitVote vote, BuildTxWith wit)
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Tx/Internal/Body/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ reqSignerHashesTxBodyL
reqSignerHashesTxBodyL w@AlonzoEraOnwardsAlonzo = alonzoEraOnwardsConstraints w $ txBodyL . L.reqSignerHashesTxBodyL
reqSignerHashesTxBodyL w@AlonzoEraOnwardsBabbage = alonzoEraOnwardsConstraints w $ txBodyL . L.reqSignerHashesTxBodyL
reqSignerHashesTxBodyL w@AlonzoEraOnwardsConway = alonzoEraOnwardsConstraints w $ txBodyL . L.reqSignerHashesTxBodyL
reqSignerHashesTxBodyL AlonzoEraOnwardsDijkstra = error "reqSignerHashesTxBodyL: DijkstraEra not supported yet"
reqSignerHashesTxBodyL AlonzoEraOnwardsDijkstra = error "TODO Dijkstra: reqSignerHashesTxBodyL: era not supported"

referenceInputsTxBodyL
:: BabbageEraOnwards era -> Lens' (LedgerTxBody era) (Set L.TxIn)
Expand Down
Loading