-
Notifications
You must be signed in to change notification settings - Fork 87
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
Additional tests for counterparty conn & chan ids at initialization #360
Conversation
* Investigate initialization with empty string for counterparty ids * Add some unit tests for counterparty conn & chan ids * Rename methods that creates identifiers
Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Codecov ReportBase: 57.68% // Head: 57.71% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #360 +/- ##
==========================================
+ Coverage 57.68% 57.71% +0.03%
==========================================
Files 124 124
Lines 15333 15357 +24
==========================================
+ Hits 8845 8864 +19
- Misses 6488 6493 +5
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. |
crates/ibc/src/core/context.rs
Outdated
@@ -255,7 +255,7 @@ mod val_exec_ctx { | |||
|
|||
/// Returns a natural number, counting how many clients have been created thus far. | |||
/// The value of this counter should increase only via method `ClientKeeper::increase_client_counter`. | |||
fn client_counter(&self) -> Result<u64, ContextError>; | |||
fn generate_client_identifier(&self) -> Result<u64, ContextError>; |
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.
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.
Didn't notice that issue.
Sure. Will do so
Note that I simplified the expression that confused me previously. Let me know if you also find that cleaner. |
Now it is easier to catch 👍 |
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.
🙏 thank you for all these tests!
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.
🎉
…360) * Additional tests for counterparty conn & chan ids at initialization * Investigate initialization with empty string for counterparty ids * Add some unit tests for counterparty conn & chan ids * Rename methods that creates identifiers * Fix cargo check & add changelog entry * Revert *counter naming changes * Fix a comment in MockIbcStore * Change unclog section to improvements * Fix some comments from reverting *_counters names * Simplify conn counterparty parsing * simplify channel counterparty parsing * Fix comment issues Signed-off-by: Farhad Shabani <Farhad.Shabani@gmail.com> Co-authored-by: Philippe Laferriere <plafer@protonmail.com>
Closes: #175
Summary
Ensure that disallows empty strings for counterparty connection and channel ids work correctly at the initialization phases (
conn_open_init
andchan_open_init
)Description
Firstly, It looks like the ICS24_host statement around identifiers implicitly refers to successfully made (open) connections. However, it’s true... it does not consider the transient state of the *ends during the opening process.
Btw, I also tested the opening of a connection using
basecoin-rs
andHermes
and it worked properly.The counterparty connection id was set to None for the sent
MsgConnectionOpenInit
.In this PR, a few comments and tests have been added to check the corner scenarios.
Also, while skimming the codes, I changed the naming of the
client_counter
,connection_counter
, andchannel_counter
methods to correspond with the exact work they do. Counting is their side job, but they're basically used for identifier creation all over the repository. This way it would also align with IBC-go. Though… take it as a suggestion.PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.