-
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
fix: support chain identifiers without {chain_name}-{revision_number}
pattern
#941
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #941 +/- ##
==========================================
+ Coverage 67.65% 67.84% +0.18%
==========================================
Files 130 130
Lines 16415 16431 +16
==========================================
+ Hits 11106 11147 +41
+ Misses 5309 5284 -25
☔ View full report in Codecov by Sentry. |
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.
Thanks @rnbguy for taking care of this 🙏🏻
Since the ChainId's data structure has changed here and other changes are related, let's go over that first:
ChainId
ChainId
s without revision numbers
.changelog/unreleased/bug-fixes/940-optional-revision-number-in-chain-id.md
Outdated
Show resolved
Hide resolved
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #941 +/- ##
==========================================
+ Coverage 67.65% 67.89% +0.23%
==========================================
Files 130 130
Lines 16415 16449 +34
==========================================
+ Hits 11106 11168 +62
+ Misses 5309 5281 -28
☔ View full report in Codecov by Sentry. |
fcf02fd
to
a19ac45
Compare
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.
Thanks @rnbguy for digging into this issue! Great job!
Just a few nits, then we are good to go!
.changelog/unreleased/bug-fixes/940-optional-revision-number-in-chain-id.md
Outdated
Show resolved
Hide resolved
ChainId
s without revision numbers {chain_name}-{revision_number}
pattern
Co-authored-by: Farhad Shabani <Farhad.Shabani@gmail.com> Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com>
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.
🎉
…}` pattern (#941) * optional revision number for chain id * add additional methods * update tests * add changelog entry * new test for codecov * revert optional u64 * rename method * update tests * visualize actual testcases * revert method rename * update changelog entry * refactor ChainId::new * rm ChainId::has_revision_number method * refactor ChainId::set_revision_number to ChainId::increment_revision_number * rm old set unset revision_number test * add tests for ChainId::increment_revision_number * add length validation tests * refactor source code for ChainId::new * fix doc test * fix chain identifier length validation * update tests * fix typo * reword changelog entry * reword doc string * fix ChainId::validate_length * add ChainId::validate_length in tests * replace ID with identifier * use validate_prefix_length over validate_identifier_length * optimize validate_prefix_length * rename changelog entry * fix incorrect doc comment Co-authored-by: Farhad Shabani <Farhad.Shabani@gmail.com> Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com> * use u64::checked_add * update doc comment * update doc tests * simplify validate_prefix_length * tests for validate_prefix_length * fix tests * add changelog entry * import test_log::test * fix rstest test attribute * cargo fmt * fix typo Co-authored-by: Farhad Shabani <Farhad.Shabani@gmail.com> Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com> --------- Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com> Co-authored-by: Farhad Shabani <Farhad.Shabani@gmail.com>
Closes: #940
Closes: #943
Description
ibc-go allows a hardcoded revision number for a chain-id without revision number.
Currently,
ibc-rs
requires all chain-ids to have a revision number. This PR allowsChainId
struct to accept chain ID strings without revision numbers.This PR also adds an optimized implementation for
validate_length_prefix
.PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.