From f3c377f8db3d27ff30bbe4e94d08a729d5c7697b Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Mon, 17 Jul 2023 15:20:03 -0400 Subject: [PATCH] Expose more functionality from Cardano.Api.Shelley --- cardano-api/internal/Cardano/Api/Certificate.hs | 11 ++++++++++- cardano-api/internal/Cardano/Api/ReexposeLedger.hs | 4 ++++ cardano-api/src/Cardano/Api.hs | 10 ++++++++++ cardano-api/src/Cardano/Api/Shelley.hs | 3 +++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/cardano-api/internal/Cardano/Api/Certificate.hs b/cardano-api/internal/Cardano/Api/Certificate.hs index 93d9ab75b0..1f70045ea0 100644 --- a/cardano-api/internal/Cardano/Api/Certificate.hs +++ b/cardano-api/internal/Cardano/Api/Certificate.hs @@ -20,12 +20,16 @@ module Cardano.Api.Certificate ( -- * Registering stake address and delegating StakeAddressRequirements(..), + StakeDelegationRequirements(..), + makeStakeAddressDelegationCertificate, makeStakeAddressRegistrationCertificate, makeStakeAddressUnregistrationCertificate, makeStakeAddressPoolDelegationCertificate, PoolId, -- * Registering stake pools + StakePoolRegistrationRequirements(..), + StakePoolRetirementRequirements(..), makeStakePoolRegistrationCertificate, makeStakePoolRetirementCertificate, StakePoolParameters(..), @@ -33,6 +37,10 @@ module Cardano.Api.Certificate ( StakePoolMetadataReference(..), -- * Conway specific certificates + CommitteeColdkeyResignationRequirements(..), + CommitteeHotKeyAuthorizationRequirements(..), + DRepRegistrationRequirements(..), + DRepUnregistrationRequirements(..), makeCommitteeColdkeyResignationCertificate, makeCommitteeHotKeyAuthorizationCertificate, makeDrepRegistrationCertificate, @@ -42,6 +50,8 @@ module Cardano.Api.Certificate ( DRepMetadataReference(..), -- * Special certificates + GenesisKeyDelegationRequirements(..), + MirCertificateRequirements(..), makeMIRCertificate, makeGenesisKeyDelegationCertificate, Ledger.MIRTarget (..), @@ -532,7 +542,6 @@ makeStakePoolRetirementCertificate req = $ Ledger.mkRetirePoolTxCert (unStakePoolKeyHash poolId) retirementEpoch data GenesisKeyDelegationRequirements ere where - GenesisKeyDelegationRequirements :: ShelleyToBabbageEra era -> Hash GenesisKey diff --git a/cardano-api/internal/Cardano/Api/ReexposeLedger.hs b/cardano-api/internal/Cardano/Api/ReexposeLedger.hs index 369d4ff546..7f252649a2 100644 --- a/cardano-api/internal/Cardano/Api/ReexposeLedger.hs +++ b/cardano-api/internal/Cardano/Api/ReexposeLedger.hs @@ -17,7 +17,10 @@ module Cardano.Api.ReexposeLedger , EraTxCert(..) -- Core + , Coin (..) , PoolCert(..) + , addDeltaCoin + , toDeltaCoin , toEraCBOR , fromEraCBOR @@ -53,6 +56,7 @@ import Cardano.Ledger.Api import Cardano.Ledger.BaseTypes (DnsName, Url, boundRational, dnsToText, maybeToStrictMaybe, portToWord16, strictMaybeToMaybe, textToDns, textToUrl, unboundRational, urlToText) +import Cardano.Ledger.Coin (Coin (..), addDeltaCoin, toDeltaCoin) import Cardano.Ledger.Conway.TxCert (ConwayCommitteeCert (..), ConwayDelegCert (..), ConwayEraTxCert (..), ConwayTxCert (..)) import Cardano.Ledger.Core (PoolCert (..), fromEraCBOR, toEraCBOR) diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index a90d5b4716..9389e8e804 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -392,6 +392,8 @@ module Cardano.Api ( -- unregistering stake address, and for setting the stake pool delegation -- choice for a stake address. StakeAddressRequirements(..), + StakeDelegationRequirements(..), + makeStakeAddressDelegationCertificate, makeStakeAddressRegistrationCertificate, makeStakeAddressUnregistrationCertificate, makeStakeAddressPoolDelegationCertificate, @@ -399,6 +401,8 @@ module Cardano.Api ( -- ** Registering stake pools -- | Certificates that are embedded in transactions for registering and -- retiring stake pools. This includes updating the stake pool parameters. + StakePoolRegistrationRequirements(..), + StakePoolRetirementRequirements(..), makeStakePoolRegistrationCertificate, makeStakePoolRetirementCertificate, StakePoolParameters, @@ -790,6 +794,8 @@ module Cardano.Api ( -- * Special transactions -- | There are various additional things that can be embedded in a -- transaction for special operations. + GenesisKeyDelegationRequirements(..), + MirCertificateRequirements(..), makeMIRCertificate, makeGenesisKeyDelegationCertificate, MIRTarget (..), @@ -909,6 +915,10 @@ module Cardano.Api ( validateAndHashDRepMetadata, -- ** Governance related certificates + CommitteeColdkeyResignationRequirements(..), + CommitteeHotKeyAuthorizationRequirements(..), + DRepRegistrationRequirements(..), + DRepUnregistrationRequirements(..), makeCommitteeColdkeyResignationCertificate, makeCommitteeHotKeyAuthorizationCertificate, makeDrepRegistrationCertificate, diff --git a/cardano-api/src/Cardano/Api/Shelley.hs b/cardano-api/src/Cardano/Api/Shelley.hs index e8d0cce11c..d698c7eb9a 100644 --- a/cardano-api/src/Cardano/Api/Shelley.hs +++ b/cardano-api/src/Cardano/Api/Shelley.hs @@ -269,8 +269,11 @@ module Cardano.Api.Shelley fromAlonzoCostModels, --TODO: arrange not to export these toShelleyNetwork, + obtainCryptoConstraints, obtainEraConstraints, obtainEraPParamsConstraint, + obtainEraCryptoConstraints, + fromShelleyPoolParams, ) where