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

[aragon][Lido] validate when setting withdrawal credentials #160

Merged
merged 4 commits into from
Nov 23, 2020
Merged

Conversation

mymphe
Copy link
Contributor

@mymphe mymphe commented Nov 20, 2020

Performs validation before submitting new withdrawal credentials to vote. Also, added a better-looking badge for withdrawal credentials, which copies them to clipboard on click.

WC input field:

  • is required (empty string is not valid)
  • must be a 64-digit hexadecimal number (must satisfy this regex: /^[a-fA-F0-9]{64}$/) not counting the '0x' prefix.

Before submitting, the '0x' prefix is added to the beginning of the number, if none is present.

WC Badge
image

WC Badge (copied to clipboard)
image

Validation Demo
image

@mymphe mymphe linked an issue Nov 20, 2020 that may be closed by this pull request
@mymphe mymphe requested a review from skozin November 20, 2020 12:37
@mymphe mymphe linked an issue Nov 20, 2020 that may be closed by this pull request
.required()
.test(
'credentials',
'Credentials must be a 64-character hexadecimal number',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's better say "Credentials must be a 32-byte hexadecimal number"

@skozin skozin merged commit eb6e00c into master Nov 23, 2020
@skozin skozin deleted the issue#149 branch November 23, 2020 00:48
dechjo pushed a commit to dechjo/lido-dao that referenced this pull request Jan 26, 2021
[aragon][Lido] validate when setting withdrawal credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants