Skip to content

Commit

Permalink
Add --conway-era flag
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jun 13, 2023
1 parent 1f9f6db commit 7dd3183
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 24 deletions.
56 changes: 32 additions & 24 deletions cardano-cli/src/Cardano/CLI/Common/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,38 @@ import qualified Options.Applicative as Opt

pCardanoEra :: Parser AnyCardanoEra
pCardanoEra = asum
[ Opt.flag' (AnyCardanoEra ByronEra)
( Opt.long "byron-era"
<> Opt.help "Specify the Byron era"
)
, Opt.flag' (AnyCardanoEra ShelleyEra)
( Opt.long "shelley-era"
<> Opt.help "Specify the Shelley era"
)
, Opt.flag' (AnyCardanoEra AllegraEra)
( Opt.long "allegra-era"
<> Opt.help "Specify the Allegra era"
)
, Opt.flag' (AnyCardanoEra MaryEra)
( Opt.long "mary-era"
<> Opt.help "Specify the Mary era"
)
, Opt.flag' (AnyCardanoEra AlonzoEra)
( Opt.long "alonzo-era"
<> Opt.help "Specify the Alonzo era"
)
, Opt.flag' (AnyCardanoEra BabbageEra)
( Opt.long "babbage-era"
<> Opt.help "Specify the Babbage era (default)"
)
[ Opt.flag' (AnyCardanoEra ByronEra) $ mconcat
[ Opt.long "byron-era"
, Opt.help "Specify the Byron era"
]
, Opt.flag' (AnyCardanoEra ShelleyEra) $ mconcat
[ Opt.long "shelley-era"
, Opt.help "Specify the Shelley era"
]
, Opt.flag' (AnyCardanoEra AllegraEra) $ mconcat
[ Opt.long "allegra-era"
, Opt.help "Specify the Allegra era"
]
, Opt.flag' (AnyCardanoEra MaryEra) $ mconcat
[ Opt.long "mary-era"
, Opt.help "Specify the Mary era"
]
, Opt.flag' (AnyCardanoEra AlonzoEra) $ mconcat
[ Opt.long "alonzo-era"
, Opt.help "Specify the Alonzo era"
]
, Opt.flag' (AnyCardanoEra BabbageEra) $ mconcat
[ Opt.long "babbage-era"
, Opt.help "Specify the Babbage era (default)"
]
, Opt.flag' (AnyCardanoEra ConwayEra) $ mconcat
[ Opt.long "conway-era"
, Opt.help "Specify the Conway era"
]

-- NEW-ERA-ADD-NEW: When a new era is added, add a new flag here.
-- NEW-ERA-SET-DEFAULT: When a new era is working, select a new default above and below.

-- Default for now:
, pure (AnyCardanoEra BabbageEra)
]
Expand Down
4 changes: 4 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ Usage: cardano-cli transaction build-raw
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--script-valid | --script-invalid]
(--tx-in TX-IN
Expand Down Expand Up @@ -680,6 +681,7 @@ Usage: cardano-cli transaction build --socket-path SOCKET_PATH
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[ --shelley-mode
| --byron-mode [--epoch-slots SLOTS]
Expand Down Expand Up @@ -845,6 +847,7 @@ Usage: cardano-cli transaction calculate-min-required-utxo
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
--protocol-params-file FILE
--tx-out ADDRESS VALUE
Expand All @@ -870,6 +873,7 @@ Usage: cardano-cli transaction calculate-min-value
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
--protocol-params-file FILE
--tx-out ADDRESS VALUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Usage: cardano-cli transaction build-raw
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--script-valid | --script-invalid]
(--tx-in TX-IN
Expand Down Expand Up @@ -123,6 +124,7 @@ Available options:
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--script-valid Assertion that the script is valid. (default)
--script-invalid Assertion that the script is invalid. If a
transaction is submitted with such a script, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Usage: cardano-cli transaction build --socket-path SOCKET_PATH
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[ --shelley-mode
| --byron-mode [--epoch-slots SLOTS]
Expand Down Expand Up @@ -123,6 +124,7 @@ Available options:
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--shelley-mode For talking to a node running in Shelley-only mode.
--byron-mode For talking to a node running in Byron-only mode.
--epoch-slots SLOTS The number of slots per epoch for the Byron era.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Usage: cardano-cli transaction calculate-min-required-utxo
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
--protocol-params-file FILE
--tx-out ADDRESS VALUE
Expand All @@ -30,6 +31,7 @@ Available options:
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--protocol-params-file FILE
Filepath of the JSON-encoded protocol parameters file
--tx-out ADDRESS VALUE The transaction output as ADDRESS VALUE where ADDRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Usage: cardano-cli transaction calculate-min-value
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
--protocol-params-file FILE
--tx-out ADDRESS VALUE
Expand All @@ -30,6 +31,7 @@ Available options:
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--protocol-params-file FILE
Filepath of the JSON-encoded protocol parameters file
--tx-out ADDRESS VALUE The transaction output as ADDRESS VALUE where ADDRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Usage: cardano-testnet cardano [--num-bft-nodes COUNT]
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--epoch-length MILLISECONDS]
[--slot-length SECONDS]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Usage: cardano-testnet cardano [--num-bft-nodes COUNT]
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--epoch-length MILLISECONDS]
[--slot-length SECONDS]
Expand All @@ -28,6 +29,7 @@ Available options:
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--epoch-length MILLISECONDS
Epoch length (default: 1500)
--slot-length SECONDS Slot length (default: 0.2)
Expand Down

0 comments on commit 7dd3183

Please sign in to comment.