Skip to content

Commit

Permalink
Merge pull request #420 from IntersectMBO/felix-lipski/remove-cardano…
Browse files Browse the repository at this point in the history
…-ledger-imports

Add types to `ReexposeLedger`
  • Loading branch information
palas authored Feb 13, 2024
2 parents c9ca0f3 + c8f79e7 commit f590906
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ library gen
, cardano-ledger-byron-test >= 1.5
, cardano-ledger-core:{cardano-ledger-core, testlib} >= 1.8.0
, cardano-ledger-shelley >= 1.7.0
, cardano-ledger-conway:{cardano-ledger-conway, testlib} >= 1.10.0
, cardano-ledger-conway:testlib >= 1.10.0
, containers
, filepath
, hedgehog >= 1.1
Expand Down
1 change: 0 additions & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ import qualified Cardano.Crypto.Hash.Class as CRYPTO
import qualified Cardano.Crypto.Seed as Crypto
import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo
import qualified Cardano.Ledger.BaseTypes as Ledger
import qualified Cardano.Ledger.Conway.Governance as L
import qualified Cardano.Ledger.Core as Ledger
import Cardano.Ledger.SafeHash (unsafeMakeSafeHash)

Expand Down
81 changes: 67 additions & 14 deletions cardano-api/internal/Cardano/Api/ReexposeLedger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

module Cardano.Api.ReexposeLedger
( Credential (..)
, credToText
, KeyHash(..)
, KeyRole(..)
, VKey (..)
, ShelleyTxCert(..)
, ShelleyDelegCert(..)
, ShelleyEraTxCert(..)
, PState (..)
, GenesisDelegCert(..)
, GenDelegPair(..)
, StakeReference (..)
, WitVKey (..)
, hashKey
, hashVerKeyVRF
, hashWithSerialiser
, PoolParams (..)
, HasKeyRole
, MIRPot(..)
Expand Down Expand Up @@ -36,7 +45,8 @@ module Cardano.Api.ReexposeLedger

-- Core
, Coin (..)
, EraCrypto
, EraPParams (..)
, Era (..)
, Network(..)
, PoolCert(..)
, PParams(..)
Expand All @@ -46,6 +56,7 @@ module Cardano.Api.ReexposeLedger
, toDeltaCoin
, toEraCBOR
, fromEraCBOR
, ppMinUTxOValueL

-- Conway
, Anchor(..)
Expand All @@ -56,11 +67,14 @@ module Cardano.Api.ReexposeLedger
, ConwayDelegCert(..)
, ConwayEraTxCert(..)
, ConwayGovCert(..)
, ConwayGenesis
, GovState
, GovActionId(..)
, Vote (..)
, Voter (..)
, VotingProcedure(..)
, ProposalProcedure(..)
, VotingProcedures(..)
, PoolVotingThresholds(..)
, DRepVotingThresholds(..)
, dvtPPNetworkGroupL
Expand All @@ -74,21 +88,36 @@ module Cardano.Api.ReexposeLedger
, csCommitteeCredsL

-- Byron
, Annotated
, Annotated(..)
, Byron.Tx(..)
, byronProtVer
, serialize'
, toPlainDecoder
, toCBOR
, fromCBOR
, ByteSpan (..)
, slice
, Decoder

-- Shelley
, secondsToNominalDiffTimeMicro

-- Babbage
, CoinPerByte (..)

-- Alonzo
, CoinPerWord (..)
, Prices(..)
, CostModels
, AlonzoGenesis
, ppPricesL

-- Base
, boundRational
, unboundRational
, DnsName
, dnsToText
, EpochInterval(..)
, textToDns
, Url
, urlToText
Expand All @@ -97,48 +126,72 @@ module Cardano.Api.ReexposeLedger
, ProtVer(..)
, strictMaybeToMaybe
, maybeToStrictMaybe
, AnchorData(..)
, hashAnchorData
, UnitInterval
, mkVersion
, NonNegativeInterval

-- Crypto
, hashToBytes
, hashFromBytes
, Crypto
, StandardCrypto
, ADDRHASH

-- Slotting
, EpochNo(..)

-- SafeHash
, SafeHash
, unsafeMakeSafeHash
, extractHash
) where

import qualified Cardano.Chain.UTxO as Byron
import Cardano.Crypto.Hash.Class (hashFromBytes, hashToBytes)
import Cardano.Ledger.Alonzo.Core (CoinPerWord (..), PParamsUpdate (..))
import Cardano.Ledger.Alonzo.Scripts (Prices (..))
import Cardano.Ledger.Alonzo.Core (CoinPerWord (..), PParamsUpdate (..), ppPricesL)
import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis)
import Cardano.Ledger.Alonzo.Scripts (CostModels, Prices (..))
import Cardano.Ledger.Api.Tx.Cert (pattern AuthCommitteeHotKeyTxCert,
pattern DelegStakeTxCert, pattern DelegTxCert, pattern GenesisDelegTxCert,
pattern MirTxCert, pattern RegDRepTxCert, pattern RegDepositDelegTxCert,
pattern RegDepositTxCert, pattern RegPoolTxCert, pattern RegTxCert,
pattern ResignCommitteeColdTxCert, pattern RetirePoolTxCert,
pattern UnRegDRepTxCert, pattern UnRegDepositTxCert, pattern UnRegTxCert)
import Cardano.Ledger.Babbage.Core (CoinPerByte (..))
import Cardano.Ledger.BaseTypes (DnsName, Network (..), ProtVer (..), StrictMaybe (..),
Url, boundRational, dnsToText, maybeToStrictMaybe, portToWord16,
strictMaybeToMaybe, textToDns, textToUrl, unboundRational, urlToText)
import Cardano.Ledger.Binary (Annotated (..))
import Cardano.Ledger.BaseTypes (AnchorData (..), DnsName, EpochInterval (..),
Network (..), NonNegativeInterval, ProtVer (..), StrictMaybe (..), UnitInterval,
Url, boundRational, dnsToText, hashAnchorData, maybeToStrictMaybe, mkVersion,
portToWord16, strictMaybeToMaybe, textToDns, textToUrl, unboundRational,
urlToText)
import Cardano.Ledger.Binary (Annotated (..), ByteSpan (..), byronProtVer, fromCBOR,
serialize', slice, toCBOR, toPlainDecoder)
import Cardano.Ledger.Binary.Plain (Decoder)
import Cardano.Ledger.CertState (DRepState, csCommitteeCredsL)
import Cardano.Ledger.Coin (Coin (..), addDeltaCoin, toDeltaCoin)
import Cardano.Ledger.Conway.Core (DRepVotingThresholds (..), PoolVotingThresholds (..),
dvtPPEconomicGroupL, dvtPPGovGroupL, dvtPPNetworkGroupL, dvtPPTechnicalGroupL,
dvtUpdateToConstitutionL)
import Cardano.Ledger.Conway.Genesis (ConwayGenesis)
import Cardano.Ledger.Conway.Governance (Anchor (..), GovActionId (..), GovState,
Vote (..), Voter (..), VotingProcedure (..))
ProposalProcedure (..), Vote (..), Voter (..), VotingProcedure (..),
VotingProcedures (..))
import Cardano.Ledger.Conway.TxCert (ConwayDelegCert (..), ConwayEraTxCert (..),
ConwayGovCert (..), ConwayTxCert (..), Delegatee (..), pattern UpdateDRepTxCert)
import Cardano.Ledger.Core (EraCrypto, PParams (..), PoolCert (..), Value, fromEraCBOR,
toEraCBOR)
import Cardano.Ledger.Credential (Credential (..))
import Cardano.Ledger.Crypto (Crypto, StandardCrypto)
import Cardano.Ledger.Core (Era (..), EraPParams (..), PParams (..), PoolCert (..), Value,
fromEraCBOR, 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 (..))
import Cardano.Ledger.Keys (HasKeyRole, KeyHash (..), KeyRole (..), VKey (..),
hashWithSerialiser)
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.Shelley.LedgerState (PState (..))
import Cardano.Ledger.Shelley.TxCert (EraTxCert (..), GenesisDelegCert (..), MIRCert (..),
MIRPot (..), MIRTarget (..), ShelleyDelegCert (..), ShelleyEraTxCert (..),
ShelleyTxCert (..))
Expand Down

0 comments on commit f590906

Please sign in to comment.