-
Notifications
You must be signed in to change notification settings - Fork 329
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
Fix panics in packet queries #554
Conversation
When a free option (such as a chain_id or port_id) in a command is tagged with the 'required' attribute, this will safeguard against invoking the command with `default()` values for the corresponding option.
Codecov Report
@@ Coverage Diff @@
## master #554 +/- ##
=========================================
+ Coverage 13.6% 46.8% +33.2%
=========================================
Files 69 137 +68
Lines 3752 9066 +5314
Branches 1374 0 -1374
=========================================
+ Hits 513 4251 +3738
- Misses 2618 4815 +2197
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
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.
Looks good! I have a few minor comments on the error strings and ouput, trying to give just the right amount of information, no more/less than needed. Doesn't apply to this PR specifically, but in general I still find the output of our commands hard to read, sometimes it has information that is not helpful, other times not enough and I have a significant contribution here. We should sit down and discuss this for V1.
.ok_or_else(|| "missing destination chain configuration".to_string())?; | ||
.ok_or_else(|| { | ||
format!( | ||
"missing configuration for the given chain ({}) ", |
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.
"missing configuration for the given chain ({}) ", | |
"missing configuration for chain ({}) ", |
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.
In parallel with your comments here, I had similar thoughts with respect to these error messages and fixed (hopefully all of them).
The approach I used is
See #559
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.
Also, for this file specifically relayer-cli/src/commands/query/packet.rs
, I agree with your suggestions and applied them bac733d.
Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
* Fix for informalsystems#521. Will fix the unwraps for QueryUnreceivedAcknowledgementCmd also * Added the 'required' annotation to packet queries. When a free option (such as a chain_id or port_id) in a command is tagged with the 'required' attribute, this will safeguard against invoking the command with `default()` values for the corresponding option. * Updated the changelog * Apply suggestions from code review Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> * FMT fix Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Closes: #521
Description
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.