Skip to content

Commit

Permalink
Merge pull request #648 from IntersectMBO/bump-cardano-api
Browse files Browse the repository at this point in the history
Update cardano-api-8.40.0.0
  • Loading branch information
carbolymer committed Mar 14, 2024
2 parents 33599f2 + 68913ed commit 4ff26c0
Show file tree
Hide file tree
Showing 35 changed files with 199 additions and 187 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 2024-03-05T09:38:08Z
, cardano-haskell-packages 2024-03-05T10:16:08Z
, cardano-haskell-packages 2024-03-14T09:14:40Z

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 @@ -196,7 +196,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.39.2
, cardano-api ^>= 8.40.0.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/Byron/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ parseTxOut =
pLovelaceTxOut l =
if l > (maxBound :: Word64)
then error $ show l <> " lovelace exceeds the Word64 upper bound"
else TxOutValueByron . Lovelace $ toInteger l
else TxOutValueByron $ L.Coin $ toInteger l

readerFromAttoParser :: Atto.Parser a -> Opt.ReadM a
readerFromAttoParser p =
Expand Down Expand Up @@ -696,7 +696,7 @@ parseLovelace optname desc =
i <- Atto.decimal
if i > toInteger (maxBound :: Word64)
then fail $ show i <> " lovelace exceeds the Word64 upper bound"
else case toByronLovelace (Lovelace i) of
else case toByronLovelace $ L.Coin i of
Just byronLovelace -> return byronLovelace
Nothing -> error $ "Error converting lovelace: " <> show i

Expand Down
15 changes: 8 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Cardano.CLI.EraBased.Commands.Genesis
, renderGenesisCmds
) where

import Cardano.Api.Ledger (Coin)
import Cardano.Api.Shelley

import Cardano.Chain.Common (BlockCount)
Expand Down Expand Up @@ -45,7 +46,7 @@ data GenesisCreateCmdArgs = GenesisCreateCmdArgs
, numGenesisKeys :: !Word
, numUTxOKeys :: !Word
, mSystemStart :: !(Maybe SystemStart)
, mSupply :: !(Maybe Lovelace)
, mSupply :: !(Maybe Coin)
, network :: !NetworkId
} deriving Show

Expand All @@ -54,7 +55,7 @@ data GenesisCreateCardanoCmdArgs = GenesisCreateCardanoCmdArgs
, numGenesisKeys :: !Word
, numUTxOKeys :: !Word
, mSystemStart :: !(Maybe SystemStart)
, mSupply :: !(Maybe Lovelace)
, mSupply :: !(Maybe Coin)
, security :: !BlockCount
, slotLength :: !Word
, slotCoeff :: !Rational
Expand All @@ -74,8 +75,8 @@ data GenesisCreateStakedCmdArgs = GenesisCreateStakedCmdArgs
, numPools :: !Word
, numStakeDelegators :: !Word
, mSystemStart :: !(Maybe SystemStart)
, mNonDelegatedSupply :: !(Maybe Lovelace)
, delegatedSupply :: !Lovelace
, mNonDelegatedSupply :: !(Maybe Coin)
, delegatedSupply :: !Coin
, network :: !NetworkId
, numBulkPoolCredFiles :: !Word
, numBulkPoolsPerFile :: !Word
Expand All @@ -91,8 +92,8 @@ data GenesisCreateTestNetDataCmdArgs = GenesisCreateTestNetDataCmdArgs
, numDrepKeys :: !Word -- ^ The number of DRep keys to create. Right now they receive neither delegation nor are registrated. This will come later.
, numStuffedUtxo :: !Word -- ^ The number of UTxO accounts to make. They are "stuffed" because the credentials are not written to disk.
, numUtxoKeys :: !Word -- ^ The number of UTxO credentials to create and write to disk.
, totalSupply :: !(Maybe Lovelace) -- ^ The total number of Lovelace
, delegatedSupply :: !(Maybe Lovelace) -- ^ The number of Lovelace being delegated
, totalSupply :: !(Maybe Coin) -- ^ The total number of Lovelace
, delegatedSupply :: !(Maybe Coin) -- ^ The number of Lovelace being delegated
, networkId :: !(Maybe NetworkId) -- ^ The network ID to use. Overrides the network id supplied in the spec file.
, relays :: !(Maybe FilePath) -- ^ Filepath of the specification of relays
, systemStart :: !(Maybe SystemStart) -- ^ The genesis start time.
Expand Down Expand Up @@ -157,4 +158,4 @@ renderGenesisCmds = \case
GenesisAddr {} ->
"genesis initial-addr"
GenesisHashFile {} ->
"genesis hash"
"genesis hash"
7 changes: 4 additions & 3 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Cardano.CLI.EraBased.Commands.Governance
) where

import Cardano.Api
import Cardano.Api.Ledger (Coin)
import Cardano.Api.Shelley (VrfKey)

import Cardano.CLI.EraBased.Commands.Governance.Actions
Expand All @@ -25,15 +26,15 @@ data GovernanceCmds era
(ShelleyToBabbageEra era)
MIRPot
[StakeAddress]
[Lovelace]
[Coin]
(File () Out)
| GovernanceCreateMirCertificateTransferToTreasuryCmd
(ShelleyToBabbageEra era)
Lovelace
Coin
(File () Out)
| GovernanceCreateMirCertificateTransferToReservesCmd
(ShelleyToBabbageEra era)
Lovelace
Coin
(File () Out)
| GovernanceGenesisKeyDelegationCertificate
(ShelleyToBabbageEra era)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ data GoveranceActionUpdateCommitteeCmdArgs era
= GoveranceActionUpdateCommitteeCmdArgs
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, returnAddress :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
Expand All @@ -60,7 +60,7 @@ data GovernanceActionCreateConstitutionCmdArgs era
= GovernanceActionCreateConstitutionCmdArgs
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, stakeCredential :: !StakeIdentifier
, mPrevGovernanceActionId :: !(Maybe (TxId, Word32))
, proposalUrl :: !ProposalUrl
Expand All @@ -76,7 +76,7 @@ data GovernanceActionInfoCmdArgs era
= GovernanceActionInfoCmdArgs
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, returnStakeAddress :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
Expand All @@ -87,7 +87,7 @@ data GovernanceActionCreateNoConfidenceCmdArgs era
= GovernanceActionCreateNoConfidenceCmdArgs
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, returnStakeAddress :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
Expand Down Expand Up @@ -117,11 +117,11 @@ data GovernanceActionTreasuryWithdrawalCmdArgs era
= GovernanceActionTreasuryWithdrawalCmdArgs
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, returnAddr :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
, treasuryWithdrawal :: ![(VerificationKeyOrHashOrFile StakeKey, Lovelace)]
, treasuryWithdrawal :: ![(VerificationKeyOrHashOrFile StakeKey, L.Coin)]
, constitutionScriptHash :: !(Maybe ScriptHash)
, outFile :: !(File () Out)
} deriving Show
Expand All @@ -138,7 +138,7 @@ data UpdateProtocolParametersConwayOnwards era
= UpdateProtocolParametersConwayOnwards
{ eon :: !(ConwayEraOnwards era)
, networkId :: !L.Network
, deposit :: !Lovelace
, deposit :: !L.Coin
, returnAddr :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ data GovernanceDRepRegistrationCertificateCmdArgs era =
GovernanceDRepRegistrationCertificateCmdArgs
{ eon :: !(ConwayEraOnwards era)
, drepHashSource :: !DRepHashSource
, deposit :: !Lovelace
, deposit :: !L.Coin
, mAnchor :: !(Maybe (L.Anchor (L.EraCrypto (ShelleyLedgerEra era))))
, outFile :: !(File () Out)
}
Expand All @@ -60,7 +60,7 @@ data GovernanceDRepRetirementCertificateCmdArgs era =
GovernanceDRepRetirementCertificateCmdArgs
{ eon :: !(ConwayEraOnwards era)
, vkeyHashSource :: !(VerificationKeyOrHashOrFile DRepKey)
, deposit :: !Lovelace
, deposit :: !L.Coin
, outFile :: !(File () Out)
}

Expand Down
5 changes: 3 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/StakeAddress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Cardano.CLI.EraBased.Commands.StakeAddress
, renderStakeAddressCmds
) where

import Cardano.Api.Ledger (Coin)
import Cardano.Api.Shelley

import Cardano.CLI.Types.Common
Expand Down Expand Up @@ -34,7 +35,7 @@ data StakeAddressCmds era
| StakeAddressRegistrationCertificateCmd
(ShelleyBasedEra era)
StakeIdentifier
(Maybe Lovelace)
(Maybe Coin)
(File () Out)
| StakeAddressStakeDelegationCertificateCmd
(ShelleyBasedEra era)
Expand All @@ -55,7 +56,7 @@ data StakeAddressCmds era
| StakeAddressDeregistrationCertificateCmd
(ShelleyBasedEra era)
StakeIdentifier
(Maybe Lovelace)
(Maybe Coin)
(File () Out)
deriving Show

Expand Down
5 changes: 3 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/StakePool.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Cardano.CLI.EraBased.Commands.StakePool
, StakePoolRegistrationCertificateCmdArgs(..)
) where

import Cardano.Api.Ledger (Coin)
import Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..))

import Cardano.CLI.Types.Common
Expand Down Expand Up @@ -57,8 +58,8 @@ data StakePoolRegistrationCertificateCmdArgs era =
{ sbe :: !(ShelleyBasedEra era) -- ^ Era in which to register the stake pool.
, poolVerificationKeyOrFile :: !(VerificationKeyOrFile StakePoolKey) -- ^ Stake pool verification key.
, vrfVerificationKeyOrFile :: !(VerificationKeyOrFile VrfKey) -- ^ VRF Verification key.
, poolPledge :: !Lovelace -- ^ Pool pledge.
, poolCost :: !Lovelace -- ^ Pool cost.
, poolPledge :: !Coin -- ^ Pool pledge.
, poolCost :: !Coin -- ^ Pool cost.
, poolMargin :: !Rational -- ^ Pool margin.
, rewardStakeVerificationKeyOrFile :: !(VerificationKeyOrFile StakeKey) -- ^ Reward account verification staking key.
, ownerStakeVerificationKeyOrFiles :: ![VerificationKeyOrFile StakeKey] -- ^ Pool owner verification staking key(s).
Expand Down
11 changes: 6 additions & 5 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module Cardano.CLI.EraBased.Commands.Transaction
, renderTransactionCmds
) where

import Cardano.Api.Ledger (Coin)
import Cardano.Api.Shelley

import Cardano.CLI.Types.Common
Expand Down Expand Up @@ -53,7 +54,7 @@ data TransactionBuildRawCmdArgs era = TransactionBuildRawCmdArgs
-- ^ Transaction inputs for collateral, only key witnesses, no scripts.
, mReturnCollateral :: !(Maybe TxOutShelleyBasedEra)
-- ^ Return collateral
, mTotalCollateral :: !(Maybe Lovelace)
, mTotalCollateral :: !(Maybe Coin)
-- ^ Total collateral
, requiredSigners :: ![RequiredSigner]
-- ^ Required signers
Expand All @@ -64,11 +65,11 @@ data TransactionBuildRawCmdArgs era = TransactionBuildRawCmdArgs
-- ^ Transaction validity lower bound
, mValidityUpperBound :: !(TxValidityUpperBound era)
-- ^ Transaction validity upper bound
, fee :: !(Maybe Lovelace)
, fee :: !(Maybe Coin)
-- ^ Transaction fee
, certificates :: ![(CertificateFile, Maybe (ScriptWitnessFiles WitCtxStake))]
-- ^ Certificates with potential script witness
, withdrawals :: ![(StakeAddress, Lovelace, Maybe (ScriptWitnessFiles WitCtxStake))]
, withdrawals :: ![(StakeAddress, Coin, Maybe (ScriptWitnessFiles WitCtxStake))]
, metadataSchema :: !TxMetadataJsonSchema
, scriptFiles :: ![ScriptFile]
-- ^ Auxiliary scripts
Expand Down Expand Up @@ -100,7 +101,7 @@ data TransactionBuildCmdArgs era = TransactionBuildCmdArgs
-- ^ Transaction inputs for collateral, only key witnesses, no scripts.
, mReturnCollateral :: !(Maybe TxOutShelleyBasedEra)
-- ^ Return collateral
, mTotalCollateral :: !(Maybe Lovelace)
, mTotalCollateral :: !(Maybe Coin)
-- ^ Total collateral
, txouts :: ![TxOutAnyEra]
-- ^ Normal outputs
Expand All @@ -114,7 +115,7 @@ data TransactionBuildCmdArgs era = TransactionBuildCmdArgs
-- ^ Transaction validity upper bound
, certificates :: ![(CertificateFile, Maybe (ScriptWitnessFiles WitCtxStake))]
-- ^ Certificates with potential script witness
, withdrawals :: ![(StakeAddress, Lovelace, Maybe (ScriptWitnessFiles WitCtxStake))]
, withdrawals :: ![(StakeAddress, Coin, Maybe (ScriptWitnessFiles WitCtxStake))]
-- ^ Withdrawals with potential script witness
, metadataSchema :: !TxMetadataJsonSchema
, scriptFiles :: ![ScriptFile]
Expand Down
Loading

0 comments on commit 4ff26c0

Please sign in to comment.