Skip to content

Commit

Permalink
Merge pull request #344 from input-output-hk/smelc/new-committee-beco…
Browse files Browse the repository at this point in the history
…mes-update-committee

Rename create-new-committee into update-committee
  • Loading branch information
smelc authored Oct 9, 2023
2 parents 8946a00 + 7b2bc45 commit b62b162
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 97 deletions.
34 changes: 17 additions & 17 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Cardano.CLI.EraBased.Commands.Governance.Actions
( AnyStakeIdentifier(..)
, GovernanceActionCmds(..)
, NewCommitteeCmd(..)
, UpdateCommitteeCmd(..)
, NewConstitutionCmd(..)
, NewInfoCmd(..)
, NoConfidenceCmd(..)
Expand All @@ -27,9 +27,9 @@ data GovernanceActionCmds era
= GovernanceActionCreateConstitutionCmd
(ConwayEraOnwards era)
NewConstitutionCmd
| GoveranceActionCreateNewCommitteeCmd
| GoveranceActionUpdateCommitteeCmd
(ConwayEraOnwards era)
NewCommitteeCmd
UpdateCommitteeCmd
| GovernanceActionCreateNoConfidenceCmd
(ConwayEraOnwards era)
NoConfidenceCmd
Expand All @@ -47,18 +47,18 @@ data GovernanceActionCmds era
NewInfoCmd
deriving Show

data NewCommitteeCmd
= NewCommitteeCmd
{ ebNetwork :: Ledger.Network
, ebDeposit :: Lovelace
, ebReturnAddress :: AnyStakeIdentifier
, ebProposalUrl :: ProposalUrl
, ebProposalHashSource :: ProposalHashSource
, ebOldCommittee :: [VerificationKeyOrHashOrFile CommitteeColdKey]
, ebNewCommittee :: [(VerificationKeyOrHashOrFile CommitteeColdKey, EpochNo)]
, ebRequiredQuorum :: Rational
, ebPreviousGovActionId :: Maybe (TxId, Word32)
, ebFilePath :: File () Out
data UpdateCommitteeCmd
= UpdateCommitteeCmd
{ ucNetwork :: Ledger.Network
, ucDeposit :: Lovelace
, ucReturnAddress :: AnyStakeIdentifier
, ucProposalUrl :: ProposalUrl
, ucProposalHashSource :: ProposalHashSource
, ucOldCommittee :: [VerificationKeyOrHashOrFile CommitteeColdKey]
, ucNewCommittee :: [(VerificationKeyOrHashOrFile CommitteeColdKey, EpochNo)]
, ucRequiredQuorum :: Rational
, ucPreviousGovActionId :: Maybe (TxId, Word32)
, ucFilePath :: File () Out
} deriving Show

data NewConstitutionCmd
Expand Down Expand Up @@ -119,8 +119,8 @@ renderGovernanceActionCmds = ("governance action " <>) . \case
GovernanceActionTreasuryWithdrawalCmd {} ->
"create-treasury-withdrawal"

GoveranceActionCreateNewCommitteeCmd {} ->
"create-new-committee"
GoveranceActionUpdateCommitteeCmd {} ->
"update-committee"

GovernanceActionCreateNoConfidenceCmd {} ->
"create-no-confidence"
Expand Down
20 changes: 10 additions & 10 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pGovernanceActionCmds era =
]
)
[ pGovernanceActionNewConstitutionCmd era
, pGovernanceActionNewCommitteeCmd era
, pGovernanceActionUpdateCommitteeCmd era
, pGovernanceActionNewInfoCmd era
, pGovernanceActionNoConfidenceCmd era
, pGovernanceActionProtocolParametersUpdateCmd era
Expand Down Expand Up @@ -81,22 +81,22 @@ pGovernanceActionNewConstitutionCmd era = do
)
$ Opt.progDesc "Create a constitution."

pGovernanceActionNewCommitteeCmd
pGovernanceActionUpdateCommitteeCmd
:: CardanoEra era
-> Maybe (Parser (GovernanceActionCmds era))
pGovernanceActionNewCommitteeCmd era = do
pGovernanceActionUpdateCommitteeCmd era = do
cOn <- forEraMaybeEon era
pure
$ subParser "create-new-committee"
$ subParser "update-committee"
$ Opt.info
( GoveranceActionCreateNewCommitteeCmd cOn
<$> pNewCommitteeCmd
( GoveranceActionUpdateCommitteeCmd cOn
<$> pUpdateCommitteeCmd
)
$ Opt.progDesc "Create a new committee proposal."
$ Opt.progDesc "Create or update a new committee proposal."

pNewCommitteeCmd :: Parser NewCommitteeCmd
pNewCommitteeCmd =
NewCommitteeCmd
pUpdateCommitteeCmd :: Parser UpdateCommitteeCmd
pUpdateCommitteeCmd =
UpdateCommitteeCmd
<$> pNetwork
<*> pGovActionDeposit
<*> pAnyStakeIdentifier Nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runGovernanceActionCmds = \case
GovernanceActionTreasuryWithdrawalCmd cOn treasuryWithdrawal ->
runGovernanceActionTreasuryWithdrawalCmd cOn treasuryWithdrawal

GoveranceActionCreateNewCommitteeCmd con newCommittee ->
GoveranceActionUpdateCommitteeCmd con newCommittee ->
runGovernanceActionCreateNewCommitteeCmd con newCommittee

GovernanceActionCreateNoConfidenceCmd cOn noConfidence ->
Expand Down Expand Up @@ -136,9 +136,9 @@ runGovernanceActionCreateConstitutionCmd cOn (NewConstitutionCmd network deposit
-- with the new ledger types
runGovernanceActionCreateNewCommitteeCmd
:: ConwayEraOnwards era
-> NewCommitteeCmd
-> UpdateCommitteeCmd
-> ExceptT GovernanceActionsError IO ()
runGovernanceActionCreateNewCommitteeCmd cOn (NewCommitteeCmd network deposit retAddr proposalUrl proposalHashSource old new q prevActId oFp) = do
runGovernanceActionCreateNewCommitteeCmd cOn (UpdateCommitteeCmd network deposit retAddr proposalUrl proposalHashSource old new q prevActId oFp) = do
let sbe = conwayEraOnwardsToShelleyBasedEra cOn -- TODO: Conway era - update vote creation related function to take ConwayEraOnwards
govActIdentifier = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> prevActId
quorumRational = toRational q
Expand Down
66 changes: 33 additions & 33 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -6193,7 +6193,7 @@ Usage: cardano-cli conway governance (action | committee | drep | vote)

Usage: cardano-cli conway governance action
( create-constitution
| create-new-committee
| update-committee
| create-info
| create-no-confidence
| create-protocol-parameters-update
Expand Down Expand Up @@ -6230,39 +6230,39 @@ Usage: cardano-cli conway governance action create-constitution

Create a constitution.

Usage: cardano-cli conway governance action create-new-committee
( --mainnet
| --testnet
)
--governance-action-deposit NATURAL
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILE
| --stake-pool-id STAKE_POOL_ID
| --stake-verification-key STRING
| --stake-verification-key-file FILE
| --stake-key-hash HASH
)
--proposal-url TEXT
( --proposal-text TEXT
| --proposal-file FILE
| --proposal-hash HASH
)
[ --remove-cc-cold-verification-key STRING
| --remove-cc-cold-verification-key-file FILE
| --remove-cc-cold-verification-key-hash STRING
]
[
( --add-cc-cold-verification-key STRING
| --add-cc-cold-verification-key-file FILE
| --add-cc-cold-verification-key-hash STRING
)
--epoch NATURAL]
--quorum RATIONAL
[--governance-action-tx-id TXID
--governance-action-index WORD32]
--out-file FILE
Usage: cardano-cli conway governance action update-committee
( --mainnet
| --testnet
)
--governance-action-deposit NATURAL
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILE
| --stake-pool-id STAKE_POOL_ID
| --stake-verification-key STRING
| --stake-verification-key-file FILE
| --stake-key-hash HASH
)
--proposal-url TEXT
( --proposal-text TEXT
| --proposal-file FILE
| --proposal-hash HASH
)
[ --remove-cc-cold-verification-key STRING
| --remove-cc-cold-verification-key-file FILE
| --remove-cc-cold-verification-key-hash STRING
]
[
( --add-cc-cold-verification-key STRING
| --add-cc-cold-verification-key-file FILE
| --add-cc-cold-verification-key-hash STRING
)
--epoch NATURAL]
--quorum RATIONAL
[--governance-action-tx-id TXID
--governance-action-index WORD32]
--out-file FILE

Create a new committee proposal.
Create or update a new committee proposal.

Usage: cardano-cli conway governance action create-info (--mainnet | --testnet)
--governance-action-deposit NATURAL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Usage: cardano-cli conway governance action
( create-constitution
| create-new-committee
| update-committee
| create-info
| create-no-confidence
| create-protocol-parameters-update
Expand All @@ -14,7 +14,7 @@ Available options:

Available commands:
create-constitution Create a constitution.
create-new-committee Create a new committee proposal.
update-committee Create or update a new committee proposal.
create-info Create an info action.
create-no-confidence Create a no confidence proposal.
create-protocol-parameters-update
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
Usage: cardano-cli conway governance action create-new-committee
( --mainnet
| --testnet
)
--governance-action-deposit NATURAL
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILE
| --stake-pool-id STAKE_POOL_ID
| --stake-verification-key STRING
| --stake-verification-key-file FILE
| --stake-key-hash HASH
)
--proposal-url TEXT
( --proposal-text TEXT
| --proposal-file FILE
| --proposal-hash HASH
)
[ --remove-cc-cold-verification-key STRING
| --remove-cc-cold-verification-key-file FILE
| --remove-cc-cold-verification-key-hash STRING
]
[
( --add-cc-cold-verification-key STRING
| --add-cc-cold-verification-key-file FILE
| --add-cc-cold-verification-key-hash STRING
)
--epoch NATURAL]
--quorum RATIONAL
[--governance-action-tx-id TXID
--governance-action-index WORD32]
--out-file FILE
Usage: cardano-cli conway governance action update-committee
( --mainnet
| --testnet
)
--governance-action-deposit NATURAL
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILE
| --stake-pool-id STAKE_POOL_ID
| --stake-verification-key STRING
| --stake-verification-key-file FILE
| --stake-key-hash HASH
)
--proposal-url TEXT
( --proposal-text TEXT
| --proposal-file FILE
| --proposal-hash HASH
)
[ --remove-cc-cold-verification-key STRING
| --remove-cc-cold-verification-key-file FILE
| --remove-cc-cold-verification-key-hash STRING
]
[
( --add-cc-cold-verification-key STRING
| --add-cc-cold-verification-key-file FILE
| --add-cc-cold-verification-key-hash STRING
)
--epoch NATURAL]
--quorum RATIONAL
[--governance-action-tx-id TXID
--governance-action-index WORD32]
--out-file FILE

Create a new committee proposal.
Create or update a new committee proposal.

Available options:
--mainnet Use the mainnet magic id.
Expand Down

0 comments on commit b62b162

Please sign in to comment.