-
Notifications
You must be signed in to change notification settings - Fork 22
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
Remove uses of coerceKeyRole
, use asWitness
/ fromWitness
when key role conversion is required
#341
Conversation
5a21eaa
to
2626cce
Compare
Just . Ledger.coerceKeyRole . Ledger.KeyHashObj $ Ledger.ppId poolParams | ||
Ledger.RetirePoolTxCert poolId _ -> | ||
Just . Ledger.coerceKeyRole $ Ledger.KeyHashObj poolId | ||
Ledger.RegPoolTxCert _ -> Nothing -- StakePool should never be a credential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, we can't use StakePool
as credentials, hence it gets skipped here. https://input-output-rnd.slack.com/archives/G011N23CEAE/p1698229398676999?thread_ts=1698227871.191609&cid=G011N23CEAE
0ab6808
to
845ac2d
Compare
data Voter era | ||
= VoterCommittee (VotingCredential era) -- ^ Constitutional committee | ||
| VoterDRep (VotingCredential era) -- ^ Delegated representative | ||
| VoterSpo (Hash StakePoolKey) -- ^ Stake pool operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voter
is isomorphic to ledger's Voter
so we could use just a newtype wrapper here. This way we can remove manual CBOR instances and bunch of boilerplate.
I'm not sure about the last constructor. Do we need to use Hash
type family in cardano-api?
= VoterCommittee (VotingCredential era) -- ^ Constitutional committee | ||
| VoterDRep (VotingCredential era) -- ^ Delegated representative | ||
| VoterSpo (Hash StakePoolKey) -- ^ Stake pool operator | ||
newtype Voter era = Voter (Ledger.Voter (L.EraCrypto (ShelleyLedgerEra era))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
- check how much this affects cardano-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coerceKeyRole
, use asWitness
/ fromWitness
when key role conversion is required
04564ef
to
c6a6c7e
Compare
c6a6c7e
to
f9071e5
Compare
Just . Ledger.coerceKeyRole . Ledger.KeyHashObj $ Ledger.ppId poolParams | ||
Ledger.RetirePoolTxCert poolId _ -> | ||
Just . Ledger.coerceKeyRole $ Ledger.KeyHashObj poolId | ||
-- StakePool is always controlled by key, i.e. it is never a script. In other words, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asked a question in #ledger as I don't know if there are plans to allow registering stake pools with scripts.
…key role conversion is required
f9071e5
to
1eef008
Compare
New version cardano-cli-8.12.0.0
Changelog
Context
Reason for the change: https://github.com/input-output-hk/cardano-api/pull/268/files#r1337448193
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist