-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve set of IdentifierError variants
Firstly, add IdentifierError::InvalidNumericSuffix error indicating identifiers which should be in ‘prefix-number’ having invalid numeric suffix because a) it’s missing, b) is not a number or c) has leading zero. With that, update parse_chain_id_string to return that error when the revision number is invalid. Secondly, remove IdentifierError::Empty and ContainSeparator variants as they are redundant. The former is a special case of InvalidLength; the latter is a special case of InvalidCharacter. With that, remove length checking from validate_identifier_chars (which didn’t belong there anyway) and fix chain name checking in ChainId::from_str. Remove IdentifierError::Empty
- Loading branch information
Showing
2 changed files
with
33 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters