-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
On the current state of this PR, the
|
@CarlosLopezDeLara> if I retry your earlier example from Slack, it now fails differently: > cabal run cardano-cli -- conway governance action create-new-committee --testnet --governance-action-deposit 0 --stake-verification-key-file utxo-keys/stake1.vkey --proposal-url https://tinyurl.com/3wrwb2as --proposal-file proposal.txt --remove-cc-cold-verification-key-file cc/cc-cold.vkey --add-cc-cold-verification-key-file cc/cc-cold1.vkey --epoch 5 --quorum
1/100 --out-file new-cc.action
cardano-cli: proposal.txt: withBinaryFile: does not exist (No such file or directory) Whereas before this PR, I was reproducing your parsing failure. So I think we're good. |
52adb31
to
c457776
Compare
@CarlosLopezDeLara> while doing this PR, I realized we likely have the same kind of problem for |
c457776
to
46fb3fa
Compare
<*> pProposalUrl | ||
<*> pProposalHashSource | ||
<*> many pAnyStakeIdentifier | ||
<*> many ((,) <$> pAnyStakeIdentifier <*> pEpochNo "Committee member expiry epoch") | ||
<*> many (pAnyStakeIdentifier (Just "remove-cc")) |
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:
instance IsString a => IsString (Maybe a) where fromString = Just . fromString
this way we could just write "remove-cc"
instead without Just
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.
<*> 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 comment
The 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 comment
The 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.
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.
LGTM, but get an approval from @CarlosLopezDeLara and @Jimbo4350 or @newhoggy too
46fb3fa
to
783fb14
Compare
I can confirm that this resolved the parsing issue. |
Interestingly enough, it does not complain about this:
|
Weird 😵💫 |
Changelog
Context
Contributes to fixing #300
How to trust this PR
This PR is mostly boilerplate, but there is one thing to make sure of:
When a
prefix
argument is introduced in a parser, it is used in all branches of the parser. For example in this snippet:It is important to pass
prefix
to every branch of theasum
. Otherwise we could create inconsistent parsers. I have made sure this was correct.Checklist
See Running tests for more details
.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7