Skip to content

Commit

Permalink
Integrate for node 9.0
Browse files Browse the repository at this point in the history
Integrate consensus, ledger and api in preparation for node v9.0.0
  • Loading branch information
CarlosLopezDeLara committed Jul 2, 2024
1 parent e4c0f56 commit 0eaf0c1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2024-06-27T12:26:16Z
, cardano-haskell-packages 2024-06-27T12:26:16Z
, hackage.haskell.org 2024-06-23T23:01:13Z
, cardano-haskell-packages 2024-07-02T19:42:00Z

packages:
cardano-cli
Expand Down
6 changes: 3 additions & 3 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.49.0.0
, cardano-api ^>= 9.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down Expand Up @@ -234,9 +234,9 @@ library
, microlens
, network
, optparse-applicative-fork
, ouroboros-consensus ^>= 0.19
, ouroboros-consensus ^>= 0.20
-- TODO: bump consensus back
, ouroboros-consensus-cardano ^>= 0.17
, ouroboros-consensus-cardano ^>= 0.18
, ouroboros-consensus-protocol ^>= 0.9.0.1
, ouroboros-network-api ^>= 0.7.3
, ouroboros-network-protocols
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pTransactionBuildCmd era envCli = do
Nothing
"Filepath of auxiliary script(s)")
<*> many pMetadataFile
<*> pFeatured (shelleyBasedToCardanoEra sbe) (optional pUpdateProposalFile)
<*> pFeatured (toCardanoEra sbe) (optional pUpdateProposalFile)
<*> pVoteFiles sbe AutoBalance
<*> pProposalFiles sbe AutoBalance
<*> pTreasuryDonation sbe
Expand Down Expand Up @@ -235,7 +235,7 @@ pTransactionBuildEstimateCmd era _envCli = do
Nothing
"Filepath of auxiliary script(s)")
<*> many pMetadataFile
<*> pFeatured (shelleyBasedToCardanoEra sbe) (optional pUpdateProposalFile)
<*> pFeatured (toCardanoEra sbe) (optional pUpdateProposalFile)
<*> pVoteFiles sbe ManualBalance
<*> pProposalFiles sbe ManualBalance
<*> pCurrentTreasuryValue sbe
Expand Down
7 changes: 3 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ runQueryProtocolParametersCmd
, Cmd.mOutFile
} = do
let localNodeConnInfo = LocalNodeConnectInfo consensusModeParams networkId nodeSocketPath
AnyCardanoEra era <- firstExceptT QueryCmdAcquireFailure $ newExceptT $ determineEra localNodeConnInfo
AnyCardanoEra era <- firstExceptT QueryCmdAcquireFailure $ determineEra localNodeConnInfo
sbe <- forEraInEon @ShelleyBasedEra era (left QueryCmdByronEra) pure
let qInMode = QueryInEra $ QueryInShelleyBasedEra sbe Api.QueryProtocolParameters
pp <- firstExceptT QueryCmdConvenienceError
. newExceptT $ executeQueryAnyMode localNodeConnInfo qInMode
$ executeQueryAnyMode localNodeConnInfo qInMode
writeProtocolParameters sbe mOutFile pp
where
writeProtocolParameters
Expand Down Expand Up @@ -654,8 +654,7 @@ runQueryTxMempoolCmd

localQuery <- case query of
TxMempoolQueryTxExists tx -> do
AnyCardanoEra era <- lift (determineEra localNodeConnInfo)
& onLeft (left . QueryCmdAcquireFailure)
AnyCardanoEra era <- modifyError QueryCmdAcquireFailure (determineEra localNodeConnInfo)
pure $ LocalTxMonitoringQueryTx $ TxIdInMode era tx
TxMempoolQueryNextTx -> pure LocalTxMonitoringSendNextTx
TxMempoolQueryInfo -> pure LocalTxMonitoringMempoolInformation
Expand Down
8 changes: 4 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ runTransactionBuildCmd
, treasuryDonation
, buildOutputOptions
} = shelleyBasedEraConstraints eon $ do
let era = shelleyBasedToCardanoEra eon
let era = toCardanoEra eon

-- The user can specify an era prior to the era that the node is currently in.
-- We cannot use the user specified era to construct a query against a node because it may differ
Expand Down Expand Up @@ -766,7 +766,7 @@ runTxBuild

-- TODO: All functions should be parameterized by ShelleyBasedEra
-- as it's not possible to call this function with ByronEra
let era = shelleyBasedToCardanoEra sbe
let era = toCardanoEra sbe
inputsThatRequireWitnessing = [input | (input,_) <- inputsAndMaybeScriptWits]

let allReferenceInputs = getAllReferenceInputs
Expand Down Expand Up @@ -1078,7 +1078,7 @@ toTxAlonzoDatum supp cliDatum =
sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile
pure (TxOutDatumInTx supp sData)
TxOutInlineDatumByValue sDataOrFile -> do
let cEra = alonzoEraOnwardsToCardanoEra supp
let cEra = toCardanoEra supp
forEraInEon cEra (txFeatureMismatch cEra TxFeatureInlineDatums) $ \babbageOnwards -> do
sData <- firstExceptT TxCmdScriptDataError $ readScriptDataOrFile sDataOrFile
pure $ TxOutDatumInline babbageOnwards sData
Expand Down Expand Up @@ -1521,7 +1521,7 @@ runTransactionSignWitnessCmd
lift (readFileTxKeyWitness file) & onLeft (left . TxCmdCddlWitnessError)

case testEquality era era' of
Nothing -> left $ TxCmdWitnessEraMismatch (AnyCardanoEra $ shelleyBasedToCardanoEra era) (AnyCardanoEra $ shelleyBasedToCardanoEra era') witnessFile
Nothing -> left $ TxCmdWitnessEraMismatch (AnyCardanoEra $ toCardanoEra era) (AnyCardanoEra $ toCardanoEra era') witnessFile
Just Refl -> return witness
| witnessFile@(WitnessFile file) <- witnessFiles ]

Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ runLegacyTransactionBuildCmd
outputOptions = do

mUpdateProposalFile <-
validateUpdateProposalFile (shelleyBasedToCardanoEra sbe) mUpdateProposal
validateUpdateProposalFile (toCardanoEra sbe) mUpdateProposal
& hoistEither
& firstExceptT TxCmdNotSupportedInEraValidationError

Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

0 comments on commit 0eaf0c1

Please sign in to comment.