-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disambiguate 2-n flags in governance new-committee action #302
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ pGovernanceActionNewInfoCmd era = do | |
NewInfoCmd | ||
<$> pNetwork | ||
<*> pGovActionDeposit | ||
<*> pAnyStakeIdentifier | ||
<*> pAnyStakeIdentifier Nothing | ||
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
<*> pFileOutDirection "out-file" "Path to action file to be used later on with build or build-raw " | ||
|
@@ -71,7 +71,7 @@ pGovernanceActionNewConstitutionCmd era = do | |
NewConstitutionCmd | ||
<$> pNetwork | ||
<*> pGovActionDeposit | ||
<*> pAnyStakeIdentifier | ||
<*> pAnyStakeIdentifier Nothing | ||
<*> pPreviousGovernanceAction | ||
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
|
@@ -99,11 +99,11 @@ pNewCommitteeCmd = | |
NewCommitteeCmd | ||
<$> pNetwork | ||
<*> pGovActionDeposit | ||
<*> pAnyStakeIdentifier | ||
<*> pAnyStakeIdentifier Nothing | ||
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
<*> many pAnyStakeIdentifier | ||
<*> many ((,) <$> pAnyStakeIdentifier <*> pEpochNo "Committee member expiry epoch") | ||
<*> many (pAnyStakeIdentifier (Just "remove-cc")) | ||
<*> many ((,) <$> pAnyStakeIdentifier (Just "add-cc") <*> pEpochNo "Committee member expiry epoch") | ||
<*> pRational "quorum" "Quorum of the committee that is necessary for a successful vote." | ||
<*> pPreviousGovernanceAction | ||
<*> pOutputFile | ||
|
@@ -121,7 +121,7 @@ pGovernanceActionNoConfidenceCmd era = do | |
NoConfidenceCmd | ||
<$> pNetwork | ||
<*> pGovActionDeposit | ||
<*> pAnyStakeIdentifier | ||
<*> pAnyStakeIdentifier Nothing | ||
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
<*> pTxId "governance-action-tx-id" "Previous txid of `NoConfidence` or `NewCommittee` governance action." | ||
|
@@ -130,10 +130,11 @@ pGovernanceActionNoConfidenceCmd era = do | |
) | ||
$ Opt.progDesc "Create a no confidence proposal." | ||
|
||
pAnyStakeIdentifier :: Parser AnyStakeIdentifier | ||
pAnyStakeIdentifier = | ||
asum [ AnyStakePoolKey <$> pStakePoolVerificationKeyOrHashOrFile | ||
, AnyStakeKey <$> pStakeVerificationKeyOrHashOrFile | ||
-- | The first argument is the optional prefix. | ||
pAnyStakeIdentifier :: Maybe String -> Parser AnyStakeIdentifier | ||
pAnyStakeIdentifier prefix = | ||
asum [ AnyStakePoolKey <$> pStakePoolVerificationKeyOrHashOrFile prefix | ||
, AnyStakeKey <$> pStakeVerificationKeyOrHashOrFile prefix | ||
] | ||
|
||
pGovernanceActionProtocolParametersUpdateCmd | ||
|
@@ -321,10 +322,10 @@ pGovernanceActionTreasuryWithdrawalCmd era = do | |
TreasuryWithdrawalCmd | ||
<$> pNetwork | ||
<*> pGovActionDeposit | ||
<*> pAnyStakeIdentifier | ||
<*> pAnyStakeIdentifier Nothing | ||
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
<*> many ((,) <$> pAnyStakeIdentifier <*> pTransferAmt) | ||
<*> many ((,) <$> pAnyStakeIdentifier Nothing <*> pTransferAmt) -- TODO we should likely pass a prefix here, becaus pAnyStakeIdentiefier is used twice | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, I think this should be included in this pr. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would do a separate PR, because it's a different command. I can do this other PR soon after this one is merged. |
||
<*> pFileOutDirection "out-file" "Output filepath of the treasury withdrawal." | ||
) | ||
$ Opt.progDesc "Create a treasury withdrawal." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use
IsString
here:this way we could just write
"remove-cc"
instead withoutJust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, generally speaking, this instance looks surprising to me (in other words: I'd be surprised to have in my context 🙂).
Also the occurrences of
Just "prefix"
are actually quite rare, most of this PR is just passing the prefix in context around.