Add --key-output-bech32/--key-output-text-envelope to governance key-gen commands#1378
Conversation
…gen commands Adds key output format flags to drep key-gen, committee key-gen-cold, and committee key-gen-hot, matching the existing address key-gen behaviour. Closes #1165
ba3cacb to
12acd09
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for selecting the output format (text envelope vs bech32) when generating Governance DRep and Committee keys, and updates the CLI golden help fixtures accordingly. It also wires the new keyOutputFormat argument through testnet-data generation so internal key generation uses the same output format as elsewhere.
Changes:
- Add
--key-output-bech32/--key-output-text-envelope(and deprecated--key-output-format) to governance DRep and Committeekey-gen*commands. - Update DRep/Committee key-gen run logic to write keys as either Bech32 text or TextEnvelope JSON based on the selected format.
- Refresh golden help outputs to include the new flags and updated usage rendering.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Command.hs | Adds keyOutputFormat to DRep key-gen command args. |
| cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Option.hs | Parses --key-output-* flags for DRep key-gen. |
| cardano-cli/src/Cardano/CLI/EraBased/Governance/DRep/Run.hs | Writes DRep keys in Bech32 or TextEnvelope depending on selected format. |
| cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Command.hs | Adds keyOutputFormat to Committee key-gen args and imports the format types. |
| cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Option.hs | Parses --key-output-* flags for Committee key-gen commands. |
| cardano-cli/src/Cardano/CLI/EraBased/Governance/Committee/Run.hs | Writes Committee keys in Bech32 or TextEnvelope depending on selected format. |
| cardano-cli/src/Cardano/CLI/EraBased/Genesis/CreateTestnetData/Run.hs | Updates internal Committee/DRep key-gen invocations to pass a key output format. |
| cardano-cli/test/cardano-cli-golden/files/golden/help.cli | Updates aggregated help usage sections to show the new format flags. |
| cardano-cli/test/cardano-cli-golden/files/golden/help/*governancekey-gen.cli | Updates per-command golden help output to include new options and usage formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jimbo4350
left a comment
There was a problem hiding this comment.
LGTM, one comment regarding adding a feature destined for deprecation.
| --key-output-bech32 Format key output to BECH32. | ||
| --key-output-text-envelope | ||
| Format key output to TEXT_ENVELOPE (default). | ||
| --key-output-format STRING |
There was a problem hiding this comment.
If the key-output-format will be deprecated in a future version why bother adding it again?
There was a problem hiding this comment.
It's --key-output-format STRING that's deprecated, not the new-style --key-output-bech32 / --key-output-text-envelope flags - those are the replacements.
This PR wires pKeyOutputFormat into the governance key-gen commands that were missing it.
The deprecated --key-output-format fallback comes along automatically as part of that same parser - pFormatFlagsExt combines both the new flags and the legacy parser for backwards compatibility.
So we're not re-adding anything deprecated - we're extending the new flags to commands that never had them.
Changelog
Context
Closes #1165
The
--key-output-bech32and--key-output-text-envelopeflags were added to some key-gen commands but were missing from the governance key-gen commands:cardano-cli <era> governance drep key-gencardano-cli <era> governance committee key-gen-coldcardano-cli <era> governance committee key-gen-hotThis PR adds the missing output format flags to those commands, making the behaviour consistent across all key-gen commands.
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