Skip to content

Commit

Permalink
Expose new conway certificate constructor functions:
Browse files Browse the repository at this point in the history
  makeCommitteeColdkeyResignationCertificate
  makeCommitteeHotKeyAuthorizationCertificate
  makeDrepRegistrationCertificate
  makeDrepUnregistrationCertificate

Re-export ledger types:
  MIRTarget
  MIRPot

Import Cardano.Api.ReexposeLedger with the aim of consolidating all of
the ledger modules cardano-api depends on. This will make it easier to
hand off the cardano-api's ledger functionality to the ledger team.
  • Loading branch information
Jimbo4350 committed Jul 17, 2023
1 parent 6c6a588 commit 37b899a
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
Expand All @@ -16,8 +19,9 @@ module Cardano.Api.Certificate (
Certificate(..),

-- * Registering stake address and delegating
StakeAddressRequirements(..),
makeStakeAddressRegistrationCertificate,
makeStakeAddressDeregistrationCertificate,
makeStakeAddressUnregistrationCertificate,
makeStakeAddressPoolDelegationCertificate,
PoolId,

Expand All @@ -28,16 +32,20 @@ module Cardano.Api.Certificate (
StakePoolRelay(..),
StakePoolMetadataReference(..),

makeCommitteeDelegationCertificate,
makeCommitteeHotKeyUnregistrationCertificate,
-- * Conway specific certificates
makeCommitteeColdkeyResignationCertificate,
makeCommitteeHotKeyAuthorizationCertificate,
makeDrepRegistrationCertificate,
makeDrepUnregistrationCertificate,

-- * Registering DReps
DRepMetadataReference(..),

-- * Special certificates
makeMIRCertificate,
makeGenesisKeyDelegationCertificate,
MIRTarget (..),
Ledger.MIRTarget (..),
Ledger.MIRPot(..),

-- * Internal conversion functions
toShelleyCertificate,
Expand All @@ -46,39 +54,36 @@ module Cardano.Api.Certificate (
fromShelleyPoolParams,

-- * Data family instances
AsType(..)
AsType(..),

-- * GADTs for Conway/Shelley differences
AtMostBabbageEra(..),
ConwayEraOnwards(..),

-- * Internal functions
filterUnRegCreds,
selectStakeCredential,
) where

import Cardano.Api.Address
import Cardano.Api.DRepMetadata
import Cardano.Api.EraCast
import Cardano.Api.Eras
import Cardano.Api.Governance.Actions.VotingProcedure
import Cardano.Api.HasTypeProxy
import Cardano.Api.Keys.Praos
import Cardano.Api.Keys.Shelley
import Cardano.Api.ReexposeLedger (EraCrypto, StandardCrypto)
import qualified Cardano.Api.ReexposeLedger as Ledger
import Cardano.Api.SerialiseCBOR
import Cardano.Api.SerialiseTextEnvelope
import Cardano.Api.StakePoolMetadata
import Cardano.Api.Utils
import Cardano.Api.Value

import qualified Cardano.Crypto.Hash.Class as Crypto
import qualified Cardano.Ledger.Api.Era as L
import Cardano.Ledger.BaseTypes (maybeToStrictMaybe, strictMaybeToMaybe)
import qualified Cardano.Ledger.BaseTypes as Shelley
import qualified Cardano.Ledger.Coin as Shelley (toDeltaCoin)
import qualified Cardano.Ledger.Conway.TxCert as Conway
import qualified Cardano.Ledger.Core as Shelley
import Cardano.Ledger.Crypto (StandardCrypto)
import Cardano.Ledger.Shelley.TxBody (MIRPot (..))
import qualified Cardano.Ledger.Shelley.TxBody as Shelley
import qualified Cardano.Ledger.Shelley.TxCert as Shelley
import Cardano.Slotting.Slot (EpochNo (..))

import Data.ByteString (ByteString)
import qualified Data.Foldable as Foldable
import Data.IP (IPv4, IPv6)
import qualified Data.Map.Strict as Map
import Data.Maybe
import qualified Data.Sequence.Strict as Seq
import qualified Data.Set as Set
Expand Down

0 comments on commit 37b899a

Please sign in to comment.