Skip to content

Commit

Permalink
Merge pull request #421 from IntersectMBO/ch/support-drep-update
Browse files Browse the repository at this point in the history
Support constructing DRep update certificates
  • Loading branch information
smelc authored Feb 7, 2024
2 parents f207b42 + 4607fb5 commit 2119697
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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

0 comments on commit 2119697

Please sign in to comment.