You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
rnbguy
changed the title
Simplify identifier length validation; drop IdentityError::EmptyError
Simplify identifier length validation in ics24 implementation
Nov 13, 2023
rnbguy
changed the title
Simplify identifier length validation in ics24 implementation
Refactor and simplify identifier length validation in ics24 implementation
Nov 13, 2023
rnbguy
changed the title
Refactor and simplify identifier length validation in ics24 implementation
Refactor identifier length validation in ics24 implementation
Nov 13, 2023
Firstly, remove asserts from the
validate_identifier_length
andvalidate_prefix_length
functions. Instead, let the regular checkshandle 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 asIdentifierError::Empty
variantunnecessary. We can get rid of those.
Lastly, collapse all checks in
validate_prefix_length
into a singlecall to
validate_identifier_length
with correctly adjusted min and maxconstraints.
The text was updated successfully, but these errors were encountered: