{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}

module Cardano.CLI.EraBased.Options.Governance.Actions
  ( pGovernanceActionCmds
  )
where

import           Cardano.Api
import qualified Cardano.Api.Ledger as L
import           Cardano.Api.Shelley

import qualified Cardano.CLI.EraBased.Commands.Governance.Actions as Cmd
import           Cardano.CLI.EraBased.Options.Common
import           Cardano.CLI.Parser
import           Cardano.CLI.Types.Common

import           Data.Foldable
import           GHC.Natural (Natural)
import           Options.Applicative
import qualified Options.Applicative as Opt

pGovernanceActionCmds
  :: ()
  => ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionCmds :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionCmds ShelleyBasedEra era
era =
  [Char]
-> InfoMod (GovernanceActionCmds era)
-> [Maybe (Parser (GovernanceActionCmds era))]
-> Maybe (Parser (GovernanceActionCmds era))
forall a.
[Char] -> InfoMod a -> [Maybe (Parser a)] -> Maybe (Parser a)
subInfoParser
    [Char]
"action"
    ( [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc ([Char] -> InfoMod (GovernanceActionCmds era))
-> [Char] -> InfoMod (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
        [[Char]] -> [Char]
forall a. Monoid a => [a] -> a
mconcat
          [ [Char]
"Governance action commands."
          ]
    )
    [ ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewConstitutionCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionUpdateCommitteeCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewInfoCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNoConfidenceCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionProtocolParametersUpdateCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionTreasuryWithdrawalCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionHardforkInitCmd ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionViewCmd ShelleyBasedEra era
era
    ]

pGovernanceActionViewCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionViewCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionViewCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (m :: * -> *) a. Monad m => a -> m a
return
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"view"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionViewCmdArgs era -> GovernanceActionCmds era)
-> Parser (GovernanceActionViewCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionViewCmdArgs era -> GovernanceActionCmds era
forall era.
GovernanceActionViewCmdArgs era -> GovernanceActionCmds era
Cmd.GovernanceActionViewCmd (Parser (GovernanceActionViewCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionViewCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> ProposalFile 'In
-> ViewOutputFormat
-> Maybe (File () 'Out)
-> GovernanceActionViewCmdArgs era
forall era.
ConwayEraOnwards era
-> ProposalFile 'In
-> ViewOutputFormat
-> Maybe (File () 'Out)
-> GovernanceActionViewCmdArgs era
Cmd.GovernanceActionViewCmdArgs ConwayEraOnwards era
eon
            (ProposalFile 'In
 -> ViewOutputFormat
 -> Maybe (File () 'Out)
 -> GovernanceActionViewCmdArgs era)
-> Parser (ProposalFile 'In)
-> Parser
     (ViewOutputFormat
      -> Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> [Char] -> Parser (ProposalFile 'In)
forall a. [Char] -> [Char] -> Parser (File a 'In)
pFileInDirection [Char]
"action-file" [Char]
"Path to action file."
            Parser
  (ViewOutputFormat
   -> Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
-> Parser ViewOutputFormat
-> Parser (Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ViewOutputFormat
pGovernanceActionViewOutputFormat
            Parser (Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (GovernanceActionViewCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"View a governance action."

pGovernanceActionNewInfoCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNewInfoCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewInfoCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-info"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionInfoCmdArgs era -> GovernanceActionCmds era)
-> Parser (GovernanceActionInfoCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionInfoCmdArgs era -> GovernanceActionCmds era
forall era.
GovernanceActionInfoCmdArgs era -> GovernanceActionCmds era
Cmd.GovernanceActionInfoCmd (Parser (GovernanceActionInfoCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionInfoCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> File () 'Out
-> GovernanceActionInfoCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> File () 'Out
-> GovernanceActionInfoCmdArgs era
Cmd.GovernanceActionInfoCmdArgs ConwayEraOnwards era
eon
            (Network
 -> Lovelace
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> File () 'Out
 -> GovernanceActionInfoCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> File () 'Out
      -> GovernanceActionInfoCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Lovelace
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> File () 'Out
      -> GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> File () 'Out
      -> GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> File () 'Out
      -> GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> File () 'Out -> GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> File () 'Out -> GovernanceActionInfoCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser (File () 'Out -> GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
            Parser (File () 'Out -> GovernanceActionInfoCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionInfoCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser (File () 'Out)
forall a. [Char] -> [Char] -> Parser (File a 'Out)
pFileOutDirection [Char]
"out-file" [Char]
"Path to action file to be used later on with build or build-raw "
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create an info action."

pGovernanceActionNewConstitutionCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNewConstitutionCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewConstitutionCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-constitution"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionCreateConstitutionCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionCreateConstitutionCmdArgs era
-> GovernanceActionCmds era
forall era.
GovernanceActionCreateConstitutionCmdArgs era
-> GovernanceActionCmds era
Cmd.GovernanceActionCreateConstitutionCmd (Parser (GovernanceActionCreateConstitutionCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> Maybe (TxId, Word16)
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> ConstitutionUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ConstitutionUrl
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionCreateConstitutionCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> Maybe (TxId, Word16)
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> ConstitutionUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ConstitutionUrl
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionCreateConstitutionCmdArgs era
Cmd.GovernanceActionCreateConstitutionCmdArgs ConwayEraOnwards era
eon
            (Network
 -> Lovelace
 -> StakeIdentifier
 -> Maybe (TxId, Word16)
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> ConstitutionUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ConstitutionUrl
 -> Maybe ScriptHash
 -> File () 'Out
 -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Lovelace
   -> StakeIdentifier
   -> Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
            Parser
  (Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (Maybe (TxId, Word16))
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction
            Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (ConstitutionUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
            Parser
  (ConstitutionUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser ConstitutionUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ConstitutionUrl
pConstitutionUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ConstitutionUrl
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pConstitutionHash
            Parser
  (MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (MustCheckHash ConstitutionUrl)
-> Parser
     (Maybe ScriptHash
      -> File () 'Out -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ConstitutionUrl)
pMustCheckConstitutionHash
            Parser
  (Maybe ScriptHash
   -> File () 'Out -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (Maybe ScriptHash)
-> Parser
     (File () 'Out -> GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ScriptHash -> Parser (Maybe ScriptHash)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ScriptHash
pConstitutionScriptHash
            Parser
  (File () 'Out -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionCreateConstitutionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser (File () 'Out)
forall a. [Char] -> [Char] -> Parser (File a 'Out)
pFileOutDirection [Char]
"out-file" [Char]
"Output filepath of the constitution."
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a constitution."

pGovernanceActionUpdateCommitteeCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionUpdateCommitteeCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionUpdateCommitteeCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"update-committee"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( GovernanceActionUpdateCommitteeCmdArgs era
-> GovernanceActionCmds era
forall era.
GovernanceActionUpdateCommitteeCmdArgs era
-> GovernanceActionCmds era
Cmd.GovernanceActionUpdateCommitteeCmd
          (GovernanceActionUpdateCommitteeCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era
-> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
forall era.
ConwayEraOnwards era
-> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd ConwayEraOnwards era
eon
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create or update a new committee proposal."

pUpdateCommitteeCmd
  :: ()
  => ConwayEraOnwards era
  -> Parser (Cmd.GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd :: forall era.
ConwayEraOnwards era
-> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd ConwayEraOnwards era
eon =
  ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo)]
-> Rational
-> Maybe (TxId, Word16)
-> File () 'Out
-> GovernanceActionUpdateCommitteeCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo)]
-> Rational
-> Maybe (TxId, Word16)
-> File () 'Out
-> GovernanceActionUpdateCommitteeCmdArgs era
Cmd.GovernanceActionUpdateCommitteeCmdArgs ConwayEraOnwards era
eon
    (Network
 -> Lovelace
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
 -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
      EpochNo)]
 -> Rational
 -> Maybe (TxId, Word16)
 -> File () 'Out
 -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
    Parser
  (Lovelace
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
    Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
    Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
    Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
    Parser
  (MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     ([VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
    Parser
  ([VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser
     [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> Parser
     ([(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
      -> Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
-> Parser
     [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
pRemoveCommitteeColdVerificationKeySource
    Parser
  ([(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo)]
   -> Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser
     [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
       EpochNo)]
-> Parser
     (Rational
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser
  (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey, EpochNo)
-> Parser
     [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
       EpochNo)]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many
      ( (,)
          (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey
 -> EpochNo
 -> (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo))
-> Parser
     (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
-> Parser
     (EpochNo
      -> (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
          EpochNo))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
pAddCommitteeColdVerificationKeySource
          Parser
  (EpochNo
   -> (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
       EpochNo))
-> Parser EpochNo
-> Parser
     (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey, EpochNo)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> Parser EpochNo
pEpochNo [Char]
"Committee member expiry epoch"
      )
    Parser
  (Rational
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Rational
-> Parser
     (Maybe (TxId, Word16)
      -> File () 'Out -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser Rational
pRational [Char]
"threshold" [Char]
"Threshold of YES votes that are necessary for approving a governance action."
    Parser
  (Maybe (TxId, Word16)
   -> File () 'Out -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (Maybe (TxId, Word16))
-> Parser
     (File () 'Out -> GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction
    Parser (File () 'Out -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (File () 'Out)
forall content. Parser (File content 'Out)
pOutputFile

pGovernanceActionNoConfidenceCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNoConfidenceCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNoConfidenceCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-no-confidence"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionCreateNoConfidenceCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionCreateNoConfidenceCmdArgs era
-> GovernanceActionCmds era
forall era.
GovernanceActionCreateNoConfidenceCmdArgs era
-> GovernanceActionCmds era
Cmd.GovernanceActionCreateNoConfidenceCmd (Parser (GovernanceActionCreateNoConfidenceCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> Maybe (TxId, Word16)
-> File () 'Out
-> GovernanceActionCreateNoConfidenceCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> Maybe (TxId, Word16)
-> File () 'Out
-> GovernanceActionCreateNoConfidenceCmdArgs era
Cmd.GovernanceActionCreateNoConfidenceCmdArgs ConwayEraOnwards era
eon
            (Network
 -> Lovelace
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> Maybe (TxId, Word16)
 -> File () 'Out
 -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Lovelace
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (Maybe (TxId, Word16)
      -> File () 'Out -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
            Parser
  (Maybe (TxId, Word16)
   -> File () 'Out -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (Maybe (TxId, Word16))
-> Parser
     (File () 'Out -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction
            Parser
  (File () 'Out -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionCreateNoConfidenceCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser (File () 'Out)
forall a. [Char] -> [Char] -> Parser (File a 'Out)
pFileOutDirection [Char]
"out-file" [Char]
"Output filepath of the no confidence proposal."
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a no confidence proposal."

pUpdateProtocolParametersPreConway
  :: ShelleyToBabbageEra era -> Parser (Cmd.UpdateProtocolParametersPreConway era)
pUpdateProtocolParametersPreConway :: forall era.
ShelleyToBabbageEra era
-> Parser (UpdateProtocolParametersPreConway era)
pUpdateProtocolParametersPreConway ShelleyToBabbageEra era
shelleyToBab =
  ShelleyToBabbageEra era
-> EpochNo
-> [VerificationKeyFile 'In]
-> UpdateProtocolParametersPreConway era
forall era.
ShelleyToBabbageEra era
-> EpochNo
-> [VerificationKeyFile 'In]
-> UpdateProtocolParametersPreConway era
Cmd.UpdateProtocolParametersPreConway ShelleyToBabbageEra era
shelleyToBab
    (EpochNo
 -> [VerificationKeyFile 'In]
 -> UpdateProtocolParametersPreConway era)
-> Parser EpochNo
-> Parser
     ([VerificationKeyFile 'In]
      -> UpdateProtocolParametersPreConway era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser EpochNo
pEpochNoUpdateProp
    Parser
  ([VerificationKeyFile 'In]
   -> UpdateProtocolParametersPreConway era)
-> Parser [VerificationKeyFile 'In]
-> Parser (UpdateProtocolParametersPreConway era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser [VerificationKeyFile 'In]
pProtocolParametersUpdateGenesisKeys

pUpdateProtocolParametersPostConway
  :: ConwayEraOnwards era -> Parser (Cmd.UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway :: forall era.
ConwayEraOnwards era
-> Parser (UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway ConwayEraOnwards era
conwayOnwards =
  ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> Maybe (TxId, Word16)
-> Maybe ScriptHash
-> UpdateProtocolParametersConwayOnwards era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> Maybe (TxId, Word16)
-> Maybe ScriptHash
-> UpdateProtocolParametersConwayOnwards era
Cmd.UpdateProtocolParametersConwayOnwards ConwayEraOnwards era
conwayOnwards
    (Network
 -> Lovelace
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> Maybe (TxId, Word16)
 -> Maybe ScriptHash
 -> UpdateProtocolParametersConwayOnwards era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
    Parser
  (Lovelace
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
    Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
    Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
    Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> Maybe (TxId, Word16)
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
    Parser
  (MustCheckHash ProposalUrl
   -> Maybe (TxId, Word16)
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (Maybe (TxId, Word16)
      -> Maybe ScriptHash -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
    Parser
  (Maybe (TxId, Word16)
   -> Maybe ScriptHash -> UpdateProtocolParametersConwayOnwards era)
-> Parser (Maybe (TxId, Word16))
-> Parser
     (Maybe ScriptHash -> UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction
    Parser
  (Maybe ScriptHash -> UpdateProtocolParametersConwayOnwards era)
-> Parser (Maybe ScriptHash)
-> Parser (UpdateProtocolParametersConwayOnwards era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ScriptHash -> Parser (Maybe ScriptHash)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ScriptHash
pConstitutionScriptHash

pUpdateProtocolParametersCmd
  :: ShelleyBasedEra era -> Parser (Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd :: forall era.
ShelleyBasedEra era
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd =
  (ShelleyToBabbageEraConstraints era =>
 ShelleyToBabbageEra era
 -> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> (ConwayEraOnwardsConstraints era =>
    ConwayEraOnwards era
    -> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> ShelleyBasedEra era
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall era a.
(ShelleyToBabbageEraConstraints era =>
 ShelleyToBabbageEra era -> a)
-> (ConwayEraOnwardsConstraints era => ConwayEraOnwards era -> a)
-> ShelleyBasedEra era
-> a
caseShelleyToBabbageOrConwayEraOnwards
    ( \ShelleyToBabbageEra era
shelleyToBab ->
        let sbe :: ShelleyBasedEra era
sbe = ShelleyToBabbageEra era -> ShelleyBasedEra era
forall era. ShelleyToBabbageEra era -> ShelleyBasedEra era
shelleyToBabbageEraToShelleyBasedEra ShelleyToBabbageEra era
shelleyToBab
         in [Char]
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-protocol-parameters-update"
              (ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
                ( ShelleyBasedEra era
-> Maybe (UpdateProtocolParametersPreConway era)
-> Maybe (UpdateProtocolParametersConwayOnwards era)
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
forall era.
ShelleyBasedEra era
-> Maybe (UpdateProtocolParametersPreConway era)
-> Maybe (UpdateProtocolParametersConwayOnwards era)
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
Cmd.GovernanceActionProtocolParametersUpdateCmdArgs
                    (ShelleyToBabbageEra era -> ShelleyBasedEra era
forall era. ShelleyToBabbageEra era -> ShelleyBasedEra era
shelleyToBabbageEraToShelleyBasedEra ShelleyToBabbageEra era
shelleyToBab)
                    (Maybe (UpdateProtocolParametersPreConway era)
 -> Maybe (UpdateProtocolParametersConwayOnwards era)
 -> EraBasedProtocolParametersUpdate era
 -> Maybe (CostModelsFile era)
 -> File () 'Out
 -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (Maybe (UpdateProtocolParametersPreConway era))
-> Parser
     (Maybe (UpdateProtocolParametersConwayOnwards era)
      -> EraBasedProtocolParametersUpdate era
      -> Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (UpdateProtocolParametersPreConway era
 -> Maybe (UpdateProtocolParametersPreConway era))
-> Parser (UpdateProtocolParametersPreConway era)
-> Parser (Maybe (UpdateProtocolParametersPreConway era))
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap UpdateProtocolParametersPreConway era
-> Maybe (UpdateProtocolParametersPreConway era)
forall a. a -> Maybe a
Just (ShelleyToBabbageEra era
-> Parser (UpdateProtocolParametersPreConway era)
forall era.
ShelleyToBabbageEra era
-> Parser (UpdateProtocolParametersPreConway era)
pUpdateProtocolParametersPreConway ShelleyToBabbageEra era
shelleyToBab)
                    Parser
  (Maybe (UpdateProtocolParametersConwayOnwards era)
   -> EraBasedProtocolParametersUpdate era
   -> Maybe (CostModelsFile era)
   -> File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (Maybe (UpdateProtocolParametersConwayOnwards era))
-> Parser
     (EraBasedProtocolParametersUpdate era
      -> Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (UpdateProtocolParametersConwayOnwards era)
-> Parser (Maybe (UpdateProtocolParametersConwayOnwards era))
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe (UpdateProtocolParametersConwayOnwards era)
forall a. Maybe a
Nothing
                    Parser
  (EraBasedProtocolParametersUpdate era
   -> Maybe (CostModelsFile era)
   -> File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (EraBasedProtocolParametersUpdate era)
-> Parser
     (Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
forall era.
ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
dpGovActionProtocolParametersUpdate ShelleyBasedEra era
sbe
                    Parser
  (Maybe (CostModelsFile era)
   -> File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (Maybe (CostModelsFile era))
-> Parser
     (File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
forall era.
ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
pCostModelsFile ShelleyBasedEra era
sbe
                    Parser
  (File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (File () 'Out)
forall content. Parser (File content 'Out)
pOutputFile
                )
              (InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> ParserInfo
      (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. (a -> b) -> a -> b
$ [Char]
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a protocol parameters update."
    )
    ( \ConwayEraOnwards era
conwayOnwards ->
        let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
conwayEraOnwardsToShelleyBasedEra ConwayEraOnwards era
conwayOnwards
         in [Char]
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-protocol-parameters-update"
              (ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
                ( ShelleyBasedEra era
-> Maybe (UpdateProtocolParametersPreConway era)
-> Maybe (UpdateProtocolParametersConwayOnwards era)
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
forall era.
ShelleyBasedEra era
-> Maybe (UpdateProtocolParametersPreConway era)
-> Maybe (UpdateProtocolParametersConwayOnwards era)
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
Cmd.GovernanceActionProtocolParametersUpdateCmdArgs
                    (ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
conwayEraOnwardsToShelleyBasedEra ConwayEraOnwards era
conwayOnwards)
                    Maybe (UpdateProtocolParametersPreConway era)
forall a. Maybe a
Nothing
                    (Maybe (UpdateProtocolParametersConwayOnwards era)
 -> EraBasedProtocolParametersUpdate era
 -> Maybe (CostModelsFile era)
 -> File () 'Out
 -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (Maybe (UpdateProtocolParametersConwayOnwards era))
-> Parser
     (EraBasedProtocolParametersUpdate era
      -> Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (UpdateProtocolParametersConwayOnwards era
 -> Maybe (UpdateProtocolParametersConwayOnwards era))
-> Parser (UpdateProtocolParametersConwayOnwards era)
-> Parser (Maybe (UpdateProtocolParametersConwayOnwards era))
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap UpdateProtocolParametersConwayOnwards era
-> Maybe (UpdateProtocolParametersConwayOnwards era)
forall a. a -> Maybe a
Just (ConwayEraOnwards era
-> Parser (UpdateProtocolParametersConwayOnwards era)
forall era.
ConwayEraOnwards era
-> Parser (UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway ConwayEraOnwards era
conwayOnwards)
                    Parser
  (EraBasedProtocolParametersUpdate era
   -> Maybe (CostModelsFile era)
   -> File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (EraBasedProtocolParametersUpdate era)
-> Parser
     (Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
forall era.
ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
dpGovActionProtocolParametersUpdate ShelleyBasedEra era
sbe
                    Parser
  (Maybe (CostModelsFile era)
   -> File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (Maybe (CostModelsFile era))
-> Parser
     (File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
forall era.
ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
pCostModelsFile ShelleyBasedEra era
sbe
                    Parser
  (File () 'Out
   -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (File () 'Out)
forall content. Parser (File content 'Out)
pOutputFile
                )
              (InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> ParserInfo
      (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. (a -> b) -> a -> b
$ [Char]
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a protocol parameters update."
    )

-- | Cost models only makes sense in eras from Alonzo onwards. For earlier
-- eras, this parser doesn't show up in the command line and returns 'Nothing'.
pCostModelsFile :: ShelleyBasedEra era -> Parser (Maybe (Cmd.CostModelsFile era))
pCostModelsFile :: forall era.
ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
pCostModelsFile =
  (ShelleyToMaryEraConstraints era =>
 ShelleyToMaryEra era -> Parser (Maybe (CostModelsFile era)))
-> (AlonzoEraOnwardsConstraints era =>
    AlonzoEraOnwards era -> Parser (Maybe (CostModelsFile era)))
-> ShelleyBasedEra era
-> Parser (Maybe (CostModelsFile era))
forall era a.
(ShelleyToMaryEraConstraints era => ShelleyToMaryEra era -> a)
-> (AlonzoEraOnwardsConstraints era => AlonzoEraOnwards era -> a)
-> ShelleyBasedEra era
-> a
caseShelleyToMaryOrAlonzoEraOnwards
    (Parser (Maybe (CostModelsFile era))
-> ShelleyToMaryEra era -> Parser (Maybe (CostModelsFile era))
forall a b. a -> b -> a
const (Parser (Maybe (CostModelsFile era))
 -> ShelleyToMaryEra era -> Parser (Maybe (CostModelsFile era)))
-> Parser (Maybe (CostModelsFile era))
-> ShelleyToMaryEra era
-> Parser (Maybe (CostModelsFile era))
forall a b. (a -> b) -> a -> b
$ Maybe (CostModelsFile era) -> Parser (Maybe (CostModelsFile era))
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe (CostModelsFile era)
forall a. Maybe a
Nothing)
    ( \AlonzoEraOnwards era
alonzoOnwards ->
        ([Char] -> CostModelsFile era)
-> Maybe [Char] -> Maybe (CostModelsFile era)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (AlonzoEraOnwards era -> File CostModels 'In -> CostModelsFile era
forall era.
AlonzoEraOnwards era -> File CostModels 'In -> CostModelsFile era
Cmd.CostModelsFile AlonzoEraOnwards era
alonzoOnwards (File CostModels 'In -> CostModelsFile era)
-> ([Char] -> File CostModels 'In) -> [Char] -> CostModelsFile era
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Char] -> File CostModels 'In
forall content (direction :: FileDirection).
[Char] -> File content direction
File)
          (Maybe [Char] -> Maybe (CostModelsFile era))
-> Parser (Maybe [Char]) -> Parser (Maybe (CostModelsFile era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser [Char] -> Parser (Maybe [Char])
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser [Char]
pCostModels
    )

pGovernanceActionProtocolParametersUpdateCmd
  :: ()
  => ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionProtocolParametersUpdateCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionProtocolParametersUpdateCmd ShelleyBasedEra era
era = do
  ShelleyBasedEra era
w <- ShelleyBasedEra era -> Maybe (ShelleyBasedEra era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$
    GovernanceActionProtocolParametersUpdateCmdArgs era
-> GovernanceActionCmds era
forall era.
GovernanceActionProtocolParametersUpdateCmdArgs era
-> GovernanceActionCmds era
Cmd.GovernanceActionProtocolParametersUpdateCmd
      (GovernanceActionProtocolParametersUpdateCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall era.
ShelleyBasedEra era
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd ShelleyBasedEra era
w

pMinFeeRefScriptCostPerByte :: Parser L.NonNegativeInterval
pMinFeeRefScriptCostPerByte :: Parser NonNegativeInterval
pMinFeeRefScriptCostPerByte =
  ReadM NonNegativeInterval
-> Mod OptionFields NonNegativeInterval
-> Parser NonNegativeInterval
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (Rational -> NonNegativeInterval
toNonNegativeIntervalOrErr (Rational -> NonNegativeInterval)
-> ReadM Rational -> ReadM NonNegativeInterval
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Rational
readRational) (Mod OptionFields NonNegativeInterval
 -> Parser NonNegativeInterval)
-> Mod OptionFields NonNegativeInterval
-> Parser NonNegativeInterval
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields NonNegativeInterval]
-> Mod OptionFields NonNegativeInterval
forall a. Monoid a => [a] -> a
mconcat
      [ [Char] -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. HasName f => [Char] -> Mod f a
Opt.long [Char]
"ref-script-cost-per-byte"
      , [Char] -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. HasMetavar f => [Char] -> Mod f a
Opt.metavar [Char]
"RATIONAL"
      , [Char] -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. [Char] -> Mod f a
Opt.help [Char]
"Reference script cost per byte for the minimum fee calculation."
      ]

convertToLedger :: (a -> b) -> Parser (Maybe a) -> Parser (L.StrictMaybe b)
convertToLedger :: forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger a -> b
conv = (Maybe a -> StrictMaybe b)
-> Parser (Maybe a) -> Parser (StrictMaybe b)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Maybe b -> StrictMaybe b
forall a. Maybe a -> StrictMaybe a
L.maybeToStrictMaybe (Maybe b -> StrictMaybe b)
-> (Maybe a -> Maybe b) -> Maybe a -> StrictMaybe b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
conv)

toNonNegativeIntervalOrErr :: Rational -> L.NonNegativeInterval
toNonNegativeIntervalOrErr :: Rational -> NonNegativeInterval
toNonNegativeIntervalOrErr Rational
r = case Rational -> Maybe NonNegativeInterval
forall r. BoundedRational r => Rational -> Maybe r
L.boundRational Rational
r of
  Maybe NonNegativeInterval
Nothing ->
    [Char] -> NonNegativeInterval
forall a. HasCallStack => [Char] -> a
error ([Char] -> NonNegativeInterval) -> [Char] -> NonNegativeInterval
forall a b. (a -> b) -> a -> b
$
      [[Char]] -> [Char]
forall a. Monoid a => [a] -> a
mconcat
        [ [Char]
"toNonNegativeIntervalOrErr: "
        , [Char]
"rational out of bounds " [Char] -> [Char] -> [Char]
forall a. Semigroup a => a -> a -> a
<> Rational -> [Char]
forall a. Show a => a -> [Char]
show Rational
r
        ]
  Just NonNegativeInterval
n -> NonNegativeInterval
n

mkProtocolVersionOrErr :: (Natural, Natural) -> L.ProtVer
mkProtocolVersionOrErr :: (Natural, Natural) -> ProtVer
mkProtocolVersionOrErr (Natural
majorProtVer, Natural
minorProtVer) =
  case (Version -> Natural -> ProtVer
`L.ProtVer` Natural
minorProtVer) (Version -> ProtVer) -> Maybe Version -> Maybe ProtVer
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Natural -> Maybe Version
forall i (m :: * -> *). (Integral i, MonadFail m) => i -> m Version
L.mkVersion Natural
majorProtVer of
    Just ProtVer
v -> ProtVer
v
    Maybe ProtVer
Nothing ->
      [Char] -> ProtVer
forall a. HasCallStack => [Char] -> a
error ([Char] -> ProtVer) -> [Char] -> ProtVer
forall a b. (a -> b) -> a -> b
$ [Char]
"mkProtocolVersionOrErr: invalid protocol version " [Char] -> [Char] -> [Char]
forall a. Semigroup a => a -> a -> a
<> (Natural, Natural) -> [Char]
forall a. Show a => a -> [Char]
show (Natural
majorProtVer, Natural
minorProtVer)

pCommonProtocolParameters :: Parser CommonProtocolParametersUpdate
pCommonProtocolParameters :: Parser CommonProtocolParametersUpdate
pCommonProtocolParameters =
  StrictMaybe Lovelace
-> StrictMaybe Lovelace
-> StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe Word16
-> StrictMaybe Lovelace
-> StrictMaybe Lovelace
-> StrictMaybe EpochInterval
-> StrictMaybe Natural
-> StrictMaybe NonNegativeInterval
-> StrictMaybe UnitInterval
-> StrictMaybe UnitInterval
-> StrictMaybe Lovelace
-> CommonProtocolParametersUpdate
CommonProtocolParametersUpdate
    (StrictMaybe Lovelace
 -> StrictMaybe Lovelace
 -> StrictMaybe Word32
 -> StrictMaybe Word32
 -> StrictMaybe Word16
 -> StrictMaybe Lovelace
 -> StrictMaybe Lovelace
 -> StrictMaybe EpochInterval
 -> StrictMaybe Natural
 -> StrictMaybe NonNegativeInterval
 -> StrictMaybe UnitInterval
 -> StrictMaybe UnitInterval
 -> StrictMaybe Lovelace
 -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe Lovelace
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pMinFeePerByteFactor)
    Parser
  (StrictMaybe Lovelace
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe Word16
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pMinFeeConstantFactor)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe Word16
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Word32 -> Word32)
-> Parser (Maybe Word32) -> Parser (StrictMaybe Word32)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Word32 -> Word32
forall a. a -> a
id (Parser Word32 -> Parser (Maybe Word32)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Word32
pMaxBodySize)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe Word16
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Word32 -> Word32)
-> Parser (Maybe Word32) -> Parser (StrictMaybe Word32)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Word32 -> Word32
forall a. a -> a
id (Parser Word32 -> Parser (Maybe Word32)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Word32
pMaxTransactionSize)
    Parser
  (StrictMaybe Word16
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Word16 -> Word16)
-> Parser (Maybe Word16) -> Parser (StrictMaybe Word16)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Word16 -> Word16
forall a. a -> a
id (Parser Word16 -> Parser (Maybe Word16)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Word16
pMaxBlockHeaderSize)
    Parser
  (StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pKeyRegistDeposit)
    Parser
  (StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pPoolDeposit)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe Natural
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (EpochInterval -> EpochInterval)
-> Parser (Maybe EpochInterval)
-> Parser (StrictMaybe EpochInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger EpochInterval -> EpochInterval
forall a. a -> a
id (Parser EpochInterval -> Parser (Maybe EpochInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser EpochInterval
pEpochBoundRetirement)
    Parser
  (StrictMaybe Natural
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Natural)
-> Parser
     (StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Natural -> Natural)
-> Parser (Maybe Natural) -> Parser (StrictMaybe Natural)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Natural -> Natural
forall a. a -> a
id (Parser Natural -> Parser (Maybe Natural)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Natural
pNumberOfPools)
    Parser
  (StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe NonNegativeInterval)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Lovelace
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Rational -> NonNegativeInterval)
-> Parser (Maybe Rational)
-> Parser (StrictMaybe NonNegativeInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Rational -> NonNegativeInterval
toNonNegativeIntervalOrErr (Parser Rational -> Parser (Maybe Rational)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Rational
pPoolInfluence)
    Parser
  (StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Lovelace
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe UnitInterval)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe Lovelace -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Rational -> UnitInterval)
-> Parser (Maybe Rational) -> Parser (StrictMaybe UnitInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Rational -> UnitInterval
toUnitIntervalOrErr (Parser Rational -> Parser (Maybe Rational)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Rational
pTreasuryExpansion)
    Parser
  (StrictMaybe UnitInterval
   -> StrictMaybe Lovelace -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe UnitInterval)
-> Parser (StrictMaybe Lovelace -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Rational -> UnitInterval)
-> Parser (Maybe Rational) -> Parser (StrictMaybe UnitInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Rational -> UnitInterval
toUnitIntervalOrErr (Parser Rational -> Parser (Maybe Rational)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Rational
pMonetaryExpansion)
    Parser (StrictMaybe Lovelace -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Lovelace)
-> Parser CommonProtocolParametersUpdate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pMinPoolCost)

pDeprecatedAfterMaryPParams :: Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams :: forall ledgerera. Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams =
  StrictMaybe Lovelace -> DeprecatedAfterMaryPParams ledgerera
forall ledgerera.
StrictMaybe Lovelace -> DeprecatedAfterMaryPParams ledgerera
DeprecatedAfterMaryPParams
    (StrictMaybe Lovelace -> DeprecatedAfterMaryPParams ledgerera)
-> Parser (StrictMaybe Lovelace)
-> Parser (DeprecatedAfterMaryPParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pMinUTxOValue)

pDeprecatedAfterBabbagePParams :: Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams :: forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams =
  StrictMaybe ProtVer -> DeprecatedAfterBabbagePParams ledgerera
forall ledgerera.
StrictMaybe ProtVer -> DeprecatedAfterBabbagePParams ledgerera
DeprecatedAfterBabbagePParams
    (StrictMaybe ProtVer -> DeprecatedAfterBabbagePParams ledgerera)
-> Parser (StrictMaybe ProtVer)
-> Parser (DeprecatedAfterBabbagePParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((Natural, Natural) -> ProtVer)
-> Parser (Maybe (Natural, Natural))
-> Parser (StrictMaybe ProtVer)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger (Natural, Natural) -> ProtVer
mkProtocolVersionOrErr (Parser (Natural, Natural) -> Parser (Maybe (Natural, Natural))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (Natural, Natural)
pProtocolVersion)

pShelleyToAlonzoPParams :: Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams :: forall ledgerera. Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams =
  StrictMaybe Nonce
-> StrictMaybe UnitInterval -> ShelleyToAlonzoPParams ledgerera
forall ledgerera.
StrictMaybe Nonce
-> StrictMaybe UnitInterval -> ShelleyToAlonzoPParams ledgerera
ShelleyToAlonzoPParams
    (StrictMaybe Nonce
 -> StrictMaybe UnitInterval -> ShelleyToAlonzoPParams ledgerera)
-> Parser (StrictMaybe Nonce)
-> Parser
     (StrictMaybe UnitInterval -> ShelleyToAlonzoPParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Nonce -> Nonce)
-> Parser (Maybe Nonce) -> Parser (StrictMaybe Nonce)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Nonce -> Nonce
forall a. a -> a
id (Parser Nonce -> Parser (Maybe Nonce)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser Nonce -> Parser (Maybe Nonce))
-> Parser Nonce -> Parser (Maybe Nonce)
forall a b. (a -> b) -> a -> b
$ Maybe PraosNonce -> Nonce
toLedgerNonce (Maybe PraosNonce -> Nonce)
-> Parser (Maybe PraosNonce) -> Parser Nonce
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (Maybe PraosNonce)
pExtraEntropy)
    Parser
  (StrictMaybe UnitInterval -> ShelleyToAlonzoPParams ledgerera)
-> Parser (StrictMaybe UnitInterval)
-> Parser (ShelleyToAlonzoPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Rational -> UnitInterval)
-> Parser (Maybe Rational) -> Parser (StrictMaybe UnitInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Rational -> UnitInterval
toUnitIntervalOrErr (Parser Rational -> Parser (Maybe Rational)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Rational
pDecentralParam)

pAlonzoOnwardsPParams :: Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams :: forall ledgerera. Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams =
  StrictMaybe CostModels
-> StrictMaybe Prices
-> StrictMaybe ExUnits
-> StrictMaybe ExUnits
-> StrictMaybe Natural
-> StrictMaybe Natural
-> StrictMaybe Natural
-> AlonzoOnwardsPParams ledgerera
forall ledgerera.
StrictMaybe CostModels
-> StrictMaybe Prices
-> StrictMaybe ExUnits
-> StrictMaybe ExUnits
-> StrictMaybe Natural
-> StrictMaybe Natural
-> StrictMaybe Natural
-> AlonzoOnwardsPParams ledgerera
AlonzoOnwardsPParams StrictMaybe CostModels
forall a. StrictMaybe a
L.SNothing -- The cost models are read separately from a file, so we use 'SNothing' as the place holder here
    (StrictMaybe Prices
 -> StrictMaybe ExUnits
 -> StrictMaybe ExUnits
 -> StrictMaybe Natural
 -> StrictMaybe Natural
 -> StrictMaybe Natural
 -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Prices)
-> Parser
     (StrictMaybe ExUnits
      -> StrictMaybe ExUnits
      -> StrictMaybe Natural
      -> StrictMaybe Natural
      -> StrictMaybe Natural
      -> AlonzoOnwardsPParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ExecutionUnitPrices -> Prices)
-> Parser (Maybe ExecutionUnitPrices)
-> Parser (StrictMaybe Prices)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger
      ((ProtocolParametersConversionError -> Prices)
-> (Prices -> Prices)
-> Either ProtocolParametersConversionError Prices
-> Prices
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (\ProtocolParametersConversionError
e -> [Char] -> Prices
forall a. HasCallStack => [Char] -> a
error ([Char] -> Prices) -> [Char] -> Prices
forall a b. (a -> b) -> a -> b
$ [Char]
"pAlonzoOnwardsPParams: " [Char] -> [Char] -> [Char]
forall a. Semigroup a => a -> a -> a
<> ProtocolParametersConversionError -> [Char]
forall a. Show a => a -> [Char]
show ProtocolParametersConversionError
e) Prices -> Prices
forall a. a -> a
id (Either ProtocolParametersConversionError Prices -> Prices)
-> (ExecutionUnitPrices
    -> Either ProtocolParametersConversionError Prices)
-> ExecutionUnitPrices
-> Prices
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExecutionUnitPrices
-> Either ProtocolParametersConversionError Prices
toAlonzoPrices)
      (Parser ExecutionUnitPrices -> Parser (Maybe ExecutionUnitPrices)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ExecutionUnitPrices
pExecutionUnitPrices)
    Parser
  (StrictMaybe ExUnits
   -> StrictMaybe ExUnits
   -> StrictMaybe Natural
   -> StrictMaybe Natural
   -> StrictMaybe Natural
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe ExUnits)
-> Parser
     (StrictMaybe ExUnits
      -> StrictMaybe Natural
      -> StrictMaybe Natural
      -> StrictMaybe Natural
      -> AlonzoOnwardsPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (ExecutionUnits -> ExUnits)
-> Parser (Maybe ExecutionUnits) -> Parser (StrictMaybe ExUnits)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger ExecutionUnits -> ExUnits
toAlonzoExUnits (Parser ExecutionUnits -> Parser (Maybe ExecutionUnits)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ExecutionUnits
pMaxTxExecutionUnits)
    Parser
  (StrictMaybe ExUnits
   -> StrictMaybe Natural
   -> StrictMaybe Natural
   -> StrictMaybe Natural
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe ExUnits)
-> Parser
     (StrictMaybe Natural
      -> StrictMaybe Natural
      -> StrictMaybe Natural
      -> AlonzoOnwardsPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (ExecutionUnits -> ExUnits)
-> Parser (Maybe ExecutionUnits) -> Parser (StrictMaybe ExUnits)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger ExecutionUnits -> ExUnits
toAlonzoExUnits (Parser ExecutionUnits -> Parser (Maybe ExecutionUnits)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ExecutionUnits
pMaxBlockExecutionUnits)
    Parser
  (StrictMaybe Natural
   -> StrictMaybe Natural
   -> StrictMaybe Natural
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Natural)
-> Parser
     (StrictMaybe Natural
      -> StrictMaybe Natural -> AlonzoOnwardsPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Natural -> Natural)
-> Parser (Maybe Natural) -> Parser (StrictMaybe Natural)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Natural -> Natural
forall a. a -> a
id (Parser Natural -> Parser (Maybe Natural)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Natural
pMaxValueSize)
    Parser
  (StrictMaybe Natural
   -> StrictMaybe Natural -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Natural)
-> Parser (StrictMaybe Natural -> AlonzoOnwardsPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Natural -> Natural)
-> Parser (Maybe Natural) -> Parser (StrictMaybe Natural)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Natural -> Natural
forall a. a -> a
id (Parser Natural -> Parser (Maybe Natural)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Natural
pCollateralPercent)
    Parser (StrictMaybe Natural -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Natural)
-> Parser (AlonzoOnwardsPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Natural -> Natural)
-> Parser (Maybe Natural) -> Parser (StrictMaybe Natural)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Natural -> Natural
forall a. a -> a
id (Parser Natural -> Parser (Maybe Natural)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Natural
pMaxCollateralInputs)

pIntroducedInBabbagePParams :: Parser (IntroducedInBabbagePParams ledgerera)
pIntroducedInBabbagePParams :: forall ledgerera. Parser (IntroducedInBabbagePParams ledgerera)
pIntroducedInBabbagePParams =
  StrictMaybe CoinPerByte -> IntroducedInBabbagePParams ledgerera
forall era.
StrictMaybe CoinPerByte -> IntroducedInBabbagePParams era
IntroducedInBabbagePParams
    (StrictMaybe CoinPerByte -> IntroducedInBabbagePParams ledgerera)
-> Parser (StrictMaybe CoinPerByte)
-> Parser (IntroducedInBabbagePParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lovelace -> CoinPerByte)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe CoinPerByte)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> CoinPerByte
L.CoinPerByte (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pUTxOCostPerByte)

pIntroducedInConwayPParams :: Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams :: forall ledgerera. Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams =
  StrictMaybe PoolVotingThresholds
-> StrictMaybe DRepVotingThresholds
-> StrictMaybe Natural
-> StrictMaybe EpochInterval
-> StrictMaybe EpochInterval
-> StrictMaybe Lovelace
-> StrictMaybe Lovelace
-> StrictMaybe EpochInterval
-> StrictMaybe NonNegativeInterval
-> IntroducedInConwayPParams ledgerera
forall era.
StrictMaybe PoolVotingThresholds
-> StrictMaybe DRepVotingThresholds
-> StrictMaybe Natural
-> StrictMaybe EpochInterval
-> StrictMaybe EpochInterval
-> StrictMaybe Lovelace
-> StrictMaybe Lovelace
-> StrictMaybe EpochInterval
-> StrictMaybe NonNegativeInterval
-> IntroducedInConwayPParams era
IntroducedInConwayPParams
    (StrictMaybe PoolVotingThresholds
 -> StrictMaybe DRepVotingThresholds
 -> StrictMaybe Natural
 -> StrictMaybe EpochInterval
 -> StrictMaybe EpochInterval
 -> StrictMaybe Lovelace
 -> StrictMaybe Lovelace
 -> StrictMaybe EpochInterval
 -> StrictMaybe NonNegativeInterval
 -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe PoolVotingThresholds)
-> Parser
     (StrictMaybe DRepVotingThresholds
      -> StrictMaybe Natural
      -> StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (PoolVotingThresholds -> PoolVotingThresholds)
-> Parser (Maybe PoolVotingThresholds)
-> Parser (StrictMaybe PoolVotingThresholds)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger PoolVotingThresholds -> PoolVotingThresholds
forall a. a -> a
id (Parser PoolVotingThresholds -> Parser (Maybe PoolVotingThresholds)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser PoolVotingThresholds
pPoolVotingThresholds)
    Parser
  (StrictMaybe DRepVotingThresholds
   -> StrictMaybe Natural
   -> StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe DRepVotingThresholds)
-> Parser
     (StrictMaybe Natural
      -> StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (DRepVotingThresholds -> DRepVotingThresholds)
-> Parser (Maybe DRepVotingThresholds)
-> Parser (StrictMaybe DRepVotingThresholds)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger DRepVotingThresholds -> DRepVotingThresholds
forall a. a -> a
id (Parser DRepVotingThresholds -> Parser (Maybe DRepVotingThresholds)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser DRepVotingThresholds
pDRepVotingThresholds)
    Parser
  (StrictMaybe Natural
   -> StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Natural)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Natural -> Natural)
-> Parser (Maybe Natural) -> Parser (StrictMaybe Natural)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Natural -> Natural
forall a. a -> a
id (Parser Natural -> Parser (Maybe Natural)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Natural
pMinCommitteeSize)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (EpochInterval -> EpochInterval)
-> Parser (Maybe EpochInterval)
-> Parser (StrictMaybe EpochInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger EpochInterval -> EpochInterval
forall a. a -> a
id (Parser EpochInterval -> Parser (Maybe EpochInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser EpochInterval
pCommitteeTermLength)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe Lovelace
      -> StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (EpochInterval -> EpochInterval)
-> Parser (Maybe EpochInterval)
-> Parser (StrictMaybe EpochInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger EpochInterval -> EpochInterval
forall a. a -> a
id (Parser EpochInterval -> Parser (Maybe EpochInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser EpochInterval
pGovActionLifetime)
    Parser
  (StrictMaybe Lovelace
   -> StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe Lovelace
      -> StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pNewGovActionDeposit)
    Parser
  (StrictMaybe Lovelace
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Lovelace)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Lovelace -> Lovelace)
-> Parser (Maybe Lovelace) -> Parser (StrictMaybe Lovelace)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Lovelace -> Lovelace
forall a. a -> a
id (Parser Lovelace -> Parser (Maybe Lovelace)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Lovelace
pDRepDeposit)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe NonNegativeInterval
      -> IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (EpochInterval -> EpochInterval)
-> Parser (Maybe EpochInterval)
-> Parser (StrictMaybe EpochInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger EpochInterval -> EpochInterval
forall a. a -> a
id (Parser EpochInterval -> Parser (Maybe EpochInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser EpochInterval
pDRepActivity)
    Parser
  (StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe NonNegativeInterval)
-> Parser (IntroducedInConwayPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (NonNegativeInterval -> NonNegativeInterval)
-> Parser (Maybe NonNegativeInterval)
-> Parser (StrictMaybe NonNegativeInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger NonNegativeInterval -> NonNegativeInterval
forall a. a -> a
id (Parser NonNegativeInterval -> Parser (Maybe NonNegativeInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser NonNegativeInterval
pMinFeeRefScriptCostPerByte)

-- Not necessary in Conway era onwards
pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In]
pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile 'In]
pProtocolParametersUpdateGenesisKeys = Parser (VerificationKeyFile 'In)
-> Parser [VerificationKeyFile 'In]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some Parser (VerificationKeyFile 'In)
pGenesisVerificationKeyFile

dpGovActionProtocolParametersUpdate
  :: ShelleyBasedEra era -> Parser (EraBasedProtocolParametersUpdate era)
dpGovActionProtocolParametersUpdate :: forall era.
ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
dpGovActionProtocolParametersUpdate = \case
  ShelleyBasedEra era
ShelleyBasedEraShelley ->
    CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams ShelleyEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> ShelleyToAlonzoPParams ShelleyEra
-> EraBasedProtocolParametersUpdate era
CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams ShelleyEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> ShelleyToAlonzoPParams ShelleyEra
-> EraBasedProtocolParametersUpdate ShelleyEra
ShelleyEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> DeprecatedAfterMaryPParams ShelleyEra
 -> DeprecatedAfterBabbagePParams ShelleyEra
 -> ShelleyToAlonzoPParams ShelleyEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (DeprecatedAfterMaryPParams ShelleyEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> ShelleyToAlonzoPParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (DeprecatedAfterMaryPParams ShelleyEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> ShelleyToAlonzoPParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterMaryPParams ShelleyEra)
-> Parser
     (DeprecatedAfterBabbagePParams ShelleyEra
      -> ShelleyToAlonzoPParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterMaryPParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams
      Parser
  (DeprecatedAfterBabbagePParams ShelleyEra
   -> ShelleyToAlonzoPParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
-> Parser
     (ShelleyToAlonzoPParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams
      Parser
  (ShelleyToAlonzoPParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (ShelleyToAlonzoPParams ShelleyEra)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (ShelleyToAlonzoPParams ShelleyEra)
forall ledgerera. Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams
  ShelleyBasedEra era
ShelleyBasedEraAllegra ->
    CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams AllegraEra
-> ShelleyToAlonzoPParams AllegraEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate era
CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams AllegraEra
-> ShelleyToAlonzoPParams AllegraEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate AllegraEra
AllegraEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> DeprecatedAfterMaryPParams AllegraEra
 -> ShelleyToAlonzoPParams AllegraEra
 -> DeprecatedAfterBabbagePParams ShelleyEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (DeprecatedAfterMaryPParams AllegraEra
      -> ShelleyToAlonzoPParams AllegraEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (DeprecatedAfterMaryPParams AllegraEra
   -> ShelleyToAlonzoPParams AllegraEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterMaryPParams AllegraEra)
-> Parser
     (ShelleyToAlonzoPParams AllegraEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterMaryPParams AllegraEra)
forall ledgerera. Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams
      Parser
  (ShelleyToAlonzoPParams AllegraEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (ShelleyToAlonzoPParams AllegraEra)
-> Parser
     (DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (ShelleyToAlonzoPParams AllegraEra)
forall ledgerera. Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams
      Parser
  (DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams
  ShelleyBasedEra era
ShelleyBasedEraMary ->
    CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams MaryEra
-> ShelleyToAlonzoPParams MaryEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate era
CommonProtocolParametersUpdate
-> DeprecatedAfterMaryPParams MaryEra
-> ShelleyToAlonzoPParams MaryEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate MaryEra
MaryEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> DeprecatedAfterMaryPParams MaryEra
 -> ShelleyToAlonzoPParams MaryEra
 -> DeprecatedAfterBabbagePParams ShelleyEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (DeprecatedAfterMaryPParams MaryEra
      -> ShelleyToAlonzoPParams MaryEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (DeprecatedAfterMaryPParams MaryEra
   -> ShelleyToAlonzoPParams MaryEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterMaryPParams MaryEra)
-> Parser
     (ShelleyToAlonzoPParams MaryEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterMaryPParams MaryEra)
forall ledgerera. Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams
      Parser
  (ShelleyToAlonzoPParams MaryEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (ShelleyToAlonzoPParams MaryEra)
-> Parser
     (DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (ShelleyToAlonzoPParams MaryEra)
forall ledgerera. Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams
      Parser
  (DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams
  ShelleyBasedEra era
ShelleyBasedEraAlonzo ->
    CommonProtocolParametersUpdate
-> ShelleyToAlonzoPParams AlonzoEra
-> AlonzoOnwardsPParams AlonzoEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate era
CommonProtocolParametersUpdate
-> ShelleyToAlonzoPParams AlonzoEra
-> AlonzoOnwardsPParams AlonzoEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> EraBasedProtocolParametersUpdate AlonzoEra
AlonzoEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> ShelleyToAlonzoPParams AlonzoEra
 -> AlonzoOnwardsPParams AlonzoEra
 -> DeprecatedAfterBabbagePParams ShelleyEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (ShelleyToAlonzoPParams AlonzoEra
      -> AlonzoOnwardsPParams AlonzoEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (ShelleyToAlonzoPParams AlonzoEra
   -> AlonzoOnwardsPParams AlonzoEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (ShelleyToAlonzoPParams AlonzoEra)
-> Parser
     (AlonzoOnwardsPParams AlonzoEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (ShelleyToAlonzoPParams AlonzoEra)
forall ledgerera. Parser (ShelleyToAlonzoPParams ledgerera)
pShelleyToAlonzoPParams
      Parser
  (AlonzoOnwardsPParams AlonzoEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (AlonzoOnwardsPParams AlonzoEra)
-> Parser
     (DeprecatedAfterBabbagePParams ShelleyEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AlonzoOnwardsPParams AlonzoEra)
forall ledgerera. Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams
      Parser
  (DeprecatedAfterBabbagePParams ShelleyEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams
  ShelleyBasedEra era
ShelleyBasedEraBabbage ->
    CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams BabbageEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> IntroducedInBabbagePParams BabbageEra
-> EraBasedProtocolParametersUpdate era
CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams BabbageEra
-> DeprecatedAfterBabbagePParams ShelleyEra
-> IntroducedInBabbagePParams BabbageEra
-> EraBasedProtocolParametersUpdate BabbageEra
BabbageEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> AlonzoOnwardsPParams BabbageEra
 -> DeprecatedAfterBabbagePParams ShelleyEra
 -> IntroducedInBabbagePParams BabbageEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (AlonzoOnwardsPParams BabbageEra
      -> DeprecatedAfterBabbagePParams ShelleyEra
      -> IntroducedInBabbagePParams BabbageEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (AlonzoOnwardsPParams BabbageEra
   -> DeprecatedAfterBabbagePParams ShelleyEra
   -> IntroducedInBabbagePParams BabbageEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (AlonzoOnwardsPParams BabbageEra)
-> Parser
     (DeprecatedAfterBabbagePParams ShelleyEra
      -> IntroducedInBabbagePParams BabbageEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AlonzoOnwardsPParams BabbageEra)
forall ledgerera. Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams
      Parser
  (DeprecatedAfterBabbagePParams ShelleyEra
   -> IntroducedInBabbagePParams BabbageEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
-> Parser
     (IntroducedInBabbagePParams BabbageEra
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (DeprecatedAfterBabbagePParams ShelleyEra)
forall ledgerera. Parser (DeprecatedAfterBabbagePParams ledgerera)
pDeprecatedAfterBabbagePParams
      Parser
  (IntroducedInBabbagePParams BabbageEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInBabbagePParams BabbageEra)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (IntroducedInBabbagePParams BabbageEra)
forall ledgerera. Parser (IntroducedInBabbagePParams ledgerera)
pIntroducedInBabbagePParams
  ShelleyBasedEra era
ShelleyBasedEraConway ->
    CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams ConwayEra
-> IntroducedInBabbagePParams ConwayEra
-> IntroducedInConwayPParams (ShelleyLedgerEra ConwayEra)
-> EraBasedProtocolParametersUpdate ConwayEra
CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams ConwayEra
-> IntroducedInBabbagePParams ConwayEra
-> IntroducedInConwayPParams StandardConway
-> EraBasedProtocolParametersUpdate era
ConwayEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> AlonzoOnwardsPParams ConwayEra
 -> IntroducedInBabbagePParams ConwayEra
 -> IntroducedInConwayPParams StandardConway
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (AlonzoOnwardsPParams ConwayEra
      -> IntroducedInBabbagePParams ConwayEra
      -> IntroducedInConwayPParams StandardConway
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (AlonzoOnwardsPParams ConwayEra
   -> IntroducedInBabbagePParams ConwayEra
   -> IntroducedInConwayPParams StandardConway
   -> EraBasedProtocolParametersUpdate era)
-> Parser (AlonzoOnwardsPParams ConwayEra)
-> Parser
     (IntroducedInBabbagePParams ConwayEra
      -> IntroducedInConwayPParams StandardConway
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AlonzoOnwardsPParams ConwayEra)
forall ledgerera. Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams
      Parser
  (IntroducedInBabbagePParams ConwayEra
   -> IntroducedInConwayPParams StandardConway
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInBabbagePParams ConwayEra)
-> Parser
     (IntroducedInConwayPParams StandardConway
      -> EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (IntroducedInBabbagePParams ConwayEra)
forall ledgerera. Parser (IntroducedInBabbagePParams ledgerera)
pIntroducedInBabbagePParams
      Parser
  (IntroducedInConwayPParams StandardConway
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInConwayPParams StandardConway)
-> Parser (EraBasedProtocolParametersUpdate era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (IntroducedInConwayPParams StandardConway)
forall ledgerera. Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams

pGovernanceActionTreasuryWithdrawalCmd
  :: ShelleyBasedEra era -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionTreasuryWithdrawalCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionTreasuryWithdrawalCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-treasury-withdrawal"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionTreasuryWithdrawalCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionTreasuryWithdrawalCmdArgs era
-> GovernanceActionCmds era
forall era.
GovernanceActionTreasuryWithdrawalCmdArgs era
-> GovernanceActionCmds era
Cmd.GovernanceActionTreasuryWithdrawalCmd (Parser (GovernanceActionTreasuryWithdrawalCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> [(StakeIdentifier, Lovelace)]
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionTreasuryWithdrawalCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> [(StakeIdentifier, Lovelace)]
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionTreasuryWithdrawalCmdArgs era
Cmd.GovernanceActionTreasuryWithdrawalCmdArgs ConwayEraOnwards era
eon
            (Network
 -> Lovelace
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> [(StakeIdentifier, Lovelace)]
 -> Maybe ScriptHash
 -> File () 'Out
 -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Lovelace
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     ([(StakeIdentifier, Lovelace)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
            Parser
  ([(StakeIdentifier, Lovelace)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser [(StakeIdentifier, Lovelace)]
-> Parser
     (Maybe ScriptHash
      -> File () 'Out -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (StakeIdentifier, Lovelace)
-> Parser [(StakeIdentifier, Lovelace)]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some ((,) (StakeIdentifier -> Lovelace -> (StakeIdentifier, Lovelace))
-> Parser StakeIdentifier
-> Parser (Lovelace -> (StakeIdentifier, Lovelace))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"funds-receiving") Parser (Lovelace -> (StakeIdentifier, Lovelace))
-> Parser Lovelace -> Parser (StakeIdentifier, Lovelace)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pTreasuryWithdrawalAmt)
            Parser
  (Maybe ScriptHash
   -> File () 'Out -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (Maybe ScriptHash)
-> Parser
     (File () 'Out -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ScriptHash -> Parser (Maybe ScriptHash)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ScriptHash
pConstitutionScriptHash
            Parser
  (File () 'Out -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionTreasuryWithdrawalCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser (File () 'Out)
forall a. [Char] -> [Char] -> Parser (File a 'Out)
pFileOutDirection [Char]
"out-file" [Char]
"Output filepath of the treasury withdrawal."
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a treasury withdrawal."

pNetwork :: Parser L.Network
pNetwork :: Parser Network
pNetwork =
  [Parser Network] -> Parser Network
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum ([Parser Network] -> Parser Network)
-> [Parser Network] -> Parser Network
forall a b. (a -> b) -> a -> b
$
    [[Parser Network]] -> [Parser Network]
forall a. Monoid a => [a] -> a
mconcat
      [
        [ Network -> Mod FlagFields Network -> Parser Network
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' Network
L.Mainnet (Mod FlagFields Network -> Parser Network)
-> Mod FlagFields Network -> Parser Network
forall a b. (a -> b) -> a -> b
$
            [Mod FlagFields Network] -> Mod FlagFields Network
forall a. Monoid a => [a] -> a
mconcat
              [ [Char] -> Mod FlagFields Network
forall (f :: * -> *) a. HasName f => [Char] -> Mod f a
Opt.long [Char]
"mainnet"
              , [Char] -> Mod FlagFields Network
forall (f :: * -> *) a. [Char] -> Mod f a
Opt.help [Char]
"Use the mainnet magic id."
              ]
        , Network -> Mod FlagFields Network -> Parser Network
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' Network
L.Testnet (Mod FlagFields Network -> Parser Network)
-> Mod FlagFields Network -> Parser Network
forall a b. (a -> b) -> a -> b
$
            [Mod FlagFields Network] -> Mod FlagFields Network
forall a. Monoid a => [a] -> a
mconcat
              [ [Char] -> Mod FlagFields Network
forall (f :: * -> *) a. HasName f => [Char] -> Mod f a
Opt.long [Char]
"testnet"
              , [Char] -> Mod FlagFields Network
forall (f :: * -> *) a. [Char] -> Mod f a
Opt.help [Char]
"Use the testnet magic id."
              ]
        ]
      ]

pPV :: Parser L.ProtVer
pPV :: Parser ProtVer
pPV = (Natural, Natural) -> ProtVer
mkProtocolVersionOrErr ((Natural, Natural) -> ProtVer)
-> Parser (Natural, Natural) -> Parser ProtVer
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (Natural, Natural)
pProtocolVersion

pGovernanceActionHardforkInitCmd
  :: ShelleyBasedEra era
  -> Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionHardforkInitCmd :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionHardforkInitCmd ShelleyBasedEra era
era = do
  ConwayEraOnwards era
eon <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Parser (GovernanceActionCmds era)
 -> Maybe (Parser (GovernanceActionCmds era)))
-> Parser (GovernanceActionCmds era)
-> Maybe (Parser (GovernanceActionCmds era))
forall a b. (a -> b) -> a -> b
$ [Char]
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. [Char] -> ParserInfo a -> Parser a
subParser [Char]
"create-hardfork"
    (ParserInfo (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ Parser (GovernanceActionCmds era)
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
      ( (GovernanceActionHardforkInitCmdArgs era
 -> GovernanceActionCmds era)
-> Parser (GovernanceActionHardforkInitCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionHardforkInitCmdArgs era -> GovernanceActionCmds era
forall era.
GovernanceActionHardforkInitCmdArgs era -> GovernanceActionCmds era
Cmd.GovernanceActionHardforkInitCmd (Parser (GovernanceActionHardforkInitCmdArgs era)
 -> Parser (GovernanceActionCmds era))
-> Parser (GovernanceActionHardforkInitCmdArgs era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$
          ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> Maybe (TxId, Word16)
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> ProtVer
-> File () 'Out
-> GovernanceActionHardforkInitCmdArgs era
forall era.
ConwayEraOnwards era
-> Network
-> Lovelace
-> StakeIdentifier
-> Maybe (TxId, Word16)
-> ProposalUrl
-> SafeHash StandardCrypto AnchorData
-> MustCheckHash ProposalUrl
-> ProtVer
-> File () 'Out
-> GovernanceActionHardforkInitCmdArgs era
Cmd.GovernanceActionHardforkInitCmdArgs ConwayEraOnwards era
eon
            (Network
 -> Lovelace
 -> StakeIdentifier
 -> Maybe (TxId, Word16)
 -> ProposalUrl
 -> SafeHash StandardCrypto AnchorData
 -> MustCheckHash ProposalUrl
 -> ProtVer
 -> File () 'Out
 -> GovernanceActionHardforkInitCmdArgs era)
-> Parser Network
-> Parser
     (Lovelace
      -> StakeIdentifier
      -> Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Lovelace
   -> StakeIdentifier
   -> Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser Lovelace
-> Parser
     (StakeIdentifier
      -> Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Lovelace
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (Maybe (TxId, Word16)
      -> ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe [Char] -> Parser StakeIdentifier
pStakeIdentifier ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"deposit-return")
            Parser
  (Maybe (TxId, Word16)
   -> ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (Maybe (TxId, Word16))
-> Parser
     (ProposalUrl
      -> SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction
            Parser
  (ProposalUrl
   -> SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash StandardCrypto AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProposalUrl
pAnchorUrl
            Parser
  (SafeHash StandardCrypto AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (SafeHash StandardCrypto AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SafeHash StandardCrypto AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (ProtVer
      -> File () 'Out -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (MustCheckHash ProposalUrl)
pMustCheckProposalHash
            Parser
  (ProtVer
   -> File () 'Out -> GovernanceActionHardforkInitCmdArgs era)
-> Parser ProtVer
-> Parser (File () 'Out -> GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ProtVer
pPV
            Parser (File () 'Out -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (File () 'Out)
-> Parser (GovernanceActionHardforkInitCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Char] -> [Char] -> Parser (File () 'Out)
forall a. [Char] -> [Char] -> Parser (File a 'Out)
pFileOutDirection [Char]
"out-file" [Char]
"Output filepath of the hardfork proposal."
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ [Char] -> InfoMod (GovernanceActionCmds era)
forall a. [Char] -> InfoMod a
Opt.progDesc [Char]
"Create a hardfork initiation proposal."