Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DRep reg certificate anchor types from cardano-cli to cardano-api #305

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ library internal
-- to expose new functionality is via Cardano.Api or
-- Cardano.Api.Shelley
exposed-modules: Cardano.Api.Address
Cardano.Api.Anchor
Cardano.Api.Block
Cardano.Api.Certificate
Cardano.Api.Convenience.Construction
Expand Down
19 changes: 19 additions & 0 deletions cardano-api/internal/Cardano/Api/Anchor.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Cardano.Api.Anchor (
AnchorUrl(..),
AnchorDataHash(..)
) where

import qualified Cardano.Ledger.BaseTypes as L
import qualified Cardano.Ledger.Crypto as Crypto
import qualified Cardano.Ledger.SafeHash as L


-- | The URL to build the anchor to pass to DRep registration certificate
newtype AnchorUrl = AnchorUrl
{ unAnchorUrl :: L.Url
} deriving (Eq, Show)

-- | The hash to build the anchor to pass to DRep registration certificate
newtype AnchorDataHash = AnchorDataHash
{ unAnchorDataHash :: L.SafeHash Crypto.StandardCrypto L.AnchorData
} deriving (Eq, Show)
3 changes: 3 additions & 0 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,8 @@ module Cardano.Api (
validateAndHashDRepMetadata,

-- ** Governance related certificates
AnchorDataHash(..),
AnchorUrl(..),
CommitteeColdkeyResignationRequirements(..),
CommitteeHotKeyAuthorizationRequirements(..),
DRepRegistrationRequirements(..),
Expand All @@ -1012,6 +1014,7 @@ module Cardano.Api (
) where

import Cardano.Api.Address
import Cardano.Api.Anchor
import Cardano.Api.Block
import Cardano.Api.Certificate
import Cardano.Api.Convenience.Construction
Expand Down