-
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
Add anchor data hash checks to remaining governance action commands #915
Conversation
0d4e93d
to
9aae3ce
Compare
Co-authored-by: Mateusz Galazyn <228866+carbolymer@users.noreply.github.com>
9aae3ce
to
93027e4
Compare
@@ -3569,6 +3569,65 @@ pAnchorDataHash = | |||
, Opt.help "Proposal anchor data hash (obtain it with \"cardano-cli hash anchor-data ...\")" | |||
] | |||
|
|||
data HashCheckParamInfo anchorData |
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.
This type has incredibly poor type safety.
] | ||
] | ||
|
||
proposalHashCheckInfo :: HashCheckParamInfo ProposalUrl |
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.
Please turn these into stand alone parsers. You can create a function that creates a parser which is the usual style we have.
@@ -70,8 +70,11 @@ instance Error GovernanceActionsError where | |||
<+> "hash:" | |||
<+> pretty (displayException fetchErr) | |||
|
|||
data AnchorDataTypeCheck = ProposalCheck | |||
data AnchorDataTypeCheck |
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.
This needs to be commented.
Changelog
Context
This is another step forward on addressing #882.
Previous related PR: #910
This only adds checks to commands inside
governance action
. There are several other places where to add the check, but better to go step by step.How to trust this PR
I have adapted test for all commands but one, to validate the new functionality, and that gives me a lot of confidence. I would try to check that the code style is good, I didn't introduce any bugs, the parameter structure and names make sense, and the help is comprehensive and comprehensible.
Checklist