diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index 52816878e..ee4def141 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -251,6 +251,7 @@ library cardano-binary, cardano-crypto, cardano-crypto-class ^>=2.1.2, + cardano-ledger-byron, cryptonite, deepseq, memory, diff --git a/cardano-api/internal/Cardano/Api/ReexposeLedger.hs b/cardano-api/internal/Cardano/Api/ReexposeLedger.hs index 4169d23fc..080b673e4 100644 --- a/cardano-api/internal/Cardano/Api/ReexposeLedger.hs +++ b/cardano-api/internal/Cardano/Api/ReexposeLedger.hs @@ -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 diff --git a/cardano-api/internal/Cardano/Api/SpecialByron.hs b/cardano-api/internal/Cardano/Api/SpecialByron.hs index c73d9bacb..9f66f7c3d 100644 --- a/cardano-api/internal/Cardano/Api/SpecialByron.hs +++ b/cardano-api/internal/Cardano/Api/SpecialByron.hs @@ -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 diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index ccdf447da..d765bc9d4 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -180,7 +180,7 @@ module Cardano.Api -- * Payment addresses -- | Constructing and inspecting normal payment addresses - , Address + , Address (..) , ByronAddr , ShelleyAddr , NetworkId (..) diff --git a/cardano-api/src/Cardano/Api/Byron.hs b/cardano-api/src/Cardano/Api/Byron.hs index 616dea34a..e946e7c85 100644 --- a/cardano-api/src/Cardano/Api/Byron.hs +++ b/cardano-api/src/Cardano/Api/Byron.hs @@ -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 @@ -57,9 +43,6 @@ module Cardano.Api.Byron -- *** Local state query , LocalStateQueryClient (..) - -- * Address - , NetworkMagic (..) - -- * Update Proposal , ByronUpdateProposal (..) , ByronProtocolParametersUpdate (..) @@ -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) diff --git a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs index 23ef930e9..6a8225517 100644 --- a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs +++ b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Autobalance.hs @@ -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