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

module Cardano.CLI.EraBased.Options.Governance
  ( GovernanceCmds (..)
  , renderGovernanceCmds
  , pGovernanceCmds
  )
where

import           Cardano.Api (ShelleyBasedEra, ShelleyToBabbageEra, forShelleyBasedEraMaybeEon)

import           Cardano.CLI.EraBased.Commands.Governance
import           Cardano.CLI.EraBased.Options.Common
import           Cardano.CLI.EraBased.Options.Governance.Actions
import           Cardano.CLI.EraBased.Options.Governance.Committee
import           Cardano.CLI.EraBased.Options.Governance.DRep
import           Cardano.CLI.EraBased.Options.Governance.Poll
import           Cardano.CLI.EraBased.Options.Governance.Vote
import           Cardano.CLI.Parser

import           Data.Foldable
import           Options.Applicative
import qualified Options.Applicative as Opt

-- First TODO: Change CardanoEra era to ShelleyBasedEra era
-- Second TODO: Return Parser (GovernanceCmds era) because it's not possible
-- for this to return Nothing when it's parameterized on ShelleyBasedEra era
pGovernanceCmds
  :: ()
  => ShelleyBasedEra era
  -> Maybe (Parser (GovernanceCmds era))
pGovernanceCmds :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pGovernanceCmds ShelleyBasedEra era
era =
  String
-> InfoMod (GovernanceCmds era)
-> [Maybe (Parser (GovernanceCmds era))]
-> Maybe (Parser (GovernanceCmds era))
forall a.
String -> InfoMod a -> [Maybe (Parser a)] -> Maybe (Parser a)
subInfoParser
    String
"governance"
    ( String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (GovernanceCmds era))
-> String -> InfoMod (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Governance commands."
          ]
    )
    [ ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pCreateMirCertificatesCmds ShelleyBasedEra era
era
    , ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pGovernanceGenesisKeyDelegationCertificate ShelleyBasedEra era
era
    , (GovernanceActionCmds era -> GovernanceCmds era)
-> Parser (GovernanceActionCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceActionCmds era -> GovernanceCmds era
forall era. GovernanceActionCmds era -> GovernanceCmds era
GovernanceActionCmds (Parser (GovernanceActionCmds era) -> Parser (GovernanceCmds era))
-> Maybe (Parser (GovernanceActionCmds era))
-> Maybe (Parser (GovernanceCmds era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionCmds ShelleyBasedEra era
era
    , (GovernanceCommitteeCmds era -> GovernanceCmds era)
-> Parser (GovernanceCommitteeCmds era)
-> Parser (GovernanceCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceCommitteeCmds era -> GovernanceCmds era
forall era. GovernanceCommitteeCmds era -> GovernanceCmds era
GovernanceCommitteeCmds (Parser (GovernanceCommitteeCmds era)
 -> Parser (GovernanceCmds era))
-> Maybe (Parser (GovernanceCommitteeCmds era))
-> Maybe (Parser (GovernanceCmds era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> Maybe (Parser (GovernanceCommitteeCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCommitteeCmds era))
pGovernanceCommitteeCmds ShelleyBasedEra era
era
    , (GovernanceDRepCmds era -> GovernanceCmds era)
-> Parser (GovernanceDRepCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceDRepCmds era -> GovernanceCmds era
forall era. GovernanceDRepCmds era -> GovernanceCmds era
GovernanceDRepCmds (Parser (GovernanceDRepCmds era) -> Parser (GovernanceCmds era))
-> Maybe (Parser (GovernanceDRepCmds era))
-> Maybe (Parser (GovernanceCmds era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> Maybe (Parser (GovernanceDRepCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceDRepCmds era))
pGovernanceDRepCmds ShelleyBasedEra era
era
    , (GovernancePollCmds era -> GovernanceCmds era)
-> Parser (GovernancePollCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernancePollCmds era -> GovernanceCmds era
forall era. GovernancePollCmds era -> GovernanceCmds era
GovernancePollCmds (Parser (GovernancePollCmds era) -> Parser (GovernanceCmds era))
-> Maybe (Parser (GovernancePollCmds era))
-> Maybe (Parser (GovernanceCmds era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> Maybe (Parser (GovernancePollCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernancePollCmds era))
pGovernancePollCmds ShelleyBasedEra era
era
    , (GovernanceVoteCmds era -> GovernanceCmds era)
-> Parser (GovernanceVoteCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GovernanceVoteCmds era -> GovernanceCmds era
forall era. GovernanceVoteCmds era -> GovernanceCmds era
GovernanceVoteCmds (Parser (GovernanceVoteCmds era) -> Parser (GovernanceCmds era))
-> Maybe (Parser (GovernanceVoteCmds era))
-> Maybe (Parser (GovernanceCmds era))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> Maybe (Parser (GovernanceVoteCmds era))
forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceVoteCmds era))
pGovernanceVoteCmds ShelleyBasedEra era
era
    ]

pCreateMirCertificatesCmds :: ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pCreateMirCertificatesCmds :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pCreateMirCertificatesCmds ShelleyBasedEra era
era = do
  ShelleyToBabbageEra era
w <- ShelleyBasedEra era -> Maybe (ShelleyToBabbageEra era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceCmds era) -> Maybe (Parser (GovernanceCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (GovernanceCmds era)
 -> Maybe (Parser (GovernanceCmds era)))
-> Parser (GovernanceCmds era)
-> Maybe (Parser (GovernanceCmds era))
forall a b. (a -> b) -> a -> b
$
    String
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"create-mir-certificate" (ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era))
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (GovernanceCmds era)
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pMIRPayStakeAddresses ShelleyToBabbageEra era
w Parser (GovernanceCmds era)
-> Parser (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. Parser a -> Parser a -> Parser a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
mirCertParsers ShelleyToBabbageEra era
w) (InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era))
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create an MIR (Move Instantaneous Rewards) certificate"

mirCertParsers
  :: ()
  => ShelleyToBabbageEra era
  -> Parser (GovernanceCmds era)
mirCertParsers :: forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
mirCertParsers ShelleyToBabbageEra era
w =
  [Parser (GovernanceCmds era)] -> Parser (GovernanceCmds era)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
    [ String
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-addresses" (ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era))
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        Parser (GovernanceCmds era)
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pMIRPayStakeAddresses ShelleyToBabbageEra era
w) (InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era))
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
          String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create an MIR certificate to pay stake addresses"
    , String
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"transfer-to-treasury" (ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era))
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        Parser (GovernanceCmds era)
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToTreasuryCmd ShelleyToBabbageEra era
w) (InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era))
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
          String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create an MIR certificate to transfer from the reserves pot to the treasury pot"
    , String
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"transfer-to-rewards" (ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era))
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        Parser (GovernanceCmds era)
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToReservesCmd ShelleyToBabbageEra era
w) (InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era))
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
          String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create an MIR certificate to transfer from the treasury pot to the reserves pot"
    ]

pMIRPayStakeAddresses
  :: ()
  => ShelleyToBabbageEra era
  -> Parser (GovernanceCmds era)
pMIRPayStakeAddresses :: forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pMIRPayStakeAddresses ShelleyToBabbageEra era
w =
  ShelleyToBabbageEra era
-> MIRPot
-> [StakeAddress]
-> [Coin]
-> File () 'Out
-> GovernanceCmds era
forall era.
ShelleyToBabbageEra era
-> MIRPot
-> [StakeAddress]
-> [Coin]
-> File () 'Out
-> GovernanceCmds era
GovernanceCreateMirCertificateStakeAddressesCmd ShelleyToBabbageEra era
w
    (MIRPot
 -> [StakeAddress] -> [Coin] -> File () 'Out -> GovernanceCmds era)
-> Parser MIRPot
-> Parser
     ([StakeAddress] -> [Coin] -> File () 'Out -> GovernanceCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser MIRPot
pMIRPot
    Parser
  ([StakeAddress] -> [Coin] -> File () 'Out -> GovernanceCmds era)
-> Parser [StakeAddress]
-> Parser ([Coin] -> File () 'Out -> GovernanceCmds 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 StakeAddress -> Parser [StakeAddress]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some (Maybe String -> Parser StakeAddress
pStakeAddress Maybe String
forall a. Maybe a
Nothing)
    Parser ([Coin] -> File () 'Out -> GovernanceCmds era)
-> Parser [Coin] -> Parser (File () 'Out -> GovernanceCmds 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 -> Parser [Coin]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some Parser Coin
pRewardAmt
    Parser (File () 'Out -> GovernanceCmds era)
-> Parser (File () 'Out) -> Parser (GovernanceCmds 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

pGovernanceCreateMirCertificateTransferToTreasuryCmd
  :: ()
  => ShelleyToBabbageEra era
  -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToTreasuryCmd :: forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToTreasuryCmd ShelleyToBabbageEra era
w =
  ShelleyToBabbageEra era
-> Coin -> File () 'Out -> GovernanceCmds era
forall era.
ShelleyToBabbageEra era
-> Coin -> File () 'Out -> GovernanceCmds era
GovernanceCreateMirCertificateTransferToTreasuryCmd ShelleyToBabbageEra era
w
    (Coin -> File () 'Out -> GovernanceCmds era)
-> Parser Coin -> Parser (File () 'Out -> GovernanceCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Coin
pTransferAmt
    Parser (File () 'Out -> GovernanceCmds era)
-> Parser (File () 'Out) -> Parser (GovernanceCmds 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

pGovernanceCreateMirCertificateTransferToReservesCmd
  :: ()
  => ShelleyToBabbageEra era
  -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToReservesCmd :: forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
pGovernanceCreateMirCertificateTransferToReservesCmd ShelleyToBabbageEra era
w =
  ShelleyToBabbageEra era
-> Coin -> File () 'Out -> GovernanceCmds era
forall era.
ShelleyToBabbageEra era
-> Coin -> File () 'Out -> GovernanceCmds era
GovernanceCreateMirCertificateTransferToReservesCmd ShelleyToBabbageEra era
w
    (Coin -> File () 'Out -> GovernanceCmds era)
-> Parser Coin -> Parser (File () 'Out -> GovernanceCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser Coin
pTransferAmt
    Parser (File () 'Out -> GovernanceCmds era)
-> Parser (File () 'Out) -> Parser (GovernanceCmds 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

pGovernanceGenesisKeyDelegationCertificate
  :: ()
  => ShelleyBasedEra era
  -> Maybe (Parser (GovernanceCmds era))
pGovernanceGenesisKeyDelegationCertificate :: forall era.
ShelleyBasedEra era -> Maybe (Parser (GovernanceCmds era))
pGovernanceGenesisKeyDelegationCertificate ShelleyBasedEra era
era = do
  ShelleyToBabbageEra era
w <- ShelleyBasedEra era -> Maybe (ShelleyToBabbageEra era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (GovernanceCmds era) -> Maybe (Parser (GovernanceCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (GovernanceCmds era)
 -> Maybe (Parser (GovernanceCmds era)))
-> Parser (GovernanceCmds era)
-> Maybe (Parser (GovernanceCmds era))
forall a b. (a -> b) -> a -> b
$
    String
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"create-genesis-key-delegation-certificate" (ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era))
-> ParserInfo (GovernanceCmds era) -> Parser (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (GovernanceCmds era)
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
forall era. ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
parser ShelleyToBabbageEra era
w) (InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era))
-> InfoMod (GovernanceCmds era) -> ParserInfo (GovernanceCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (GovernanceCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Create a genesis key delegation certificate"
 where
  parser :: ShelleyToBabbageEra era -> Parser (GovernanceCmds era)
parser ShelleyToBabbageEra era
w =
    ShelleyToBabbageEra era
-> VerificationKeyOrHashOrFile GenesisKey
-> VerificationKeyOrHashOrFile GenesisDelegateKey
-> VerificationKeyOrHashOrFile VrfKey
-> File () 'Out
-> GovernanceCmds era
forall era.
ShelleyToBabbageEra era
-> VerificationKeyOrHashOrFile GenesisKey
-> VerificationKeyOrHashOrFile GenesisDelegateKey
-> VerificationKeyOrHashOrFile VrfKey
-> File () 'Out
-> GovernanceCmds era
GovernanceGenesisKeyDelegationCertificate ShelleyToBabbageEra era
w
      (VerificationKeyOrHashOrFile GenesisKey
 -> VerificationKeyOrHashOrFile GenesisDelegateKey
 -> VerificationKeyOrHashOrFile VrfKey
 -> File () 'Out
 -> GovernanceCmds era)
-> Parser (VerificationKeyOrHashOrFile GenesisKey)
-> Parser
     (VerificationKeyOrHashOrFile GenesisDelegateKey
      -> VerificationKeyOrHashOrFile VrfKey
      -> File () 'Out
      -> GovernanceCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (VerificationKeyOrHashOrFile GenesisKey)
pGenesisVerificationKeyOrHashOrFile
      Parser
  (VerificationKeyOrHashOrFile GenesisDelegateKey
   -> VerificationKeyOrHashOrFile VrfKey
   -> File () 'Out
   -> GovernanceCmds era)
-> Parser (VerificationKeyOrHashOrFile GenesisDelegateKey)
-> Parser
     (VerificationKeyOrHashOrFile VrfKey
      -> File () 'Out -> GovernanceCmds 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 (VerificationKeyOrHashOrFile GenesisDelegateKey)
pGenesisDelegateVerificationKeyOrHashOrFile
      Parser
  (VerificationKeyOrHashOrFile VrfKey
   -> File () 'Out -> GovernanceCmds era)
-> Parser (VerificationKeyOrHashOrFile VrfKey)
-> Parser (File () 'Out -> GovernanceCmds 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 (VerificationKeyOrHashOrFile VrfKey)
pVrfVerificationKeyOrHashOrFile
      Parser (File () 'Out -> GovernanceCmds era)
-> Parser (File () 'Out) -> Parser (GovernanceCmds 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