Skip to content

Commit

Permalink
Integrate cardano-api 8.30
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Nov 3, 2023
1 parent 6302a7e commit ef144e0
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 199 deletions.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2023-08-08T19:56:09Z
, cardano-haskell-packages 2023-10-27T12:25:48Z
, cardano-haskell-packages 2023-11-03T08:46:06Z

packages:
cardano-cli
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.29.0.0
, cardano-api ^>= 8.30.0.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Byron/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ runSubmitTx nodeSocketPath network fp = do
runGetTxId :: TxFile In -> ExceptT ByronClientCmdError IO ()
runGetTxId fp = firstExceptT ByronCmdTxError $ do
tx <- readByronTx fp
let txbody = getTxBody (ByronTx tx)
let txbody = getTxBody (ByronTx ByronEraOnlyByron tx)
txid = getTxId txbody
liftIO $ BS.putStrLn $ serialiseToRawBytesHex txid

Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/Byron/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ nodeSubmitTx nodeSocketPath network gentx = do
localNodeNetworkId = network,
localConsensusModeParams = CardanoModeParams (EpochSlots 21600)
}
res <- liftIO $ submitTxToNodeLocal connctInfo (TxInByronSpecial gentx ByronEraInCardanoMode)
res <- liftIO $ submitTxToNodeLocal connctInfo (TxInByronSpecial ByronEraOnlyByron gentx)
case res of
Net.Tx.SubmitSuccess -> liftIO $ Text.putStrLn "Transaction successfully submitted."
Net.Tx.SubmitFail reason ->
case reason of
TxValidationErrorInMode err _eraInMode -> left . ByronTxSubmitError . Text.pack $ show err
TxValidationErrorInCardanoMode err -> left . ByronTxSubmitError . Text.pack $ show err
TxValidationEraMismatch mismatchErr -> left $ ByronTxSubmitErrorEraMismatch mismatchErr

return ()
Expand Down
38 changes: 19 additions & 19 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ data QueryCmds era

data QueryLeadershipScheduleCmdArgs = QueryLeadershipScheduleCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, genesisFp :: !GenesisFile
, poolColdVerKeyFile :: !(VerificationKeyOrHashOrFile StakePoolKey)
Expand All @@ -72,95 +72,95 @@ data QueryLeadershipScheduleCmdArgs = QueryLeadershipScheduleCmdArgs

data QueryProtocolParametersCmdArgs = QueryProtocolParametersCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryConstitutionHashCmdArgs = QueryConstitutionHashCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryTipCmdArgs = QueryTipCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryStakePoolsCmdArgs = QueryStakePoolsCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryStakeDistributionCmdArgs = QueryStakeDistributionCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryStakeAddressInfoCmdArgs = QueryStakeAddressInfoCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, addr :: !StakeAddress
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryUTxOCmdArgs = QueryUTxOCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, queryFilter :: !QueryUTxOFilter
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryLedgerStateCmdArgs = QueryLedgerStateCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryProtocolStateCmdArgs = QueryProtocolStateCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryStakeSnapshotCmdArgs = QueryStakeSnapshotCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, allOrOnlyPoolIds :: !(AllOrOnly [Hash StakePoolKey])
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryKesPeriodInfoCmdArgs = QueryKesPeriodInfoCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, nodeOpCertFp :: !(File () In) -- ^ Node operational certificate
, mOutFile :: !(Maybe (File () Out))
} deriving (Generic, Show)

data QueryPoolStateCmdArgs = QueryPoolStateCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, poolIds :: ![Hash StakePoolKey]
} deriving (Generic, Show)

data QueryTxMempoolCmdArgs = QueryTxMempoolCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, query :: !TxMempoolQuery
, mOutFile :: !(Maybe (File () Out))
Expand All @@ -169,23 +169,23 @@ data QueryTxMempoolCmdArgs = QueryTxMempoolCmdArgs

data QuerySlotNumberCmdArgs = QuerySlotNumberCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, utcTime :: !UTCTime
} deriving (Generic, Show)

data QueryNoArgCmdArgs era = QueryNoArgCmdArgs
{ eon :: !(ConwayEraOnwards era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mOutFile :: !(Maybe (File () Out))
} deriving Show

data QueryDRepStateCmdArgs era = QueryDRepStateCmdArgs
{ eon :: !(ConwayEraOnwards era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, drepKeys :: ![VerificationKeyOrHashOrFile DRepKey]
, mOutFile :: !(Maybe (File () Out))
Expand All @@ -194,7 +194,7 @@ data QueryDRepStateCmdArgs era = QueryDRepStateCmdArgs
data QueryDRepStakeDistributionCmdArgs era = QueryDRepStakeDistributionCmdArgs
{ eon :: !(ConwayEraOnwards era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, drepKeys :: ![VerificationKeyOrHashOrFile DRepKey]
, mOutFile :: !(Maybe (File () Out))
Expand All @@ -203,7 +203,7 @@ data QueryDRepStakeDistributionCmdArgs era = QueryDRepStakeDistributionCmdArgs
data QueryCommitteeMembersStateCmdArgs era = QueryCommitteeMembersStateCmdArgs
{ eon :: !(ConwayEraOnwards era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, committeeColdKeys :: ![VerificationKeyOrHashOrFile CommitteeColdKey]
, committeeHotKeys :: ![VerificationKeyOrHashOrFile CommitteeHotKey]
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ data TransactionBuildRawCmdArgs era = TransactionBuildRawCmdArgs
data TransactionBuildCmdArgs era = TransactionBuildCmdArgs
{ eon :: !(ShelleyBasedEra era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, mScriptValidity :: !(Maybe ScriptValidity)
-- ^ Mark script as expected to pass or fail validation
Expand Down Expand Up @@ -148,7 +148,7 @@ data TransactionSignWitnessCmdArgs = TransactionSignWitnessCmdArgs

data TransactionSubmitCmdArgs = TransactionSubmitCmdArgs
{ nodeSocketPath :: !SocketPath
, consensusModeParams :: !(ConsensusModeParams CardanoMode)
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, txFile :: !FilePath
} deriving Show
Expand Down
6 changes: 3 additions & 3 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ toUnitIntervalOrErr r = case Ledger.boundRational r of
]
Just n -> n

pConsensusModeParams :: Parser (ConsensusModeParams CardanoMode)
pConsensusModeParams :: Parser ConsensusModeParams
pConsensusModeParams = asum
[ pCardanoMode *> pCardanoConsensusMode
, pDefaultConsensusMode
Expand All @@ -122,10 +122,10 @@ pConsensusModeParams = asum
, Opt.help "For talking to a node running in full Cardano mode (default)."
]

pCardanoConsensusMode :: Parser (ConsensusModeParams CardanoMode)
pCardanoConsensusMode :: Parser ConsensusModeParams
pCardanoConsensusMode = CardanoModeParams <$> pEpochSlots

pDefaultConsensusMode :: Parser (ConsensusModeParams CardanoMode)
pDefaultConsensusMode :: Parser ConsensusModeParams
pDefaultConsensusMode =
pure . CardanoModeParams $ EpochSlots defaultByronEpochSlots

Expand Down
Loading

0 comments on commit ef144e0

Please sign in to comment.