-
Notifications
You must be signed in to change notification settings - Fork 94
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 a docstring and rename the "validate_self_client" argument for better #436
Conversation
Codecov ReportBase: 62.21% // Head: 61.12% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
- Coverage 62.21% 61.12% -1.09%
==========================================
Files 131 131
Lines 17789 18114 +325
==========================================
+ Hits 11068 11073 +5
- Misses 6721 7041 +320
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View 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.
Great initiative
/// Additionally, implementations specific to individual chains can be found | ||
/// in the [hosts](crate::hosts) module. |
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.
👌
crates/ibc/src/hosts/mod.rs
Outdated
@@ -0,0 +1 @@ | |||
pub mod tendermint_helper; |
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.
pub mod tendermint_helper; | |
pub mod tendermint; |
Since we're in a "hosts" module, I would find just tendermint
sufficient.
Perhaps we can add a module docstring explaining that this module contains items (helpers? utils?) that hosts can use.
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.
let counterparty_client_state = TmClientState::try_from(counterparty_client_state) | ||
.map_err(|_| ConnectionError::InvalidClientState { | ||
reason: "client must be a tendermint client".to_string(), | ||
pub trait ValidateSelfTendermintClientContext { |
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.
Since we are in the tendermint_helper
module, I think we should remove Tendermint
from the name.
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.
crates/ibc/src/core/context.rs
Outdated
/// in the [hosts](crate::hosts) module. | ||
fn validate_self_client( | ||
&self, | ||
host_client_state_on_counterparty: Any, |
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.
host_client_state_on_counterparty: Any, | |
client_state_of_host_on_counterparty: Any, |
This is closer to the convention we use in the rest of the codebase
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.
Co-authored-by: Philippe Laferrière <plafer@protonmail.com> Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Thank you so much. Got better now 🙏 |
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.
💯
…tter (#436) * Add docstring and rename the validate_self_client argument * Rename to host_client_state_on_counterparty * Fix mock arg * Rename ValidateSelfClientContext trait * Reword validate_self_client docstring Co-authored-by: Philippe Laferrière <plafer@protonmail.com> Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com> * Apply comments * Rename validate_self_tendermint_client arg --------- Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com> Co-authored-by: Philippe Laferrière <plafer@protonmail.com>
Closes: #434
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.