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

Support constructing DRep update certificates #421

Merged
merged 1 commit into from
Feb 7, 2024
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
17 changes: 17 additions & 0 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ module Cardano.Api.Certificate (
CommitteeHotKeyAuthorizationRequirements(..),
DRepRegistrationRequirements(..),
DRepUnregistrationRequirements(..),
DRepUpdateRequirements(..),
makeCommitteeColdkeyResignationCertificate,
makeCommitteeHotKeyAuthorizationCertificate,
makeDrepRegistrationCertificate,
makeDrepUnregistrationCertificate,
makeDrepUpdateCertificate,

makeStakeAddressAndDRepDelegationCertificate,

Expand Down Expand Up @@ -466,6 +468,21 @@ makeStakeAddressAndDRepDelegationCertificate w cred delegatee deposit =
delegatee
(toShelleyLovelace deposit)

data DRepUpdateRequirements era where
DRepUpdateRequirements
:: ConwayEraOnwards era
-> Ledger.Credential Ledger.DRepRole (EraCrypto (ShelleyLedgerEra era))
-> DRepUpdateRequirements era

makeDrepUpdateCertificate
:: DRepUpdateRequirements era
-> Maybe (Ledger.Anchor (EraCrypto (ShelleyLedgerEra era)))
-> Certificate era
makeDrepUpdateCertificate (DRepUpdateRequirements conwayOnwards vcred) mAnchor =
ConwayCertificate conwayOnwards
. Ledger.ConwayTxCertGov
$ Ledger.ConwayUpdateDRep vcred (noInlineMaybeToStrictMaybe mAnchor)

-- ----------------------------------------------------------------------------
-- Helper functions
--
Expand Down
2 changes: 2 additions & 0 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,12 @@ module Cardano.Api (
CommitteeHotKeyAuthorizationRequirements(..),
DRepRegistrationRequirements(..),
DRepUnregistrationRequirements(..),
DRepUpdateRequirements(..),
makeCommitteeColdkeyResignationCertificate,
makeCommitteeHotKeyAuthorizationCertificate,
makeDrepRegistrationCertificate,
makeDrepUnregistrationCertificate,
makeDrepUpdateCertificate,

ResolvablePointers(..),
) where
Expand Down
Loading