-
Notifications
You must be signed in to change notification settings - Fork 16
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
Share MIR certificates code between era-based and legacy CLI parsers #107
Share MIR certificates code between era-based and legacy CLI parsers #107
Conversation
23ec84e
to
9ba52a8
Compare
] | ||
|
||
pAnyShelleyToBabbageEra :: EnvCli -> Parser AnyShelleyToBabbageEra | ||
pAnyShelleyToBabbageEra envCli = |
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.
This is used to accept shelley-to-babbage era flags in the legacy parser.
@@ -20,6 +25,17 @@ import qualified Options.Applicative as Opt | |||
data EraBasedGovernanceCmd era | |||
= EraBasedGovernancePreConwayCmd (ShelleyToBabbageEra era) | |||
| EraBasedGovernancePostConwayCmd (ConwayEraOnwards era) | |||
| EraBasedGovernanceMIRPayStakeAddressesCertificate | |||
(ShelleyToBabbageEra 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.
We use the ShelleyToBabbageEra
witness in the era-based parsers.
data GovernanceCmd | ||
= GovernanceVoteCmd VoteCmd | ||
| GovernanceActionCmd ActionCmd | ||
| GovernanceMIRPayStakeAddressesCertificate | ||
AnyShelleyBasedEra | ||
AnyShelleyToBabbageEra |
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.
We use AnyShelleyToBabbageEra
in the legacy parsers.
[ Opt.long "transfer" | ||
, Opt.metavar "LOVELACE" | ||
, Opt.help "The amount to transfer." | ||
] |
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.
These parsers are shared.
|
||
right $ Ledger.DelegStake $ obtainIsShelleyBasedEraConwayOnwards cOnwards kHash | ||
TargetVotingDrep _ -> error "TODO: Conway era - Ledger.DelegVote" | ||
TargetVotingDrepAndStakePool _ -> error "TODO: Conway era - Ledger.DelegStakeVote" |
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.
This code has been moved into the era-based module structure.
ShelleyBasedEraBabbage -> do | ||
return $ MirCertificateRequirements ShelleyToBabbageEraBabbage mirPot mirTarget | ||
ShelleyBasedEraConway -> | ||
Left ShelleyGovernanceCmdMIRCertNotSupportedInConway |
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.
This function is gone because there is not longer a runtime error due to --conway-era
flag being used. This flag does not exist for commands that don't work for Conway era.
@@ -4,7 +4,7 @@ | |||
{-# LANGUAGE TypeApplications #-} | |||
|
|||
module Cardano.CLI.EraBased.Certificate | |||
( runAnyDelegationTarget | |||
( runGovernanceDelegrationCertificate |
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.
Spelling: runGovernanceDelegationCertificate
@@ -21,7 +21,7 @@ import Options.Applicative (Parser) | |||
import qualified Options.Applicative as Opt | |||
|
|||
data AnyEraCommand where | |||
AnyEraCommandOf :: CardanoEra era -> EraBasedCommand era -> AnyEraCommand | |||
AnyEraCommandOf :: ShelleyBasedEra era -> EraBasedCommand era -> AnyEraCommand |
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.
We should rename to AnyShelleyBasedEraCommandOf
or something like that
9ba52a8
to
7275232
Compare
b47d513
to
ca04fd5
Compare
ec6e257
to
07a2203
Compare
Changelog
Context
Checklist
See Runnings tests for more details
.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7
Note on CI
If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.