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

module Cardano.CLI.EraBased.Governance.Actions.Option
  ( pGovActionProtocolParametersUpdate
  , pCostModelsFile
  , pGovernanceActionCmds
  , pProtocolParametersUpdateGenesisKeys
  , pUpdateProtocolParametersPostConway
  )
where

import Cardano.Api
import Cardano.Api.Experimental qualified as Exp
import Cardano.Api.Ledger qualified as L

import Cardano.CLI.Compatible.Governance.Types
import Cardano.CLI.EraBased.Common.Option
import Cardano.CLI.EraBased.Governance.Actions.Command qualified as Cmd
import Cardano.CLI.Option.Flag (setDefault)
import Cardano.CLI.Parser
import Cardano.CLI.Read (readerFromParsecParser)
import Cardano.CLI.Type.Common
import Cardano.Ledger.BaseTypes (Milliseconds32 (..), NonZero, PositiveInterval, nonZero)
import Cardano.Ledger.Plutus.ExUnits (OrdExUnits (..))

import Data.Foldable
import Data.Function ((&))
import Data.Word (Word16, Word32)
import GHC.Natural (Natural)
import Options.Applicative
import Options.Applicative qualified as Opt

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

pGovernanceActionViewCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionViewCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionViewCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"view"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> ProposalFile 'In
-> Vary '[FormatJson, FormatYaml]
-> Maybe (File () 'Out)
-> GovernanceActionViewCmdArgs era
forall era.
Era era
-> ProposalFile 'In
-> Vary '[FormatJson, FormatYaml]
-> Maybe (File () 'Out)
-> GovernanceActionViewCmdArgs era
Cmd.GovernanceActionViewCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (ProposalFile 'In
 -> Vary '[FormatJson, FormatYaml]
 -> Maybe (File () 'Out)
 -> GovernanceActionViewCmdArgs era)
-> Parser (ProposalFile 'In)
-> Parser
     (Vary '[FormatJson, FormatYaml]
      -> Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> String -> Parser (ProposalFile 'In)
forall a. String -> String -> Parser (File a 'In)
pFileInDirection String
"action-file" String
"Path to action file."
            Parser
  (Vary '[FormatJson, FormatYaml]
   -> Maybe (File () 'Out) -> GovernanceActionViewCmdArgs era)
-> Parser (Vary '[FormatJson, FormatYaml])
-> 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
<*> String
-> [Flag (Vary '[FormatJson, FormatYaml])]
-> Parser (Vary '[FormatJson, FormatYaml])
forall (fs :: [*]). String -> [Flag (Vary fs)] -> Parser (Vary fs)
pFormatFlags
              String
"governance action view output"
              [ Flag (Vary '[FormatJson, FormatYaml])
forall (fs :: [*]). (FormatJson :| fs) => Flag (Vary fs)
flagFormatJson Flag (Vary '[FormatJson, FormatYaml])
-> (Flag (Vary '[FormatJson, FormatYaml])
    -> Flag (Vary '[FormatJson, FormatYaml]))
-> Flag (Vary '[FormatJson, FormatYaml])
forall a b. a -> (a -> b) -> b
& Flag (Vary '[FormatJson, FormatYaml])
-> Flag (Vary '[FormatJson, FormatYaml])
forall a. Flag a -> Flag a
setDefault
              , Flag (Vary '[FormatJson, FormatYaml])
forall (fs :: [*]). (FormatYaml :| fs) => Flag (Vary fs)
flagFormatYaml
              ]
            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
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"View a governance action."

pGovernanceActionNewInfoCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNewInfoCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewInfoCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-info"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> File () 'Out
-> GovernanceActionInfoCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> File () 'Out
-> GovernanceActionInfoCmdArgs era
Cmd.GovernanceActionInfoCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (Network
 -> Coin
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> File () 'Out
 -> GovernanceActionInfoCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> File () 'Out
      -> GovernanceActionInfoCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Coin
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash 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 Coin
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> File () 'Out
   -> GovernanceActionInfoCmdArgs era)
-> Parser (SafeHash 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 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
<*> String -> String -> Parser (File () 'Out)
forall a. String -> String -> Parser (File a 'Out)
pFileOutDirection String
"out-file" String
"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
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create an info action."

pGovernanceActionNewConstitutionCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNewConstitutionCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewConstitutionCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-constitution"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> Network
-> Coin
-> StakeIdentifier
-> Maybe GovActionId
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> ConstitutionUrl
-> SafeHash AnchorData
-> MustCheckHash ConstitutionUrl
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionCreateConstitutionCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> Maybe GovActionId
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> ConstitutionUrl
-> SafeHash AnchorData
-> MustCheckHash ConstitutionUrl
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionCreateConstitutionCmdArgs era
Cmd.GovernanceActionCreateConstitutionCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (Network
 -> Coin
 -> StakeIdentifier
 -> Maybe GovActionId
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> ConstitutionUrl
 -> SafeHash AnchorData
 -> MustCheckHash ConstitutionUrl
 -> Maybe ScriptHash
 -> File () 'Out
 -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> Maybe GovActionId
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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
  (Coin
   -> StakeIdentifier
   -> Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> Maybe GovActionId
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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 Coin
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (Maybe GovActionId
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
            Parser
  (Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (Maybe GovActionId)
-> Parser
     (ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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 GovActionId)
pPreviousGovernanceAction
            Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (SafeHash AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> ConstitutionUrl
      -> SafeHash 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 AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> ConstitutionUrl
   -> SafeHash AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (ConstitutionUrl
      -> SafeHash 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 AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser ConstitutionUrl
-> Parser
     (SafeHash 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 AnchorData
   -> MustCheckHash ConstitutionUrl
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionCreateConstitutionCmdArgs era)
-> Parser (SafeHash 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 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
<*> String -> String -> Parser (File () 'Out)
forall a. String -> String -> Parser (File a 'Out)
pFileOutDirection String
"out-file" String
"Output filepath of the constitution."
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create a constitution."

pGovernanceActionUpdateCommitteeCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionUpdateCommitteeCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionUpdateCommitteeCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"update-committee"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
<$> Parser (GovernanceActionUpdateCommitteeCmdArgs era)
forall era.
IsEra era =>
Parser (GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd
      )
    (InfoMod (GovernanceActionCmds era)
 -> ParserInfo (GovernanceActionCmds era))
-> InfoMod (GovernanceActionCmds era)
-> ParserInfo (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create or update a new committee proposal."

pUpdateCommitteeCmd
  :: Exp.IsEra era => Parser (Cmd.GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd :: forall era.
IsEra era =>
Parser (GovernanceActionUpdateCommitteeCmdArgs era)
pUpdateCommitteeCmd =
  Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo)]
-> Rational
-> Maybe GovActionId
-> File () 'Out
-> GovernanceActionUpdateCommitteeCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
     EpochNo)]
-> Rational
-> Maybe GovActionId
-> File () 'Out
-> GovernanceActionUpdateCommitteeCmdArgs era
Cmd.GovernanceActionUpdateCommitteeCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
    (Network
 -> Coin
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
 -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
      EpochNo)]
 -> Rational
 -> Maybe GovActionId
 -> File () 'Out
 -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> File () 'Out
      -> GovernanceActionUpdateCommitteeCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
    Parser
  (Coin
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 Coin
pGovActionDeposit
    Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
    Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (SafeHash AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 AnchorData)
pAnchorDataHash
    Parser
  (MustCheckHash ProposalUrl
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
   -> Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     ([VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
           EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser
     [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> Parser
     ([(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
        EpochNo)]
      -> Rational
      -> Maybe GovActionId
      -> 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 GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser
     [(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey,
       EpochNo)]
-> Parser
     (Rational
      -> Maybe GovActionId
      -> 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
<*> String -> Parser EpochNo
pEpochNo String
"Committee member expiry epoch"
      )
    Parser
  (Rational
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser Rational
-> Parser
     (Maybe GovActionId
      -> 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
<*> String -> String -> Parser Rational
pRational String
"threshold" String
"Threshold of YES votes that are necessary for approving a governance action."
    Parser
  (Maybe GovActionId
   -> File () 'Out -> GovernanceActionUpdateCommitteeCmdArgs era)
-> Parser (Maybe GovActionId)
-> 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 GovActionId)
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
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionNoConfidenceCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNoConfidenceCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-no-confidence"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> Maybe GovActionId
-> File () 'Out
-> GovernanceActionCreateNoConfidenceCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> Maybe GovActionId
-> File () 'Out
-> GovernanceActionCreateNoConfidenceCmdArgs era
Cmd.GovernanceActionCreateNoConfidenceCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (Network
 -> Coin
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> Maybe GovActionId
 -> File () 'Out
 -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> File () 'Out
      -> GovernanceActionCreateNoConfidenceCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Coin
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 Coin
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (SafeHash AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> File () 'Out
   -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (Maybe GovActionId
      -> 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 GovActionId
   -> File () 'Out -> GovernanceActionCreateNoConfidenceCmdArgs era)
-> Parser (Maybe GovActionId)
-> 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 GovActionId)
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
<*> String -> String -> Parser (File () 'Out)
forall a. String -> String -> Parser (File a 'Out)
pFileOutDirection String
"out-file" String
"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
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create a no confidence proposal."

pUpdateProtocolParametersPostConway
  :: Exp.IsEra era => Parser (Cmd.UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway :: forall era.
IsEra era =>
Parser (UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway =
  Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> Maybe GovActionId
-> Maybe ScriptHash
-> UpdateProtocolParametersConwayOnwards era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> Maybe GovActionId
-> Maybe ScriptHash
-> UpdateProtocolParametersConwayOnwards era
Cmd.UpdateProtocolParametersConwayOnwards Era era
forall era. IsEra era => Era era
Exp.useEra
    (Network
 -> Coin
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> Maybe GovActionId
 -> Maybe ScriptHash
 -> UpdateProtocolParametersConwayOnwards era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> Maybe ScriptHash
      -> UpdateProtocolParametersConwayOnwards era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
    Parser
  (Coin
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 Coin
pGovActionDeposit
    Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
    Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser ProposalUrl
-> Parser
     (SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser (SafeHash AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> Maybe GovActionId
      -> 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 AnchorData)
pAnchorDataHash
    Parser
  (MustCheckHash ProposalUrl
   -> Maybe GovActionId
   -> Maybe ScriptHash
   -> UpdateProtocolParametersConwayOnwards era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     (Maybe GovActionId
      -> 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 GovActionId
   -> Maybe ScriptHash -> UpdateProtocolParametersConwayOnwards era)
-> Parser (Maybe GovActionId)
-> 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 GovActionId)
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
  :: Exp.IsEra era => Parser (Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd :: forall era.
IsEra era =>
Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd =
  let sbe :: ShelleyBasedEra era
sbe = Era era -> ShelleyBasedEra era
forall era. Era era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert Era era
forall era. IsEra era => Era era
Exp.useEra
   in Mod
  CommandFields (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
        (Mod
   CommandFields (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> Mod
     CommandFields (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Mod
     CommandFields (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-protocol-parameters-update"
        (ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
 -> Mod
      CommandFields
      (GovernanceActionProtocolParametersUpdateCmdArgs era))
-> ParserInfo (GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Mod
     CommandFields (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
          ( Era era
-> UpdateProtocolParametersConwayOnwards era
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
forall era.
Era era
-> UpdateProtocolParametersConwayOnwards era
-> EraBasedProtocolParametersUpdate era
-> Maybe (CostModelsFile era)
-> File () 'Out
-> GovernanceActionProtocolParametersUpdateCmdArgs era
Cmd.GovernanceActionProtocolParametersUpdateCmdArgs
              Era era
forall era. IsEra era => Era era
Exp.useEra
              (UpdateProtocolParametersConwayOnwards era
 -> EraBasedProtocolParametersUpdate era
 -> Maybe (CostModelsFile era)
 -> File () 'Out
 -> GovernanceActionProtocolParametersUpdateCmdArgs era)
-> Parser (UpdateProtocolParametersConwayOnwards era)
-> Parser
     (EraBasedProtocolParametersUpdate era
      -> Maybe (CostModelsFile era)
      -> File () 'Out
      -> GovernanceActionProtocolParametersUpdateCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (UpdateProtocolParametersConwayOnwards era)
forall era.
IsEra era =>
Parser (UpdateProtocolParametersConwayOnwards era)
pUpdateProtocolParametersPostConway
              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)
pGovActionProtocolParametersUpdate 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
$ String
-> InfoMod (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall a. String -> InfoMod a
Opt.progDesc String
"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 (CostModelsFile era))
pCostModelsFile :: forall era.
ShelleyBasedEra era -> Parser (Maybe (CostModelsFile era))
pCostModelsFile ShelleyBasedEra era
sbe =
  CardanoEra era
-> Parser (Maybe (CostModelsFile era))
-> (AlonzoEraOnwards era -> Parser (Maybe (CostModelsFile era)))
-> Parser (Maybe (CostModelsFile era))
forall (eon :: * -> *) era a.
Eon eon =>
CardanoEra era -> a -> (eon era -> a) -> a
forEraInEon
    (ShelleyBasedEra era -> CardanoEra era
forall era. ShelleyBasedEra era -> CardanoEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ShelleyBasedEra era
sbe)
    (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 ->
        (String -> CostModelsFile era)
-> Maybe String -> 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
CostModelsFile AlonzoEraOnwards era
alonzoOnwards (File CostModels 'In -> CostModelsFile era)
-> (String -> File CostModels 'In) -> String -> CostModelsFile era
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> File CostModels 'In
forall content (direction :: FileDirection).
String -> File content direction
File)
          (Maybe String -> Maybe (CostModelsFile era))
-> Parser (Maybe String) -> Parser (Maybe (CostModelsFile era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser String -> Parser (Maybe String)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser String
pCostModels
    )

pGovernanceActionProtocolParametersUpdateCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionProtocolParametersUpdateCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionProtocolParametersUpdateCmd = do
  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
<$> Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
forall era.
IsEra era =>
Parser (GovernanceActionProtocolParametersUpdateCmdArgs era)
pUpdateProtocolParametersCmd

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
      [ String -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"ref-script-cost-per-byte"
      , String -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields NonNegativeInterval
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"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 ->
    String -> NonNegativeInterval
forall a. HasCallStack => String -> a
error (String -> NonNegativeInterval) -> String -> NonNegativeInterval
forall a b. (a -> b) -> a -> b
$
      [String] -> String
forall a. Monoid a => [a] -> a
mconcat
        [ String
"toNonNegativeIntervalOrErr: "
        , String
"rational out of bounds " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> Rational -> String
forall a. Show a => a -> String
show Rational
r
        ]
  Just NonNegativeInterval
n -> NonNegativeInterval
n

mkProtocolVersionOrErr :: (Natural, Word32) -> L.ProtVer
mkProtocolVersionOrErr :: (Natural, Word32) -> ProtVer
mkProtocolVersionOrErr (Natural
majorProtVer, Word32
minorProtVer) =
  case (Version -> Word32 -> ProtVer
`L.ProtVer` Word32
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 ->
      String -> ProtVer
forall a. HasCallStack => String -> a
error (String -> ProtVer) -> String -> ProtVer
forall a b. (a -> b) -> a -> b
$ String
"mkProtocolVersionOrErr: invalid protocol version " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> (Natural, Word32) -> String
forall a. Show a => a -> String
show (Natural
majorProtVer, Word32
minorProtVer)

pCommonProtocolParameters :: Parser CommonProtocolParametersUpdate
pCommonProtocolParameters :: Parser CommonProtocolParametersUpdate
pCommonProtocolParameters =
  StrictMaybe CoinPerByte
-> StrictMaybe Coin
-> StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe Word16
-> StrictMaybe Coin
-> StrictMaybe Coin
-> StrictMaybe EpochInterval
-> StrictMaybe Word16
-> StrictMaybe NonNegativeInterval
-> StrictMaybe UnitInterval
-> StrictMaybe UnitInterval
-> StrictMaybe Coin
-> CommonProtocolParametersUpdate
CommonProtocolParametersUpdate
    (StrictMaybe CoinPerByte
 -> StrictMaybe Coin
 -> StrictMaybe Word32
 -> StrictMaybe Word32
 -> StrictMaybe Word16
 -> StrictMaybe Coin
 -> StrictMaybe Coin
 -> StrictMaybe EpochInterval
 -> StrictMaybe Word16
 -> StrictMaybe NonNegativeInterval
 -> StrictMaybe UnitInterval
 -> StrictMaybe UnitInterval
 -> StrictMaybe Coin
 -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe CoinPerByte)
-> Parser
     (StrictMaybe Coin
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> CommonProtocolParametersUpdate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (CoinPerByte -> CoinPerByte)
-> Parser (Maybe CoinPerByte) -> Parser (StrictMaybe CoinPerByte)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger CoinPerByte -> CoinPerByte
forall a. a -> a
id (Parser CoinPerByte -> Parser (Maybe CoinPerByte)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser CoinPerByte
pMinFeePerByteFactor)
    Parser
  (StrictMaybe Coin
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe Word16
   -> StrictMaybe Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Coin)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pMinFeeConstantFactor)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe Word16
   -> StrictMaybe Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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 Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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 Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe Coin
      -> StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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 Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Coin)
-> Parser
     (StrictMaybe Coin
      -> StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pKeyRegistDeposit)
    Parser
  (StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Coin)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> CommonProtocolParametersUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pPoolDeposit)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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 Word16
   -> StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe NonNegativeInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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
pNumberOfPools)
    Parser
  (StrictMaybe NonNegativeInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe NonNegativeInterval)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> 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 Coin
   -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe UnitInterval)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe Coin -> 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 Coin -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe UnitInterval)
-> Parser (StrictMaybe Coin -> 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 Coin -> CommonProtocolParametersUpdate)
-> Parser (StrictMaybe Coin)
-> 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
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pMinPoolCost)

pDeprecatedAfterMaryPParams :: Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams :: forall ledgerera. Parser (DeprecatedAfterMaryPParams ledgerera)
pDeprecatedAfterMaryPParams =
  StrictMaybe Coin -> DeprecatedAfterMaryPParams ledgerera
forall ledgerera.
StrictMaybe Coin -> DeprecatedAfterMaryPParams ledgerera
DeprecatedAfterMaryPParams
    (StrictMaybe Coin -> DeprecatedAfterMaryPParams ledgerera)
-> Parser (StrictMaybe Coin)
-> Parser (DeprecatedAfterMaryPParams ledgerera)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
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, Word32) -> ProtVer)
-> Parser (Maybe (Natural, Word32)) -> Parser (StrictMaybe ProtVer)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger (Natural, Word32) -> ProtVer
mkProtocolVersionOrErr (Parser (Natural, Word32) -> Parser (Maybe (Natural, Word32))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (Natural, Word32)
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 Word32
-> StrictMaybe Word16
-> StrictMaybe Word16
-> AlonzoOnwardsPParams ledgerera
forall ledgerera.
StrictMaybe CostModels
-> StrictMaybe Prices
-> StrictMaybe ExUnits
-> StrictMaybe ExUnits
-> StrictMaybe Word32
-> StrictMaybe Word16
-> StrictMaybe Word16
-> 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 Word32
 -> StrictMaybe Word16
 -> StrictMaybe Word16
 -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Prices)
-> Parser
     (StrictMaybe ExUnits
      -> StrictMaybe ExUnits
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> 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 -> String -> Prices
forall a. HasCallStack => String -> a
error (String -> Prices) -> String -> Prices
forall a b. (a -> b) -> a -> b
$ String
"pAlonzoOnwardsPParams: " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ProtocolParametersConversionError -> String
forall a. Show a => a -> String
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 Word32
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe ExUnits)
-> Parser
     (StrictMaybe ExUnits
      -> StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> 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 Word32
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe ExUnits)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> 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 Word32
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe Word16 -> 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
<*> (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
pMaxValueSize)
    Parser
  (StrictMaybe Word16
   -> StrictMaybe Word16 -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> Parser (StrictMaybe Word16 -> 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
<*> (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
pCollateralPercent)
    Parser (StrictMaybe Word16 -> AlonzoOnwardsPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> 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
<*> (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
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
<$> (CoinPerByte -> CoinPerByte)
-> Parser (Maybe CoinPerByte) -> Parser (StrictMaybe CoinPerByte)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger CoinPerByte -> CoinPerByte
forall a. a -> a
id (Parser CoinPerByte -> Parser (Maybe CoinPerByte)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser CoinPerByte
pUTxOCostPerByte)

pIntroducedInConwayPParams :: Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams :: forall ledgerera. Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams =
  StrictMaybe PoolVotingThresholds
-> StrictMaybe DRepVotingThresholds
-> StrictMaybe Word16
-> StrictMaybe EpochInterval
-> StrictMaybe EpochInterval
-> StrictMaybe Coin
-> StrictMaybe Coin
-> StrictMaybe EpochInterval
-> StrictMaybe NonNegativeInterval
-> IntroducedInConwayPParams ledgerera
forall era.
StrictMaybe PoolVotingThresholds
-> StrictMaybe DRepVotingThresholds
-> StrictMaybe Word16
-> StrictMaybe EpochInterval
-> StrictMaybe EpochInterval
-> StrictMaybe Coin
-> StrictMaybe Coin
-> StrictMaybe EpochInterval
-> StrictMaybe NonNegativeInterval
-> IntroducedInConwayPParams era
IntroducedInConwayPParams
    (StrictMaybe PoolVotingThresholds
 -> StrictMaybe DRepVotingThresholds
 -> StrictMaybe Word16
 -> StrictMaybe EpochInterval
 -> StrictMaybe EpochInterval
 -> StrictMaybe Coin
 -> StrictMaybe Coin
 -> StrictMaybe EpochInterval
 -> StrictMaybe NonNegativeInterval
 -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe PoolVotingThresholds)
-> Parser
     (StrictMaybe DRepVotingThresholds
      -> StrictMaybe Word16
      -> StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> 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 Word16
   -> StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe DRepVotingThresholds)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> 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 Word16
   -> StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe EpochInterval
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> 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
<*> (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
pMinCommitteeSize)
    Parser
  (StrictMaybe EpochInterval
   -> StrictMaybe EpochInterval
   -> StrictMaybe Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe EpochInterval
      -> StrictMaybe Coin
      -> StrictMaybe Coin
      -> 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 Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe EpochInterval)
-> Parser
     (StrictMaybe Coin
      -> StrictMaybe Coin
      -> 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 Coin
   -> StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Coin)
-> Parser
     (StrictMaybe Coin
      -> 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
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pNewGovActionDeposit)
    Parser
  (StrictMaybe Coin
   -> StrictMaybe EpochInterval
   -> StrictMaybe NonNegativeInterval
   -> IntroducedInConwayPParams ledgerera)
-> Parser (StrictMaybe Coin)
-> 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
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
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)

pIntroducedInDijkstraPParams :: Parser (IntroducedInDijkstraPParams ledgerera)
pIntroducedInDijkstraPParams :: forall ledgerera. Parser (IntroducedInDijkstraPParams ledgerera)
pIntroducedInDijkstraPParams =
  StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe (NonZero Word32)
-> StrictMaybe PositiveInterval
-> StrictMaybe UnitInterval
-> StrictMaybe MaxPledgeLeverage
-> StrictMaybe Milliseconds32
-> StrictMaybe Milliseconds32
-> StrictMaybe Milliseconds32
-> StrictMaybe Word16
-> StrictMaybe UnitInterval
-> StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe OrdExUnits
-> StrictMaybe Word32
-> StrictMaybe SlotInterval
-> StrictMaybe PositiveInterval
-> StrictMaybe Word16
-> StrictMaybe Word16
-> StrictMaybe (StrictMaybe Word32)
-> StrictMaybe UnitInterval
-> StrictMaybe Coin
-> StrictMaybe CoinPerByte
-> IntroducedInDijkstraPParams ledgerera
forall era.
StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe (NonZero Word32)
-> StrictMaybe PositiveInterval
-> StrictMaybe UnitInterval
-> StrictMaybe MaxPledgeLeverage
-> StrictMaybe Milliseconds32
-> StrictMaybe Milliseconds32
-> StrictMaybe Milliseconds32
-> StrictMaybe Word16
-> StrictMaybe UnitInterval
-> StrictMaybe Word32
-> StrictMaybe Word32
-> StrictMaybe OrdExUnits
-> StrictMaybe Word32
-> StrictMaybe SlotInterval
-> StrictMaybe PositiveInterval
-> StrictMaybe Word16
-> StrictMaybe Word16
-> StrictMaybe (StrictMaybe Word32)
-> StrictMaybe UnitInterval
-> StrictMaybe Coin
-> StrictMaybe CoinPerByte
-> IntroducedInDijkstraPParams era
IntroducedInDijkstraPParams
    (StrictMaybe Word32
 -> StrictMaybe Word32
 -> StrictMaybe (NonZero Word32)
 -> StrictMaybe PositiveInterval
 -> StrictMaybe UnitInterval
 -> StrictMaybe MaxPledgeLeverage
 -> StrictMaybe Milliseconds32
 -> StrictMaybe Milliseconds32
 -> StrictMaybe Milliseconds32
 -> StrictMaybe Word16
 -> StrictMaybe UnitInterval
 -> StrictMaybe Word32
 -> StrictMaybe Word32
 -> StrictMaybe OrdExUnits
 -> StrictMaybe Word32
 -> StrictMaybe SlotInterval
 -> StrictMaybe PositiveInterval
 -> StrictMaybe Word16
 -> StrictMaybe Word16
 -> StrictMaybe (StrictMaybe Word32)
 -> StrictMaybe UnitInterval
 -> StrictMaybe Coin
 -> StrictMaybe CoinPerByte
 -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe (NonZero Word32)
      -> StrictMaybe PositiveInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe MaxPledgeLeverage
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall (f :: * -> *) a b. Functor 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
pMaxRefScriptSizePerBlock)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe (NonZero Word32)
   -> StrictMaybe PositiveInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe MaxPledgeLeverage
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe (NonZero Word32)
      -> StrictMaybe PositiveInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe MaxPledgeLeverage
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pMaxRefScriptSizePerTx)
    Parser
  (StrictMaybe (NonZero Word32)
   -> StrictMaybe PositiveInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe MaxPledgeLeverage
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe (NonZero Word32))
-> Parser
     (StrictMaybe PositiveInterval
      -> StrictMaybe UnitInterval
      -> StrictMaybe MaxPledgeLeverage
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (NonZero Word32 -> NonZero Word32)
-> Parser (Maybe (NonZero Word32))
-> Parser (StrictMaybe (NonZero Word32))
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger NonZero Word32 -> NonZero Word32
forall a. a -> a
id (Parser (NonZero Word32) -> Parser (Maybe (NonZero Word32))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (NonZero Word32)
pRefScriptCostStride)
    Parser
  (StrictMaybe PositiveInterval
   -> StrictMaybe UnitInterval
   -> StrictMaybe MaxPledgeLeverage
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe PositiveInterval)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe MaxPledgeLeverage
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (PositiveInterval -> PositiveInterval)
-> Parser (Maybe PositiveInterval)
-> Parser (StrictMaybe PositiveInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger PositiveInterval -> PositiveInterval
forall a. a -> a
id (Parser PositiveInterval -> Parser (Maybe PositiveInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser PositiveInterval
pRefScriptCostMultiplier)
    Parser
  (StrictMaybe UnitInterval
   -> StrictMaybe MaxPledgeLeverage
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe UnitInterval)
-> Parser
     (StrictMaybe MaxPledgeLeverage
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams 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
pMinPoolMargin)
    Parser
  (StrictMaybe MaxPledgeLeverage
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe MaxPledgeLeverage)
-> Parser
     (StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (StrictMaybe NonNegativeInterval -> MaxPledgeLeverage)
-> Parser (Maybe (StrictMaybe NonNegativeInterval))
-> Parser (StrictMaybe MaxPledgeLeverage)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger StrictMaybe NonNegativeInterval -> MaxPledgeLeverage
L.MaxPledgeLeverage (Parser (StrictMaybe NonNegativeInterval)
-> Parser (Maybe (StrictMaybe NonNegativeInterval))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (StrictMaybe NonNegativeInterval)
pMaxPledgeLeverage)
    Parser
  (StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Milliseconds32)
-> Parser
     (StrictMaybe Milliseconds32
      -> StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Milliseconds32 -> Milliseconds32)
-> Parser (Maybe Milliseconds32)
-> Parser (StrictMaybe Milliseconds32)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Milliseconds32 -> Milliseconds32
forall a. a -> a
id (Parser Milliseconds32 -> Parser (Maybe Milliseconds32)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Milliseconds32
pLeiosAnnouncementPeriodLength)
    Parser
  (StrictMaybe Milliseconds32
   -> StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Milliseconds32)
-> Parser
     (StrictMaybe Milliseconds32
      -> StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Milliseconds32 -> Milliseconds32)
-> Parser (Maybe Milliseconds32)
-> Parser (StrictMaybe Milliseconds32)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Milliseconds32 -> Milliseconds32
forall a. a -> a
id (Parser Milliseconds32 -> Parser (Maybe Milliseconds32)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Milliseconds32
pLeiosVotePeriodLength)
    Parser
  (StrictMaybe Milliseconds32
   -> StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Milliseconds32)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Milliseconds32 -> Milliseconds32)
-> Parser (Maybe Milliseconds32)
-> Parser (StrictMaybe Milliseconds32)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Milliseconds32 -> Milliseconds32
forall a. a -> a
id (Parser Milliseconds32 -> Parser (Maybe Milliseconds32)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Milliseconds32
pLeiosDiffusionPeriodLength)
    Parser
  (StrictMaybe Word16
   -> StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pLeiosCommitteeSize)
    Parser
  (StrictMaybe UnitInterval
   -> StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe UnitInterval)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams 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
pLeiosQuorumStakeThreshold)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pMaxEndorserBlockReferencesSize)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe OrdExUnits
      -> StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pMaxEndorserBlockTxsSize)
    Parser
  (StrictMaybe OrdExUnits
   -> StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe OrdExUnits)
-> Parser
     (StrictMaybe Word32
      -> StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams 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 -> OrdExUnits)
-> Parser (Maybe ExecutionUnits) -> Parser (StrictMaybe OrdExUnits)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger (ExUnits -> OrdExUnits
OrdExUnits (ExUnits -> OrdExUnits)
-> (ExecutionUnits -> ExUnits) -> ExecutionUnits -> OrdExUnits
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExecutionUnits -> ExUnits
toAlonzoExUnits) (Parser ExecutionUnits -> Parser (Maybe ExecutionUnits)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser ExecutionUnits
pMaxEndorserBlockExecutionUnits)
    Parser
  (StrictMaybe Word32
   -> StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word32)
-> Parser
     (StrictMaybe SlotInterval
      -> StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pMaxRefScriptSizePerEndorserBlock)
    Parser
  (StrictMaybe SlotInterval
   -> StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe SlotInterval)
-> Parser
     (StrictMaybe PositiveInterval
      -> StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (SlotInterval -> SlotInterval)
-> Parser (Maybe SlotInterval) -> Parser (StrictMaybe SlotInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger SlotInterval -> SlotInterval
forall a. a -> a
id (Parser SlotInterval -> Parser (Maybe SlotInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser SlotInterval
pPerasMinCandidateBlockAge)
    Parser
  (StrictMaybe PositiveInterval
   -> StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe PositiveInterval)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (PositiveInterval -> PositiveInterval)
-> Parser (Maybe PositiveInterval)
-> Parser (StrictMaybe PositiveInterval)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger PositiveInterval -> PositiveInterval
forall a. a -> a
id (Parser PositiveInterval -> Parser (Maybe PositiveInterval)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser PositiveInterval
pPerasHealingFactor)
    Parser
  (StrictMaybe Word16
   -> StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe Word16
      -> StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pPerasCertBoost)
    Parser
  (StrictMaybe Word16
   -> StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Word16)
-> Parser
     (StrictMaybe (StrictMaybe Word32)
      -> StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
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
pPerasTargetCommitteeSize)
    Parser
  (StrictMaybe (StrictMaybe Word32)
   -> StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe (StrictMaybe Word32))
-> Parser
     (StrictMaybe UnitInterval
      -> StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (StrictMaybe Word32 -> StrictMaybe Word32)
-> Parser (Maybe (StrictMaybe Word32))
-> Parser (StrictMaybe (StrictMaybe Word32))
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger StrictMaybe Word32 -> StrictMaybe Word32
forall a. a -> a
id (Parser (StrictMaybe Word32) -> Parser (Maybe (StrictMaybe Word32))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (StrictMaybe Word32)
pPerasBootstrapRound)
    Parser
  (StrictMaybe UnitInterval
   -> StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe UnitInterval)
-> Parser
     (StrictMaybe Coin
      -> StrictMaybe CoinPerByte
      -> IntroducedInDijkstraPParams 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
pPerasQuorumThresholdSafetyMargin)
    Parser
  (StrictMaybe Coin
   -> StrictMaybe CoinPerByte
   -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe Coin)
-> Parser
     (StrictMaybe CoinPerByte -> IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Coin -> Coin) -> Parser (Maybe Coin) -> Parser (StrictMaybe Coin)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger Coin -> Coin
forall a. a -> a
id (Parser Coin -> Parser (Maybe Coin)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser Coin
pRefInputsCostPerMultiAssetPolicy)
    Parser
  (StrictMaybe CoinPerByte -> IntroducedInDijkstraPParams ledgerera)
-> Parser (StrictMaybe CoinPerByte)
-> Parser (IntroducedInDijkstraPParams ledgerera)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (CoinPerByte -> CoinPerByte)
-> Parser (Maybe CoinPerByte) -> Parser (StrictMaybe CoinPerByte)
forall a b. (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b)
convertToLedger CoinPerByte -> CoinPerByte
forall a. a -> a
id (Parser CoinPerByte -> Parser (Maybe CoinPerByte)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser CoinPerByte
pRefInputsCostPerDatumByte)

pLeiosAnnouncementPeriodLength :: Parser Milliseconds32
pLeiosAnnouncementPeriodLength :: Parser Milliseconds32
pLeiosAnnouncementPeriodLength =
  Word32 -> Milliseconds32
Milliseconds32
    (Word32 -> Milliseconds32)
-> Parser Word32 -> Parser Milliseconds32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
      ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader
      ( [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"leios-announcement-period-length"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"MILLISECONDS"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Length of the Leios announcement period, in milliseconds."
          ]
      )

pLeiosVotePeriodLength :: Parser Milliseconds32
pLeiosVotePeriodLength :: Parser Milliseconds32
pLeiosVotePeriodLength =
  Word32 -> Milliseconds32
Milliseconds32
    (Word32 -> Milliseconds32)
-> Parser Word32 -> Parser Milliseconds32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
      ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader
      ( [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"leios-vote-period-length"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"MILLISECONDS"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Length of the Leios voting period, in milliseconds."
          ]
      )

pLeiosDiffusionPeriodLength :: Parser Milliseconds32
pLeiosDiffusionPeriodLength :: Parser Milliseconds32
pLeiosDiffusionPeriodLength =
  Word32 -> Milliseconds32
Milliseconds32
    (Word32 -> Milliseconds32)
-> Parser Word32 -> Parser Milliseconds32
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
      ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader
      ( [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"leios-diffusion-period-length"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"MILLISECONDS"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Length of the Leios diffusion period, in milliseconds."
          ]
      )

pLeiosCommitteeSize :: Parser Word16
pLeiosCommitteeSize :: Parser Word16
pLeiosCommitteeSize =
  ReadM Word16 -> Mod OptionFields Word16 -> Parser Word16
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word16
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word16 -> Parser Word16)
-> Mod OptionFields Word16 -> Parser Word16
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word16] -> Mod OptionFields Word16
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"leios-committee-size"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD16"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Number of seats on the Leios voting committee."
      ]

pLeiosQuorumStakeThreshold :: Parser Rational
pLeiosQuorumStakeThreshold :: Parser Rational
pLeiosQuorumStakeThreshold =
  ReadM Rational -> Mod OptionFields Rational -> Parser Rational
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Rational
readRational (Mod OptionFields Rational -> Parser Rational)
-> Mod OptionFields Rational -> Parser Rational
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Rational] -> Mod OptionFields Rational
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"leios-quorum-stake-threshold"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Fraction of committee stake required to certify an endorser block."
      ]

pMaxEndorserBlockReferencesSize :: Parser Word32
pMaxEndorserBlockReferencesSize :: Parser Word32
pMaxEndorserBlockReferencesSize =
  ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word32 -> Parser Word32)
-> Mod OptionFields Word32 -> Parser Word32
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-endorser-block-references-size"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum total size of the transaction references in an endorser block."
      ]

pMaxEndorserBlockTxsSize :: Parser Word32
pMaxEndorserBlockTxsSize :: Parser Word32
pMaxEndorserBlockTxsSize =
  ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word32 -> Parser Word32)
-> Mod OptionFields Word32 -> Parser Word32
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-endorser-block-txs-size"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum total size of the transactions referenced by an endorser block."
      ]

pMaxEndorserBlockExecutionUnits :: Parser ExecutionUnits
pMaxEndorserBlockExecutionUnits :: Parser ExecutionUnits
pMaxEndorserBlockExecutionUnits =
  (Natural -> Natural -> ExecutionUnits)
-> (Natural, Natural) -> ExecutionUnits
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Natural -> Natural -> ExecutionUnits
ExecutionUnits
    ((Natural, Natural) -> ExecutionUnits)
-> Parser (Natural, Natural) -> Parser ExecutionUnits
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM (Natural, Natural)
-> Mod OptionFields (Natural, Natural) -> Parser (Natural, Natural)
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
      ReadM (Natural, Natural)
forall a. (Typeable a, Integral a, Bits a) => ReadM (a, a)
pairIntegralReader
      ( [Mod OptionFields (Natural, Natural)]
-> Mod OptionFields (Natural, Natural)
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod OptionFields (Natural, Natural)
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-endorser-block-execution-units"
          , String -> Mod OptionFields (Natural, Natural)
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"(INT, INT)"
          , String -> Mod OptionFields (Natural, Natural)
forall (f :: * -> *) a. String -> Mod f a
Opt.help (String -> Mod OptionFields (Natural, Natural))
-> String -> Mod OptionFields (Natural, Natural)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Max total script execution resource units allowed per endorser "
                , String
"block. They are denominated as follows (steps, memory)."
                ]
          ]
      )

pMaxRefScriptSizePerEndorserBlock :: Parser Word32
pMaxRefScriptSizePerEndorserBlock :: Parser Word32
pMaxRefScriptSizePerEndorserBlock =
  ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word32 -> Parser Word32)
-> Mod OptionFields Word32 -> Parser Word32
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-ref-script-size-per-endorser-block"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum total size of reference scripts per endorser block."
      ]

pMaxRefScriptSizePerBlock :: Parser Word32
pMaxRefScriptSizePerBlock :: Parser Word32
pMaxRefScriptSizePerBlock =
  ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word32 -> Parser Word32)
-> Mod OptionFields Word32 -> Parser Word32
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-ref-script-size-per-block"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum total size of reference scripts per block."
      ]

pMaxRefScriptSizePerTx :: Parser Word32
pMaxRefScriptSizePerTx :: Parser Word32
pMaxRefScriptSizePerTx =
  ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word32 -> Parser Word32)
-> Mod OptionFields Word32 -> Parser Word32
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-ref-script-size-per-tx"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum total size of reference scripts per transaction."
      ]

pRefScriptCostStride :: Parser (NonZero Word32)
pRefScriptCostStride :: Parser (NonZero Word32)
pRefScriptCostStride =
  ReadM (NonZero Word32)
-> Mod OptionFields (NonZero Word32) -> Parser (NonZero Word32)
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
    (ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader ReadM Word32
-> (Word32 -> ReadM (NonZero Word32)) -> ReadM (NonZero Word32)
forall a b. ReadM a -> (a -> ReadM b) -> ReadM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ReadM (NonZero Word32)
-> (NonZero Word32 -> ReadM (NonZero Word32))
-> Maybe (NonZero Word32)
-> ReadM (NonZero Word32)
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> ReadM (NonZero Word32)
forall a. HasCallStack => String -> ReadM a
forall (m :: * -> *) a.
(MonadFail m, HasCallStack) =>
String -> m a
fail String
"ref-script-cost-stride must be non-zero") NonZero Word32 -> ReadM (NonZero Word32)
forall a. a -> ReadM a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe (NonZero Word32) -> ReadM (NonZero Word32))
-> (Word32 -> Maybe (NonZero Word32))
-> Word32
-> ReadM (NonZero Word32)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> Maybe (NonZero Word32)
forall a. HasZero a => a -> Maybe (NonZero a)
nonZero)
    (Mod OptionFields (NonZero Word32) -> Parser (NonZero Word32))
-> Mod OptionFields (NonZero Word32) -> Parser (NonZero Word32)
forall a b. (a -> b) -> a -> b
$ [Mod OptionFields (NonZero Word32)]
-> Mod OptionFields (NonZero Word32)
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields (NonZero Word32)
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"ref-script-cost-stride"
      , String -> Mod OptionFields (NonZero Word32)
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
      , String -> Mod OptionFields (NonZero Word32)
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Reference script cost stride (non-zero) for fee calculation."
      ]

pRefScriptCostMultiplier :: Parser PositiveInterval
pRefScriptCostMultiplier :: Parser PositiveInterval
pRefScriptCostMultiplier =
  ReadM PositiveInterval
-> Mod OptionFields PositiveInterval -> Parser PositiveInterval
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (ReadM Rational
readRational ReadM Rational
-> (Rational -> ReadM PositiveInterval) -> ReadM PositiveInterval
forall a b. ReadM a -> (a -> ReadM b) -> ReadM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Rational -> ReadM PositiveInterval
toPositiveInterval) (Mod OptionFields PositiveInterval -> Parser PositiveInterval)
-> Mod OptionFields PositiveInterval -> Parser PositiveInterval
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields PositiveInterval]
-> Mod OptionFields PositiveInterval
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"ref-script-cost-multiplier"
      , String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Reference script cost multiplier for fee calculation."
      ]

toPositiveInterval :: Rational -> Opt.ReadM PositiveInterval
toPositiveInterval :: Rational -> ReadM PositiveInterval
toPositiveInterval Rational
r =
  ReadM PositiveInterval
-> (PositiveInterval -> ReadM PositiveInterval)
-> Maybe PositiveInterval
-> ReadM PositiveInterval
forall b a. b -> (a -> b) -> Maybe a -> b
maybe
    ( String -> ReadM PositiveInterval
forall a. String -> ReadM a
Opt.readerError (String -> ReadM PositiveInterval)
-> String -> ReadM PositiveInterval
forall a b. (a -> b) -> a -> b
$
        String
"expected a positive rational with numerator and denominator fitting in 64 bits, got: " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> Rational -> String
forall a. Show a => a -> String
show Rational
r
    )
    PositiveInterval -> ReadM PositiveInterval
forall a. a -> ReadM a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
    (Maybe PositiveInterval -> ReadM PositiveInterval)
-> Maybe PositiveInterval -> ReadM PositiveInterval
forall a b. (a -> b) -> a -> b
$ Rational -> Maybe PositiveInterval
forall r. BoundedRational r => Rational -> Maybe r
L.boundRational Rational
r

pMinPoolMargin :: Parser Rational
pMinPoolMargin :: Parser Rational
pMinPoolMargin =
  ReadM Rational -> Mod OptionFields Rational -> Parser Rational
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Rational
readRationalUnitInterval (Mod OptionFields Rational -> Parser Rational)
-> Mod OptionFields Rational -> Parser Rational
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Rational] -> Mod OptionFields Rational
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"min-pool-margin"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Minimum stake pool profit margin."
      ]

-- | Either a leverage bound, or an explicit request to remove the bound.
pMaxPledgeLeverage :: Parser (L.StrictMaybe L.NonNegativeInterval)
pMaxPledgeLeverage :: Parser (StrictMaybe NonNegativeInterval)
pMaxPledgeLeverage =
  [Parser (StrictMaybe NonNegativeInterval)]
-> Parser (StrictMaybe NonNegativeInterval)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
    [ NonNegativeInterval -> StrictMaybe NonNegativeInterval
forall a. a -> StrictMaybe a
L.SJust (NonNegativeInterval -> StrictMaybe NonNegativeInterval)
-> (Rational -> NonNegativeInterval)
-> Rational
-> StrictMaybe NonNegativeInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> NonNegativeInterval
toNonNegativeIntervalOrErr
        (Rational -> StrictMaybe NonNegativeInterval)
-> Parser Rational -> Parser (StrictMaybe NonNegativeInterval)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Rational -> Mod OptionFields Rational -> Parser Rational
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
          ReadM Rational
readRational
          ( [Mod OptionFields Rational] -> Mod OptionFields Rational
forall a. Monoid a => [a] -> a
mconcat
              [ String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"max-pledge-leverage"
              , String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
              , String -> Mod OptionFields Rational
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Maximum pledge leverage used when calculating stake pool rewards."
              ]
          )
    , StrictMaybe NonNegativeInterval
-> Mod FlagFields (StrictMaybe NonNegativeInterval)
-> Parser (StrictMaybe NonNegativeInterval)
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' StrictMaybe NonNegativeInterval
forall a. StrictMaybe a
L.SNothing (Mod FlagFields (StrictMaybe NonNegativeInterval)
 -> Parser (StrictMaybe NonNegativeInterval))
-> Mod FlagFields (StrictMaybe NonNegativeInterval)
-> Parser (StrictMaybe NonNegativeInterval)
forall a b. (a -> b) -> a -> b
$
        [Mod FlagFields (StrictMaybe NonNegativeInterval)]
-> Mod FlagFields (StrictMaybe NonNegativeInterval)
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod FlagFields (StrictMaybe NonNegativeInterval)
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"no-max-pledge-leverage"
          , String -> Mod FlagFields (StrictMaybe NonNegativeInterval)
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Remove the maximum pledge leverage bound."
          ]
    ]

pPerasMinCandidateBlockAge :: Parser L.SlotInterval
pPerasMinCandidateBlockAge :: Parser SlotInterval
pPerasMinCandidateBlockAge =
  Word32 -> SlotInterval
L.SlotInterval
    (Word32 -> SlotInterval) -> Parser Word32 -> Parser SlotInterval
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
      ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader
      ( [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-min-candidate-block-age"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"SLOTS"
          , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Minimum age of a Peras candidate block, in slots."
          ]
      )

pPerasHealingFactor :: Parser PositiveInterval
pPerasHealingFactor :: Parser PositiveInterval
pPerasHealingFactor =
  ReadM PositiveInterval
-> Mod OptionFields PositiveInterval -> Parser PositiveInterval
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (ReadM Rational
readRational ReadM Rational
-> (Rational -> ReadM PositiveInterval) -> ReadM PositiveInterval
forall a b. ReadM a -> (a -> ReadM b) -> ReadM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Rational -> ReadM PositiveInterval
toPositiveInterval) (Mod OptionFields PositiveInterval -> Parser PositiveInterval)
-> Mod OptionFields PositiveInterval -> Parser PositiveInterval
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields PositiveInterval]
-> Mod OptionFields PositiveInterval
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-healing-factor"
      , String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields PositiveInterval
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Peras healing factor."
      ]

pPerasCertBoost :: Parser Word16
pPerasCertBoost :: Parser Word16
pPerasCertBoost =
  ReadM Word16 -> Mod OptionFields Word16 -> Parser Word16
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word16
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word16 -> Parser Word16)
-> Mod OptionFields Word16 -> Parser Word16
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word16] -> Mod OptionFields Word16
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-cert-boost"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD16"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Chain weight boost given by a Peras certificate."
      ]

pPerasTargetCommitteeSize :: Parser Word16
pPerasTargetCommitteeSize :: Parser Word16
pPerasTargetCommitteeSize =
  ReadM Word16 -> Mod OptionFields Word16 -> Parser Word16
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Word16
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader (Mod OptionFields Word16 -> Parser Word16)
-> Mod OptionFields Word16 -> Parser Word16
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Word16] -> Mod OptionFields Word16
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-target-committee-size"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD16"
      , String -> Mod OptionFields Word16
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Target size of the Peras committee."
      ]

-- | Either a bootstrap round, or an explicit request to unset it.
pPerasBootstrapRound :: Parser (L.StrictMaybe Word32)
pPerasBootstrapRound :: Parser (StrictMaybe Word32)
pPerasBootstrapRound =
  [Parser (StrictMaybe Word32)] -> Parser (StrictMaybe Word32)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
    [ Word32 -> StrictMaybe Word32
forall a. a -> StrictMaybe a
L.SJust
        (Word32 -> StrictMaybe Word32)
-> Parser Word32 -> Parser (StrictMaybe Word32)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM Word32 -> Mod OptionFields Word32 -> Parser Word32
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option
          ReadM Word32
forall a. (Typeable a, Integral a, Bits a) => ReadM a
integralReader
          ( [Mod OptionFields Word32] -> Mod OptionFields Word32
forall a. Monoid a => [a] -> a
mconcat
              [ String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-bootstrap-round"
              , String -> Mod OptionFields Word32
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"WORD32"
              , String -> Mod OptionFields Word32
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Peras bootstrap round."
              ]
          )
    , StrictMaybe Word32
-> Mod FlagFields (StrictMaybe Word32)
-> Parser (StrictMaybe Word32)
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' StrictMaybe Word32
forall a. StrictMaybe a
L.SNothing (Mod FlagFields (StrictMaybe Word32)
 -> Parser (StrictMaybe Word32))
-> Mod FlagFields (StrictMaybe Word32)
-> Parser (StrictMaybe Word32)
forall a b. (a -> b) -> a -> b
$
        [Mod FlagFields (StrictMaybe Word32)]
-> Mod FlagFields (StrictMaybe Word32)
forall a. Monoid a => [a] -> a
mconcat
          [ String -> Mod FlagFields (StrictMaybe Word32)
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"no-peras-bootstrap-round"
          , String -> Mod FlagFields (StrictMaybe Word32)
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Unset the Peras bootstrap round."
          ]
    ]

pPerasQuorumThresholdSafetyMargin :: Parser Rational
pPerasQuorumThresholdSafetyMargin :: Parser Rational
pPerasQuorumThresholdSafetyMargin =
  ReadM Rational -> Mod OptionFields Rational -> Parser Rational
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option ReadM Rational
readRationalUnitInterval (Mod OptionFields Rational -> Parser Rational)
-> Mod OptionFields Rational -> Parser Rational
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Rational] -> Mod OptionFields Rational
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"peras-quorum-threshold-safety-margin"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"RATIONAL"
      , String -> Mod OptionFields Rational
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Safety margin for the Peras quorum threshold."
      ]

pRefInputsCostPerMultiAssetPolicy :: Parser L.Coin
pRefInputsCostPerMultiAssetPolicy :: Parser Coin
pRefInputsCostPerMultiAssetPolicy =
  ReadM Coin -> Mod OptionFields Coin -> Parser Coin
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (Parser Coin -> ReadM Coin
forall a. Parser a -> ReadM a
readerFromParsecParser Parser Coin
parseLovelace) (Mod OptionFields Coin -> Parser Coin)
-> Mod OptionFields Coin -> Parser Coin
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields Coin] -> Mod OptionFields Coin
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields Coin
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"ref-inputs-cost-per-multi-asset-policy"
      , String -> Mod OptionFields Coin
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"LOVELACE"
      , String -> Mod OptionFields Coin
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Reference-input cost per multi-asset policy."
      ]

pRefInputsCostPerDatumByte :: Parser L.CoinPerByte
pRefInputsCostPerDatumByte :: Parser CoinPerByte
pRefInputsCostPerDatumByte =
  ReadM CoinPerByte
-> Mod OptionFields CoinPerByte -> Parser CoinPerByte
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (Parser CoinPerByte -> ReadM CoinPerByte
forall a. Parser a -> ReadM a
readerFromParsecParser Parser CoinPerByte
parseCoinPerByte) (Mod OptionFields CoinPerByte -> Parser CoinPerByte)
-> Mod OptionFields CoinPerByte -> Parser CoinPerByte
forall a b. (a -> b) -> a -> b
$
    [Mod OptionFields CoinPerByte] -> Mod OptionFields CoinPerByte
forall a. Monoid a => [a] -> a
mconcat
      [ String -> Mod OptionFields CoinPerByte
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"ref-inputs-cost-per-datum-byte"
      , String -> Mod OptionFields CoinPerByte
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"LOVELACE"
      , String -> Mod OptionFields CoinPerByte
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Reference-input cost per datum byte."
      ]

-- 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

pGovActionProtocolParametersUpdate
  :: ShelleyBasedEra era -> Parser (EraBasedProtocolParametersUpdate era)
pGovActionProtocolParametersUpdate :: forall era.
ShelleyBasedEra era
-> Parser (EraBasedProtocolParametersUpdate era)
pGovActionProtocolParametersUpdate = \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 ConwayEra
-> EraBasedProtocolParametersUpdate era
ConwayEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> AlonzoOnwardsPParams ConwayEra
 -> IntroducedInBabbagePParams ConwayEra
 -> IntroducedInConwayPParams ConwayEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (AlonzoOnwardsPParams ConwayEra
      -> IntroducedInBabbagePParams ConwayEra
      -> IntroducedInConwayPParams ConwayEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (AlonzoOnwardsPParams ConwayEra
   -> IntroducedInBabbagePParams ConwayEra
   -> IntroducedInConwayPParams ConwayEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (AlonzoOnwardsPParams ConwayEra)
-> Parser
     (IntroducedInBabbagePParams ConwayEra
      -> IntroducedInConwayPParams ConwayEra
      -> 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 ConwayEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInBabbagePParams ConwayEra)
-> Parser
     (IntroducedInConwayPParams ConwayEra
      -> 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 ConwayEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInConwayPParams ConwayEra)
-> 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 ConwayEra)
forall ledgerera. Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams
  ShelleyBasedEra era
ShelleyBasedEraDijkstra ->
    CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams DijkstraEra
-> IntroducedInBabbagePParams DijkstraEra
-> IntroducedInConwayPParams (ShelleyLedgerEra DijkstraEra)
-> IntroducedInDijkstraPParams (ShelleyLedgerEra DijkstraEra)
-> EraBasedProtocolParametersUpdate DijkstraEra
CommonProtocolParametersUpdate
-> AlonzoOnwardsPParams DijkstraEra
-> IntroducedInBabbagePParams DijkstraEra
-> IntroducedInConwayPParams DijkstraEra
-> IntroducedInDijkstraPParams DijkstraEra
-> EraBasedProtocolParametersUpdate era
DijkstraEraBasedProtocolParametersUpdate
      (CommonProtocolParametersUpdate
 -> AlonzoOnwardsPParams DijkstraEra
 -> IntroducedInBabbagePParams DijkstraEra
 -> IntroducedInConwayPParams DijkstraEra
 -> IntroducedInDijkstraPParams DijkstraEra
 -> EraBasedProtocolParametersUpdate era)
-> Parser CommonProtocolParametersUpdate
-> Parser
     (AlonzoOnwardsPParams DijkstraEra
      -> IntroducedInBabbagePParams DijkstraEra
      -> IntroducedInConwayPParams DijkstraEra
      -> IntroducedInDijkstraPParams DijkstraEra
      -> EraBasedProtocolParametersUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser CommonProtocolParametersUpdate
pCommonProtocolParameters
      Parser
  (AlonzoOnwardsPParams DijkstraEra
   -> IntroducedInBabbagePParams DijkstraEra
   -> IntroducedInConwayPParams DijkstraEra
   -> IntroducedInDijkstraPParams DijkstraEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (AlonzoOnwardsPParams DijkstraEra)
-> Parser
     (IntroducedInBabbagePParams DijkstraEra
      -> IntroducedInConwayPParams DijkstraEra
      -> IntroducedInDijkstraPParams DijkstraEra
      -> 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 DijkstraEra)
forall ledgerera. Parser (AlonzoOnwardsPParams ledgerera)
pAlonzoOnwardsPParams
      Parser
  (IntroducedInBabbagePParams DijkstraEra
   -> IntroducedInConwayPParams DijkstraEra
   -> IntroducedInDijkstraPParams DijkstraEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInBabbagePParams DijkstraEra)
-> Parser
     (IntroducedInConwayPParams DijkstraEra
      -> IntroducedInDijkstraPParams DijkstraEra
      -> 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 DijkstraEra)
forall ledgerera. Parser (IntroducedInBabbagePParams ledgerera)
pIntroducedInBabbagePParams
      Parser
  (IntroducedInConwayPParams DijkstraEra
   -> IntroducedInDijkstraPParams DijkstraEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInConwayPParams DijkstraEra)
-> Parser
     (IntroducedInDijkstraPParams DijkstraEra
      -> 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 DijkstraEra)
forall ledgerera. Parser (IntroducedInConwayPParams ledgerera)
pIntroducedInConwayPParams
      Parser
  (IntroducedInDijkstraPParams DijkstraEra
   -> EraBasedProtocolParametersUpdate era)
-> Parser (IntroducedInDijkstraPParams DijkstraEra)
-> 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 (IntroducedInDijkstraPParams DijkstraEra)
forall ledgerera. Parser (IntroducedInDijkstraPParams ledgerera)
pIntroducedInDijkstraPParams

pGovernanceActionTreasuryWithdrawalCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionTreasuryWithdrawalCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionTreasuryWithdrawalCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-treasury-withdrawal"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> [(StakeIdentifier, Coin)]
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionTreasuryWithdrawalCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> [(StakeIdentifier, Coin)]
-> Maybe ScriptHash
-> File () 'Out
-> GovernanceActionTreasuryWithdrawalCmdArgs era
Cmd.GovernanceActionTreasuryWithdrawalCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (Network
 -> Coin
 -> StakeIdentifier
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> [(StakeIdentifier, Coin)]
 -> Maybe ScriptHash
 -> File () 'Out
 -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Coin)]
      -> Maybe ScriptHash
      -> File () 'Out
      -> GovernanceActionTreasuryWithdrawalCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Coin
   -> StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Coin)]
      -> 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 Coin
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Coin)]
      -> 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
            Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Coin)]
      -> 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (SafeHash AnchorData)
-> Parser
     (MustCheckHash ProposalUrl
      -> [(StakeIdentifier, Coin)]
      -> 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 AnchorData)
pAnchorDataHash
            Parser
  (MustCheckHash ProposalUrl
   -> [(StakeIdentifier, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser (MustCheckHash ProposalUrl)
-> Parser
     ([(StakeIdentifier, Coin)]
      -> 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, Coin)]
   -> Maybe ScriptHash
   -> File () 'Out
   -> GovernanceActionTreasuryWithdrawalCmdArgs era)
-> Parser [(StakeIdentifier, Coin)]
-> 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, Coin) -> Parser [(StakeIdentifier, Coin)]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some ((,) (StakeIdentifier -> Coin -> (StakeIdentifier, Coin))
-> Parser StakeIdentifier
-> Parser (Coin -> (StakeIdentifier, Coin))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"funds-receiving") Parser (Coin -> (StakeIdentifier, Coin))
-> Parser Coin -> Parser (StakeIdentifier, Coin)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser Coin
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
<*> String -> String -> Parser (File () 'Out)
forall a. String -> String -> Parser (File a 'Out)
pFileOutDirection String
"out-file" String
"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
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"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
              [ String -> Mod FlagFields Network
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"mainnet"
              , String -> Mod FlagFields Network
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"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
              [ String -> Mod FlagFields Network
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"testnet"
              , String -> Mod FlagFields Network
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Use the testnet magic id."
              ]
        ]
      ]

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

pGovernanceActionHardforkInitCmd
  :: Exp.IsEra era => Maybe (Parser (Cmd.GovernanceActionCmds era))
pGovernanceActionHardforkInitCmd :: forall era. IsEra era => Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionHardforkInitCmd = do
  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
$ Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a. Mod CommandFields a -> Parser a
Opt.hsubparser
    (Mod CommandFields (GovernanceActionCmds era)
 -> Parser (GovernanceActionCmds era))
-> Mod CommandFields (GovernanceActionCmds era)
-> Parser (GovernanceActionCmds era)
forall a b. (a -> b) -> a -> b
$ String
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (GovernanceActionCmds era)
forall a. String -> ParserInfo a -> Mod CommandFields a
commandWithMetavar String
"create-hardfork"
    (ParserInfo (GovernanceActionCmds era)
 -> Mod CommandFields (GovernanceActionCmds era))
-> ParserInfo (GovernanceActionCmds era)
-> Mod CommandFields (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
$
          Era era
-> Network
-> Coin
-> StakeIdentifier
-> Maybe GovActionId
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> ProtVer
-> File () 'Out
-> GovernanceActionHardforkInitCmdArgs era
forall era.
Era era
-> Network
-> Coin
-> StakeIdentifier
-> Maybe GovActionId
-> ProposalUrl
-> SafeHash AnchorData
-> MustCheckHash ProposalUrl
-> ProtVer
-> File () 'Out
-> GovernanceActionHardforkInitCmdArgs era
Cmd.GovernanceActionHardforkInitCmdArgs Era era
forall era. IsEra era => Era era
Exp.useEra
            (Network
 -> Coin
 -> StakeIdentifier
 -> Maybe GovActionId
 -> ProposalUrl
 -> SafeHash AnchorData
 -> MustCheckHash ProposalUrl
 -> ProtVer
 -> File () 'Out
 -> GovernanceActionHardforkInitCmdArgs era)
-> Parser Network
-> Parser
     (Coin
      -> StakeIdentifier
      -> Maybe GovActionId
      -> ProposalUrl
      -> SafeHash AnchorData
      -> MustCheckHash ProposalUrl
      -> ProtVer
      -> File () 'Out
      -> GovernanceActionHardforkInitCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Network
pNetwork
            Parser
  (Coin
   -> StakeIdentifier
   -> Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser Coin
-> Parser
     (StakeIdentifier
      -> Maybe GovActionId
      -> ProposalUrl
      -> SafeHash 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 Coin
pGovActionDeposit
            Parser
  (StakeIdentifier
   -> Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser StakeIdentifier
-> Parser
     (Maybe GovActionId
      -> ProposalUrl
      -> SafeHash 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 String -> Parser StakeIdentifier
pStakeIdentifier (String -> Maybe String
forall a. a -> Maybe a
Just String
"deposit-return")
            Parser
  (Maybe GovActionId
   -> ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (Maybe GovActionId)
-> Parser
     (ProposalUrl
      -> SafeHash 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 GovActionId)
pPreviousGovernanceAction
            Parser
  (ProposalUrl
   -> SafeHash AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser ProposalUrl
-> Parser
     (SafeHash 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 AnchorData
   -> MustCheckHash ProposalUrl
   -> ProtVer
   -> File () 'Out
   -> GovernanceActionHardforkInitCmdArgs era)
-> Parser (SafeHash 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 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
<*> String -> String -> Parser (File () 'Out)
forall a. String -> String -> Parser (File a 'Out)
pFileOutDirection String
"out-file" String
"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
$ String -> InfoMod (GovernanceActionCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create a hardfork initiation proposal."