Skip to content

Commit

Permalink
Add script support when making hot key authorization certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Mar 11, 2024
1 parent 1ef5226 commit a394707
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,17 @@ makeDrepRegistrationCertificate (DRepRegistrationRequirements conwayOnwards vcre
data CommitteeHotKeyAuthorizationRequirements era where
CommitteeHotKeyAuthorizationRequirements
:: ConwayEraOnwards era
-> Ledger.KeyHash Ledger.ColdCommitteeRole (EraCrypto (ShelleyLedgerEra era))
-> Ledger.KeyHash Ledger.HotCommitteeRole (EraCrypto (ShelleyLedgerEra era))
-> Ledger.Credential Ledger.ColdCommitteeRole (EraCrypto (ShelleyLedgerEra era))
-> Ledger.Credential Ledger.HotCommitteeRole (EraCrypto (ShelleyLedgerEra era))
-> CommitteeHotKeyAuthorizationRequirements era

makeCommitteeHotKeyAuthorizationCertificate :: ()
=> CommitteeHotKeyAuthorizationRequirements era
-> Certificate era
makeCommitteeHotKeyAuthorizationCertificate (CommitteeHotKeyAuthorizationRequirements cOnwards coldKeyHash hotKeyHash) =
makeCommitteeHotKeyAuthorizationCertificate (CommitteeHotKeyAuthorizationRequirements cOnwards coldKeyCredential hotKeyCredential) =
ConwayCertificate cOnwards
. Ledger.ConwayTxCertGov
$ Ledger.ConwayAuthCommitteeHotKey
(Ledger.KeyHashObj coldKeyHash)
(Ledger.KeyHashObj hotKeyHash)
$ Ledger.ConwayAuthCommitteeHotKey coldKeyCredential hotKeyCredential

data CommitteeColdkeyResignationRequirements era where
CommitteeColdkeyResignationRequirements
Expand Down
6 changes: 6 additions & 0 deletions cardano-api/internal/Cardano/Api/Monad/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Cardano.Api.Monad.Error
, modifyError
, handleIOExceptionsWith
, handleIOExceptionsLiftWith
, hoistIOEither

, module Control.Monad.Except
, module Control.Monad.IO.Class
Expand Down Expand Up @@ -81,3 +82,8 @@ liftExceptT :: MonadTransError e t m
-> t m a
liftExceptT = modifyError id


hoistIOEither :: MonadIOTransError e t m
=> IO (Either e a)
-> t m a
hoistIOEither = liftExceptT . ExceptT . liftIO

0 comments on commit a394707

Please sign in to comment.