Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose remaining functions and types from cardano-ledger-* required by cardano-cli #656

Merged
merged 3 commits into from
Oct 18, 2024
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
2 changes: 1 addition & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ genTxOutByron =
<*> pure ReferenceScriptNone

-- | Partial! It will throw if the generated transaction body is invalid.
genTxBodyByron :: HasCallStack => Gen (L.Annotated L.Tx ByteString)
genTxBodyByron :: HasCallStack => Gen (L.Annotated Byron.Tx ByteString)
genTxBodyByron = do
txIns <-
map (,BuildTxWith (KeyWitness KeyWitnessForSpending)) <$> Gen.list (Range.constant 1 10) genTxIn
Expand Down
53 changes: 40 additions & 13 deletions cardano-api/internal/Cardano/Api/ReexposeLedger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,27 @@ module Cardano.Api.ReexposeLedger
, Coin (..)
, EraPParams (..)
, Era (..)
, EraTxOut
, Network (..)
, PoolCert (..)
, PParams (..)
, PParamsUpdate
, TxId (..)
, TxIn (..)
, Value
, addDeltaCoin
, castSafeHash
, toDeltaCoin
, toEraCBOR
, fromEraCBOR
, ppMinFeeAL
, ppMinUTxOValueL
-- Conway
, Anchor (..)
, Delegatee (..)
, DRep (..)
, DRepState (..)
, ConwayPlutusPurpose (..)
, ConwayTxCert (..)
, ConwayDelegCert (..)
, ConwayEraTxCert (..)
Expand Down Expand Up @@ -88,7 +94,6 @@ module Cardano.Api.ReexposeLedger
-- Byron
, Annotated (..)
, byronProtVer
, Byron.Tx (..)
palas marked this conversation as resolved.
Show resolved Hide resolved
, ByteSpan (..)
, Decoder
, fromCBOR
Expand All @@ -98,15 +103,30 @@ module Cardano.Api.ReexposeLedger
, toPlainDecoder
-- Shelley
, secondsToNominalDiffTimeMicro
, AccountState (..)
, NewEpochState (..)
, ShelleyGenesisStaking (..)
-- Babbage
, CoinPerByte (..)
-- Alonzo
, AlonzoEraTxBody (..)
, AlonzoEraScript (..)
, AlonzoEraTxWits (..)
, AlonzoPlutusPurpose (..)
, AsIx (..)
, CoinPerWord (..)
, Data (..)
, ExUnits (..)
, Prices (..)
, CostModels
, AlonzoGenesis
, AsIxItem (..)
, EraGov
, EraTx (witsTxL, bodyTxL)
, Tx
, ppPricesL
, unData
, unRedeemers
-- Base
, boundRational
, unboundRational
Expand All @@ -126,6 +146,7 @@ module Cardano.Api.ReexposeLedger
, UnitInterval
, mkVersion
, NonNegativeInterval
, txIxToInt
-- Crypto
, hashToBytes
, hashFromBytes
Expand All @@ -141,12 +162,14 @@ module Cardano.Api.ReexposeLedger
)
where

import qualified Cardano.Chain.UTxO as Byron
import Cardano.Crypto.Hash.Class (hashFromBytes, hashToBytes)
import Cardano.Ledger.Alonzo.Core (AsIxItem (AsIxItem), CoinPerWord (..),
PParamsUpdate (..), ppPricesL)
import Cardano.Ledger.Alonzo.Core (AlonzoEraScript (..), AlonzoEraTxBody (..),
AlonzoEraTxWits (..), AsIx (..), AsIxItem (AsIxItem), CoinPerWord (..), EraGov,
EraTx (bodyTxL, witsTxL), PParamsUpdate (..), Tx, ppPricesL)
import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis)
import Cardano.Ledger.Alonzo.Scripts (CostModels, Prices (..))
import Cardano.Ledger.Alonzo.Scripts (AlonzoPlutusPurpose (..), CostModels, ExUnits (..),
Prices (..))
import Cardano.Ledger.Api (unRedeemers)
import Cardano.Ledger.Api.Tx.Cert (pattern AuthCommitteeHotKeyTxCert,
pattern DelegStakeTxCert, pattern DelegTxCert, pattern GenesisDelegTxCert,
pattern MirTxCert, pattern RegDRepTxCert, pattern RegDepositDelegTxCert,
Expand All @@ -157,8 +180,8 @@ import Cardano.Ledger.Babbage.Core (CoinPerByte (..))
import Cardano.Ledger.BaseTypes (AnchorData (..), DnsName, EpochInterval (..),
Network (..), NonNegativeInterval, ProtVer (..), StrictMaybe (..), UnitInterval,
Url, boundRational, dnsToText, hashAnchorData, maybeToStrictMaybe, mkVersion,
portToWord16, strictMaybeToMaybe, textToDns, textToUrl, unboundRational,
urlToText)
portToWord16, strictMaybeToMaybe, textToDns, textToUrl, txIxToInt,
unboundRational, urlToText)
import Cardano.Ledger.Binary (Annotated (..), ByteSpan (..), byronProtVer, fromCBOR,
serialize', slice, toCBOR, toPlainDecoder)
import Cardano.Ledger.Binary.Plain (Decoder)
Expand All @@ -172,22 +195,26 @@ import Cardano.Ledger.Conway.Governance (Anchor (..), GovActionId (..)
ProposalProcedure (..), Vote (..), Voter (..), VotingProcedure (..),
VotingProcedures (..))
import Cardano.Ledger.Conway.PParams (UpgradeConwayPParams (..))
import Cardano.Ledger.Conway.Scripts (ConwayPlutusPurpose (..))
import Cardano.Ledger.Conway.TxCert (ConwayDelegCert (..), ConwayEraTxCert (..),
ConwayGovCert (..), ConwayTxCert (..), Delegatee (..), pattern UpdateDRepTxCert)
import Cardano.Ledger.Core (Era (..), EraPParams (..), PParams (..), PoolCert (..), Value,
fromEraCBOR, ppMinUTxOValueL, toEraCBOR)
import Cardano.Ledger.Core (Era (..), EraPParams (..), EraTxOut, PParams (..),
PoolCert (..), Value, fromEraCBOR, ppMinFeeAL, ppMinUTxOValueL, toEraCBOR)
import Cardano.Ledger.Credential (Credential (..), credToText)
import Cardano.Ledger.Crypto (ADDRHASH, Crypto, StandardCrypto)
import Cardano.Ledger.DRep (DRep (..), drepAnchorL, drepDepositL, drepExpiryL)
import Cardano.Ledger.Keys (HasKeyRole, KeyHash (..), KeyRole (..), VKey (..),
hashWithSerialiser)
import Cardano.Ledger.Plutus.Data (Data (..), unData)
import Cardano.Ledger.PoolParams (PoolMetadata (..), PoolParams (..), StakePoolRelay (..))
import Cardano.Ledger.SafeHash (SafeHash, extractHash, unsafeMakeSafeHash)
import Cardano.Ledger.Shelley.API (GenDelegPair (..), StakeReference (..), WitVKey (..),
hashKey, hashVerKeyVRF)
import Cardano.Ledger.Shelley.Genesis (secondsToNominalDiffTimeMicro)
import Cardano.Ledger.SafeHash (SafeHash, castSafeHash, extractHash, unsafeMakeSafeHash)
import Cardano.Ledger.Shelley.API (AccountState (..), GenDelegPair (..),
NewEpochState (..), StakeReference (..), WitVKey (..), hashKey, hashVerKeyVRF)
import Cardano.Ledger.Shelley.Genesis (ShelleyGenesisStaking (..),
secondsToNominalDiffTimeMicro)
import Cardano.Ledger.Shelley.LedgerState (PState (..))
import Cardano.Ledger.Shelley.TxCert (EraTxCert (..), GenesisDelegCert (..), MIRCert (..),
MIRPot (..), MIRTarget (..), ShelleyDelegCert (..), ShelleyEraTxCert (..),
ShelleyTxCert (..))
import Cardano.Ledger.TxIn (TxId (..), TxIn (..))
import Cardano.Slotting.Slot (EpochNo (..))
13 changes: 7 additions & 6 deletions cardano-api/src/Cardano/Api/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module Cardano.Api.Byron
, ATxAux (..)
, CompactTxIn
, CompactTxOut
, Tx (..)
, TxIn (..)
, TxOut (..)
, UTxO (..)
Expand All @@ -154,14 +155,14 @@ module Cardano.Api.Byron
)
where

import Cardano.Api hiding (Address, Certificate, Lovelace, NetworkMagic, TxIn, TxOut,
UTxO (..))
import Cardano.Api hiding (Address, Certificate, Lovelace, NetworkMagic, Tx (..), TxIn,
palas marked this conversation as resolved.
Show resolved Hide resolved
TxOut, UTxO (..))
import Cardano.Api.Keys.Byron
import Cardano.Api.NetworkId hiding (NetworkMagic)
import Cardano.Api.SerialiseLedgerCddl
import Cardano.Api.SpecialByron
import Cardano.Api.Tx.Body hiding (TxIn, TxOut)
import Cardano.Api.Tx.Sign hiding (ATxAux (..))
import Cardano.Api.Tx.Sign hiding (ATxAux (..), Tx (..))
import Cardano.Api.Value hiding (Lovelace)

import Cardano.Chain.Block (decCBORABlockOrBoundary)
Expand All @@ -181,6 +182,6 @@ 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)
import Cardano.Chain.UTxO (ATxAux (..), CompactTxIn, CompactTxOut, Tx (..), TxIn (..),
TxOut (..), UTxO (..), defaultUTxOConfiguration, fromCompactTxIn,
fromCompactTxOut, genesisUtxo)
Loading