-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make governance action create-protocol-parameters-update
Conway onwards only
#366
Make governance action create-protocol-parameters-update
Conway onwards only
#366
Conversation
@@ -14,7 +13,6 @@ Available options: | |||
Available commands: | |||
create-mir-certificate Create an MIR (Move Instantaneous Rewards) | |||
certificate | |||
action Governance action commands. |
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 change shows the benefit of allowing commands and command groups to decide for themselves if they appear in an era.
All I did was make governance action create-protocol-parameters-update
Conway onwards only.
Then the action
command figured out that it was empty for all the pre-Conway eras and decided to not appear in those eras.
governance actions
commandsgovernance action create-protocol-parameters-update
Conway onwards only
@@ -24,89 +27,88 @@ import Data.Text (Text) | |||
import Data.Word | |||
|
|||
data GovernanceActionCmds 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.
I take it this is (part of) the new conventions you allude to here?
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.
Yep
@@ -10,7 +10,7 @@ import Cardano.Api | |||
import Cardano.Api.Ledger | |||
import Cardano.Api.Shelley | |||
|
|||
import Cardano.CLI.EraBased.Commands.Governance.Actions | |||
import qualified Cardano.CLI.EraBased.Commands.Governance.Actions as Cmd |
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.
And this qualified import as well, part of the new convention?
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.
The Cmd
qualification allows us to avoid naming conflicts. For example in the records we have an eon
field which if imported unqualified will name conflict with a lot of code.
, ucPreviousGovActionId :: Maybe (TxId, Word32) | ||
, ucFilePath :: File () Out | ||
} deriving Show | ||
{ networkId :: !Ledger.Network |
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.
So I take that having multiple fields with the same name in a module is allowed by our coding style now?
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.
I think this is okay for command argument types because the qualifications and record field matching allows us to avoid naming conflicts.
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.
LGTM 🍾 Really nice that you have well defined commits, makes it possible to review iteratively.
d6b3bdf
to
42326f9
Compare
Changelog
Context
This also converts to use command argument types for
governance actions
commands.Checklist
See Running 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