Skip to content

Commit

Permalink
Merge pull request #647 from IntersectMBO/remove-transitive-deps-ledg…
Browse files Browse the repository at this point in the history
…er-backport

Expose functions and types from `cardano-ledger-alonzo` and `cardano-ledger-byron` required by cardano-cli
  • Loading branch information
palas authored Oct 4, 2024
2 parents 7fe253e + 4f9b7d6 commit 00f025d
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 34 deletions.
1 change: 1 addition & 0 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ library
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.1.2,
cardano-ledger-byron,
cryptonite,
deepseq,
memory,
Expand Down
16 changes: 9 additions & 7 deletions cardano-api/internal/Cardano/Api/ReexposeLedger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ module Cardano.Api.ReexposeLedger
, csCommitteeCredsL
-- Byron
, Annotated (..)
, Byron.Tx (..)
, byronProtVer
, serialize'
, toPlainDecoder
, toCBOR
, fromCBOR
, Byron.Tx (..)
, ByteSpan (..)
, slice
, Decoder
, fromCBOR
, serialize'
, slice
, toCBOR
, toPlainDecoder
-- Shelley
, secondsToNominalDiffTimeMicro
-- Babbage
Expand All @@ -105,6 +105,7 @@ module Cardano.Api.ReexposeLedger
, Prices (..)
, CostModels
, AlonzoGenesis
, AsIxItem (..)
, ppPricesL
-- Base
, boundRational
Expand Down Expand Up @@ -142,7 +143,8 @@ where

import qualified Cardano.Chain.UTxO as Byron
import Cardano.Crypto.Hash.Class (hashFromBytes, hashToBytes)
import Cardano.Ledger.Alonzo.Core (CoinPerWord (..), PParamsUpdate (..), ppPricesL)
import Cardano.Ledger.Alonzo.Core (AsIxItem (AsIxItem), CoinPerWord (..),
PParamsUpdate (..), ppPricesL)
import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis)
import Cardano.Ledger.Alonzo.Scripts (CostModels, Prices (..))
import Cardano.Ledger.Api.Tx.Cert (pattern AuthCommitteeHotKeyTxCert,
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/SpecialByron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import qualified Cardano.Binary as Binary
import Cardano.Chain.Common (LovelacePortion, TxFeePolicy)
import Cardano.Chain.Slotting
import Cardano.Chain.Update (AProposal (aBody, annotation), InstallerHash,
ProposalBody (ProposalBody), ProtocolParametersUpdate (..), ProtocolVersion,
ProposalBody (ProposalBody), ProtocolParametersUpdate (..), ProtocolVersion (..),
SoftforkRule, SoftwareVersion, SystemTag, UpId, mkVote, recoverUpId,
recoverVoteId, signProposal)
import qualified Cardano.Chain.Update as Update
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module Cardano.Api
-- * Payment addresses

-- | Constructing and inspecting normal payment addresses
, Address
, Address (..)
, ByronAddr
, ShelleyAddr
, NetworkId (..)
Expand Down
133 changes: 109 additions & 24 deletions cardano-api/src/Cardano/Api/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,11 @@ module Cardano.Api.Byron
-- * Hashes
, Hash (..)

-- * Payment addresses

-- | Constructing and inspecting Byron payment addresses
, Address (ByronAddress)
-- * Network identifier
, NetworkId (Mainnet, Testnet)

-- * Building transactions

-- | Constructing and inspecting transactions
, TxId (TxId)
, TxIn (TxIn)
, TxOut (TxOut)
, TxIx (TxIx)

-- * Signing transactions

-- | Creating transaction witnesses one by one, or all in one go.
, ATxAux (..)

-- ** Incremental signing and separate witnesses
, KeyWitness (ByronKeyWitness)
, WitnessNetworkIdOrByronAddress
Expand All @@ -57,9 +43,6 @@ module Cardano.Api.Byron
-- *** Local state query
, LocalStateQueryClient (..)

-- * Address
, NetworkMagic (..)

-- * Update Proposal
, ByronUpdateProposal (..)
, ByronProtocolParametersUpdate (..)
Expand Down Expand Up @@ -87,15 +70,117 @@ module Cardano.Api.Byron
-- * Serialization
, serializeByronTx
, writeByronTxFileTextEnvelopeCddl

-- * Byron ledger re-exports

-- ** Address components
, AddrAttributes (..)
, Address
, KeyHash
, addressDetailedF
, addressF
, addressHash
, checkVerKeyAddress
, decodeAddressBase58
, mkAttributes

-- ** Lovelace handling
, Lovelace
, LovelacePortion
, lovelacePortionToRational
, mkKnownLovelace
, rationalToLovelacePortion

-- ** Genesis configuration and AVVM
, Config (..)
, FakeAvvmOptions (..)
, GeneratedSecrets (..)
, GenesisAvvmBalances (..)
, GenesisData (..)
, GenesisDataError (..)
, GenesisDataGenerationError (..)
, GenesisDelegation (..)
, GenesisDelegationError
, GenesisHash (..)
, GenesisInitializer (..)
, GenesisSpec (..)
, NetworkMagic (..)
, PoorSecret (..)
, TestnetBalanceOptions (..)
, TxFeePolicy (..)
, TxSizeLinear (..)
, generateGenesisData
, mkGenesisDelegation
, mkGenesisSpec
, readGenesisData

-- ** Updates
, ApplicationName (..)
, InstallerHash (..)
, NumSoftwareVersion
, Proposal
, ProtocolParameters (..)
, ProtocolVersion (..)
, SoftforkRule (..)
, SoftwareVersion (..)
, SystemTag (..)
, Vote
, checkApplicationName
, checkSystemTag

-- ** Blocks, slots, and epochs
, BlockCount (..)
, EpochNumber (..)
, SlotNumber (..)
, decCBORABlockOrBoundary

-- ** UTxO components
, ATxAux (..)
, CompactTxIn
, CompactTxOut
, TxIn (..)
, TxOut (..)
, UTxO (..)
, defaultUTxOConfiguration
, fromCompactTxIn
, fromCompactTxOut
, genesisUtxo

-- ** Delegation
, ACertificate (..)
, Certificate
, isValid
, signCertificate
)
where

import Cardano.Api
import Cardano.Api.Address
import Cardano.Api hiding (Address, Certificate, Lovelace, NetworkMagic, TxIn, TxOut,
UTxO (..))
import Cardano.Api.Keys.Byron
import Cardano.Api.NetworkId
import Cardano.Api.NetworkId hiding (NetworkMagic)
import Cardano.Api.SerialiseLedgerCddl
import Cardano.Api.SpecialByron
import Cardano.Api.Tx.Body
import Cardano.Api.Tx.Sign
import Cardano.Api.Value
import Cardano.Api.Tx.Body hiding (TxIn, TxOut)
import Cardano.Api.Tx.Sign hiding (ATxAux (..))
import Cardano.Api.Value hiding (Lovelace)

import Cardano.Chain.Block (decCBORABlockOrBoundary)
import Cardano.Chain.Common (AddrAttributes (..), Address, BlockCount (..), KeyHash,
Lovelace, LovelacePortion, NetworkMagic (..), TxFeePolicy (..),
TxSizeLinear (..), addressDetailedF, addressF, addressHash, checkVerKeyAddress,
decodeAddressBase58, lovelacePortionToRational, mkAttributes, mkKnownLovelace,
rationalToLovelacePortion)
import Cardano.Chain.Delegation (ACertificate (..), Certificate, isValid, signCertificate)
import Cardano.Chain.Genesis (Config (..), FakeAvvmOptions (..), GeneratedSecrets (..),
GenesisAvvmBalances (..), GenesisData (..), GenesisDataError (..),
GenesisDataGenerationError (..), GenesisDelegation (..), GenesisDelegationError,
GenesisHash (..), GenesisInitializer (..), GenesisSpec (..), PoorSecret (..),
TestnetBalanceOptions (..), generateGenesisData, mkGenesisDelegation,
mkGenesisSpec, readGenesisData)
import Cardano.Chain.Slotting (EpochNumber (..), SlotNumber (..))
import Cardano.Chain.Update (ApplicationName (..), InstallerHash (..), NumSoftwareVersion,
Proposal, ProtocolParameters (..), ProtocolVersion (..), SoftforkRule (..),
SoftwareVersion (..), SystemTag (..), Vote, checkApplicationName, checkSystemTag)
import Cardano.Chain.UTxO (ATxAux (..), CompactTxIn, CompactTxOut, TxIn (..), TxOut (..),
UTxO (..), defaultUTxOConfiguration, fromCompactTxIn, fromCompactTxOut,
genesisUtxo)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Cardano.Api.Fees
import qualified Cardano.Api.Ledger as L
import qualified Cardano.Api.Ledger.Lens as L
import Cardano.Api.Script
import Cardano.Api.Shelley (Address (..), LedgerProtocolParameters (..))
import Cardano.Api.Shelley (LedgerProtocolParameters (..))

import qualified Cardano.Ledger.Alonzo.Core as L
import qualified Cardano.Ledger.Coin as L
Expand Down

0 comments on commit 00f025d

Please sign in to comment.