-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Prompt error if vanity pattern is not valid base58 #5308
Conversation
It looks like @lwshang signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
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.
LGTM
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.
Can you please add a test.
Sure, I will. In PolkadotJS, user can choose whether they want "case sensitive" or not. Do I need to check how will that be influenced by this PR? |
If a capital |
Capital From my understanding, |
@jacogr can you shed some light on case sensitive here? |
All the UI does is to lowercase the whole thing when doing a match, if so requested. No magic there. |
Just read your code, the |
* Prompt error if vanity pattern is not valid base58 * Update bin/utils/subkey/src/vanity.rs * Add tests for validating pattern of subkey vanity Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Prompt error if vanity pattern is not valid base58 * Update bin/utils/subkey/src/vanity.rs * Add tests for validating pattern of subkey vanity Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
The
vanity
subcommand ofsubkey
will search for an address with a pattern. Since the address are subject to base58 encoding, the characters in the pattern should also narrow to base58. Otherwise the search will never end which is the current behaviour.This PR fix the problem by prompting an error when user provide an invalid pattern.