Skip to content

Commit

Permalink
Move exposed terms to Cardano.Api.Byron.Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Oct 3, 2024
1 parent 0264483 commit 74086ed
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 111 deletions.
3 changes: 2 additions & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ library internal
Cardano.Api.Address
Cardano.Api.Anchor
Cardano.Api.Block
Cardano.Api.ByronDelegation
Cardano.Api.Certificate
Cardano.Api.Convenience.Construction
Cardano.Api.Convenience.Query
Expand Down Expand Up @@ -236,6 +235,7 @@ library
exposed-modules:
Cardano.Api
Cardano.Api.Byron
Cardano.Api.Byron.Misc
Cardano.Api.ChainSync.Client
Cardano.Api.ChainSync.ClientPipelined
Cardano.Api.Crypto.Ed25519Bip32
Expand All @@ -251,6 +251,7 @@ library
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.1.2,
cardano-ledger-byron,
cryptonite,
deepseq,
memory,
Expand Down
9 changes: 0 additions & 9 deletions cardano-api/internal/Cardano/Api/ByronDelegation.hs

This file was deleted.

77 changes: 0 additions & 77 deletions cardano-api/internal/Cardano/Api/ReexposeLedger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,74 +86,16 @@ module Cardano.Api.ReexposeLedger
, drepDepositL
, csCommitteeCredsL
-- Byron
, AddrAttributes (..)
, Address
, addressDetailedF
, addressF
, addressHash
, ApplicationName (..)
, Annotated (..)
, aTaAnnotation
, BlockCount (..)
, Byron.CompactTxIn
, Byron.CompactTxOut
, Byron.fromCompactTxIn
, Byron.fromCompactTxOut
, byronProtVer
, Byron.Tx (..)
, Byron.unUTxO
, ByteSpan (..)
, Certificate
, checkApplicationName
, checkVerKeyAddress
, checkSystemTag
, Config (..)
, decCBORABlockOrBoundary
, decodeAddressBase58
, Decoder
, defaultUTxOConfiguration
, EpochNumber (..)
, FakeAvvmOptions (..)
, fromCBOR
, GeneratedSecrets (..)
, generateGenesisData
, GenesisAvvmBalances (..)
, GenesisData (..)
, GenesisDataError (..)
, GenesisDataGenerationError (..)
, GenesisDelegation (..)
, GenesisDelegationError
, GenesisHash (..)
, GenesisInitializer (..)
, GenesisSpec (..)
, genesisUtxo
, InstallerHash (..)
, Lovelace
, LovelacePortion
, lovelacePortionToRational
, mkAttributes
, mkGenesisDelegation
, mkGenesisSpec
, mkKnownLovelace
, NetworkMagic (..)
, NumSoftwareVersion
, PoorSecret (..)
, Proposal
, ProtocolParameters (..)
, rationalToLovelacePortion
, readGenesisData
, serialize'
, slice
, SlotNumber (..)
, SoftforkRule (..)
, SoftwareVersion (..)
, SystemTag (..)
, TestnetBalanceOptions (..)
, TxFeePolicy (..)
, TxSizeLinear (..)
, toCBOR
, toPlainDecoder
, txOutAddress
-- Shelley
, secondsToNominalDiffTimeMicro
-- Babbage
Expand Down Expand Up @@ -199,25 +141,6 @@ module Cardano.Api.ReexposeLedger
)
where

import Cardano.Chain.Block (decCBORABlockOrBoundary)
import Cardano.Chain.Common (AddrAttributes (..), Address, BlockCount (..), Lovelace,
LovelacePortion, NetworkMagic (..), TxFeePolicy (..), TxSizeLinear (..),
addressDetailedF, addressF, addressHash, checkVerKeyAddress, decodeAddressBase58,
lovelacePortionToRational, mkAttributes, mkKnownLovelace,
rationalToLovelacePortion)
import Cardano.Chain.Delegation (Certificate)
import Cardano.Chain.Genesis (Config (..), FakeAvvmOptions (..), GeneratedSecrets (..),
GenesisAvvmBalances (..), GenesisData (..), GenesisDataError (..),
GenesisDataGenerationError (..), GenesisDelegation (..), GenesisDelegationError,
GenesisHash (..), GenesisInitializer (..), GenesisSpec (..), PoorSecret,
TestnetBalanceOptions (..), generateGenesisData, mkGenesisDelegation,
mkGenesisSpec, poorSecretToKey, readGenesisData)
import Cardano.Chain.Slotting (EpochNumber (..), SlotNumber (..))
import Cardano.Chain.Update (ApplicationName (..), InstallerHash (..), NumSoftwareVersion,
Proposal, ProtocolParameters (..), SoftforkRule (..), SoftwareVersion (..),
SystemTag (..), checkApplicationName, checkSystemTag)
import Cardano.Chain.UTxO (aTaAnnotation, defaultUTxOConfiguration, genesisUtxo,
txOutAddress)
import qualified Cardano.Chain.UTxO as Byron
import Cardano.Crypto.Hash.Class (hashFromBytes, hashToBytes)
import Cardano.Ledger.Alonzo.Core (AsIxItem (AsIxItem), CoinPerWord (..),
Expand Down
7 changes: 2 additions & 5 deletions cardano-api/internal/Cardano/Api/SpecialByron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ module Cardano.Api.SpecialByron
, applicationName
, applicationVersion
, softwareVersion
, KeyHash
, ProtocolVersion (..)
, Vote
)
where

Expand All @@ -27,11 +24,11 @@ import Cardano.Api.NetworkId (NetworkId, toByronProtocolMagicId)
import Cardano.Api.SerialiseRaw

import qualified Cardano.Binary as Binary
import Cardano.Chain.Common (KeyHash, LovelacePortion, TxFeePolicy)
import Cardano.Chain.Common (LovelacePortion, TxFeePolicy)
import Cardano.Chain.Slotting
import Cardano.Chain.Update (AProposal (aBody, annotation), InstallerHash,
ProposalBody (ProposalBody), ProtocolParametersUpdate (..), ProtocolVersion (..),
SoftforkRule, SoftwareVersion, SystemTag, UpId, Vote, mkVote, recoverUpId,
SoftforkRule, SoftwareVersion, SystemTag, UpId, mkVote, recoverUpId,
recoverVoteId, signProposal)
import qualified Cardano.Chain.Update as Update
import qualified Cardano.Chain.Update.Vote as ByronVote
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/internal/Cardano/Api/Tx/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ module Cardano.Api.Tx.Body
, TxIx (..)
, genesisUTxOPseudoTxIn
, getReferenceInputsSizeForTxIds
, ByronTxIn

-- * Transaction outputs
, CtxTx
Expand All @@ -96,7 +95,6 @@ module Cardano.Api.Tx.Body
, parseHash
, TxOutInAnyEra (..)
, txOutInAnyEra
, ByronTxOut

-- * Other transaction body types
, TxInsCollateral (..)
Expand Down
6 changes: 0 additions & 6 deletions cardano-api/internal/Cardano/Api/TxIn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ module Cardano.Api.TxIn
( -- * Transaction inputs
TxIn (..)
, TxIx (..)
, ByronTxIn
, ByronTxOut

-- * Transaction Ids
, TxId (..)
Expand Down Expand Up @@ -172,7 +170,3 @@ toShelleyTxIn (TxIn txid (TxIx txix)) =
fromShelleyTxIn :: Ledger.TxIn StandardCrypto -> TxIn
fromShelleyTxIn (Ledger.TxIn txid (Ledger.TxIx txix)) =
TxIn (fromShelleyTxId txid) (TxIx (fromIntegral txix))

type ByronTxIn = Byron.TxIn

type ByronTxOut = Byron.TxOut
11 changes: 0 additions & 11 deletions cardano-api/src/Cardano/Api/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ module Cardano.Api.Byron
, SigningKey (..)
, SomeByronSigningKey (..)

-- * Delegation
, Dlg.ACertificate (..)
, Dlg.isValid
, Dlg.signCertificate

-- * Hashes
, Hash (..)

Expand Down Expand Up @@ -76,13 +71,8 @@ module Cardano.Api.Byron
, ByronVote (..)
, makeByronVote
, toByronLedgertoByronVote
, KeyHash
, ProtocolVersion (..)
, Vote

-- ** Conversions
, ByronTxIn
, ByronTxOut
, fromByronTxIn
, toByronLovelace
, toByronNetworkMagic
Expand All @@ -102,7 +92,6 @@ where

import Cardano.Api
import Cardano.Api.Address
import Cardano.Api.ByronDelegation as Dlg
import Cardano.Api.Keys.Byron
import Cardano.Api.NetworkId
import Cardano.Api.SerialiseLedgerCddl
Expand Down
89 changes: 89 additions & 0 deletions cardano-api/src/Cardano/Api/Byron/Misc.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
module Cardano.Api.Byron.Misc
( ACertificate (..)
, AddrAttributes (..)
, Address
, ApplicationName (..)
, ATxAux (..)
, BlockCount (..)
, Certificate
, CompactTxIn
, CompactTxOut
, Config (..)
, EpochNumber (..)
, FakeAvvmOptions (..)
, GeneratedSecrets (..)
, GenesisAvvmBalances (..)
, GenesisData (..)
, GenesisDataError (..)
, GenesisDataGenerationError (..)
, GenesisDelegation (..)
, GenesisDelegationError
, GenesisHash (..)
, GenesisInitializer (..)
, GenesisSpec (..)
, InstallerHash (..)
, KeyHash
, Lovelace
, LovelacePortion
, NetworkMagic (..)
, NumSoftwareVersion
, PoorSecret (..)
, Proposal
, ProtocolParameters (..)
, ProtocolVersion (..)
, SlotNumber (..)
, SoftforkRule (..)
, SoftwareVersion (..)
, SystemTag (..)
, TestnetBalanceOptions (..)
, TxFeePolicy (..)
, TxIn (..)
, TxOut (..)
, TxSizeLinear (..)
, UTxO (..)
, Vote
, addressDetailedF
, addressF
, addressHash
, checkApplicationName
, checkSystemTag
, checkVerKeyAddress
, decCBORABlockOrBoundary
, decodeAddressBase58
, defaultUTxOConfiguration
, fromCompactTxIn
, fromCompactTxOut
, generateGenesisData
, genesisUtxo
, isValid
, lovelacePortionToRational
, mkAttributes
, mkGenesisDelegation
, mkGenesisSpec
, mkKnownLovelace
, rationalToLovelacePortion
, readGenesisData
, signCertificate
)
where

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)

0 comments on commit 74086ed

Please sign in to comment.