Skip to content

Commit

Permalink
Merge #2145
Browse files Browse the repository at this point in the history
2145: Prefer Shelley CLI commands over Byron ones where they clash r=dcoutts a=dcoutts

We have done a fair bit of shuffling of CLI commands over time, and have
kept the old commands for backwards compatibility.

There was a name clash over the "genesis" top level command: between the
Shelley command and the backwards compat Byron command.

Reorder the command lists so we prefer the new Shelley commands, and
generally the new ones over the old ones.

Co-authored-by: Duncan Coutts <duncan@well-typed.com>
  • Loading branch information
iohk-bors[bot] and dcoutts authored Nov 30, 2020
2 parents 13cc50b + 8c29016 commit 5ab5d00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cardano-cli/src/Cardano/CLI/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ pref = Opt.prefs showHelpOnEmpty
parseClientCommand :: Parser ClientCommand
parseClientCommand =
asum
[ parseByron <|> backwardsCompatibilityCommands
, parseShelley <|> parseDeprecatedShelleySubcommand
-- There are name clashes between Shelley commands and the Byron backwards
-- compat commands (e.g. "genesis"), and we need to prefer the Shelley ones
-- so we list it first.
[ parseShelley
, parseByron
, parseDeprecatedShelleySubcommand
, backwardsCompatibilityCommands
, parseDisplayVersion
]

Expand Down
4 changes: 3 additions & 1 deletion cardano-node-chairman/src/Testnet/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ testnet H.Conf {..} = do

-- Generate keys
void $ H.execCli
[ "genesis"
[ "byron"
, "genesis"
, "genesis"
, "--genesis-output-dir", tempAbsPath </> "genesis"
, "--start-time", showUTCTimeSeconds startTime
, "--protocol-parameters-file", tempAbsPath </> "protocol-params.json"
Expand Down
4 changes: 3 additions & 1 deletion cardano-node-chairman/src/Testnet/ByronShelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ testnet testnetOptions H.Conf {..} = do

-- stuff
void . H.execCli $
[ "genesis"
[ "byron"
, "genesis"
, "genesis"
, "--protocol-magic", show @Int testnetMagic
, "--start-time", showUTCTimeSeconds startTime
, "--k", show @Int securityParam
Expand Down

0 comments on commit 5ab5d00

Please sign in to comment.