Skip to content
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

Refactor identifier length validation in ics24 implementation #961

Closed
Tracked by #882
mina86 opened this issue Nov 13, 2023 · 0 comments · Fixed by #960
Closed
Tracked by #882

Refactor identifier length validation in ics24 implementation #961

mina86 opened this issue Nov 13, 2023 · 0 comments · Fixed by #960
Milestone

Comments

@mina86
Copy link
Contributor

mina86 commented Nov 13, 2023

Firstly, remove asserts from the validate_identifier_length and
validate_prefix_length functions. Instead, let the regular checks
handle cases where min and max constraints don’t allow for a valid
prefix to exist.

Secondly, ensure minimum length constraints are at least one. This
makes sure that the validation functions will check for empty
identifiers and prefixes. This makes empty identifier check in
validate_channel_identifier as well as IdentifierError::Empty variant
unnecessary. We can get rid of those.

Lastly, collapse all checks in validate_prefix_length into a single
call to validate_identifier_length with correctly adjusted min and max
constraints.

@rnbguy rnbguy changed the title Simplify identifier length validation; drop IdentityError::EmptyError Simplify identifier length validation in ics24 implementation Nov 13, 2023
@rnbguy rnbguy changed the title Simplify identifier length validation in ics24 implementation Refactor and simplify identifier length validation in ics24 implementation Nov 13, 2023
@rnbguy rnbguy changed the title Refactor and simplify identifier length validation in ics24 implementation Refactor identifier length validation in ics24 implementation Nov 13, 2023
@Farhad-Shabani Farhad-Shabani added this to the v0.48.0 milestone Nov 24, 2023
@github-project-automation github-project-automation bot moved this to 📥 To Do in ibc-rs Nov 24, 2023
@Farhad-Shabani Farhad-Shabani moved this from 📥 To Do to ✅ Done in ibc-rs Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants