-
Notifications
You must be signed in to change notification settings - Fork 130
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
Update Bug_0xblank #398
Update Bug_0xblank #398
Conversation
const isValidHexAddress = (value: string): boolean => { | ||
const hexAddressRegex = /^0x[0-9a-fA-F]+$/; | ||
return hexAddressRegex.test(value); | ||
}; | ||
|
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.
lets put it in the utils file (i think we have this util already). we don't want duplicates of the same function since they would be a pain to maintain
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.
I was given another recommendation that 0x be accepted as felt252 and that I should add a 0 to 0x to be accepted
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.
yep, aligned on that end
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.
please make sure 0x0x0
does not work
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.
Ok I'll check that it aligns with that
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.
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.
Hi @KevinMB0220 this is still malfunctioning, can check please? It doesn't do this for me.
Ok i check |
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.
seems like this is not the spot to fix. might want to take a look at the InputBase
and Input
component to solve this issue.
@KevinMB0220 what we want to do is to check for the input, not the address display |
Can I change something in the faucet since the input address is declared there, so the validation is more direct and functional there? |
a5a4ca3
to
fe3b7bf
Compare
yep sure! |
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.
sorry for the long winded review but we need to get this right. Asides from the AddressInput
component you would also need to validate the one on the Debug Page (which doesn't use this component)
packages/nextjs/components/scaffold-stark/Input/AddressInput.tsx
Outdated
Show resolved
Hide resolved
i think you can fix the |
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.
looks good to me!
Address Input Validation Fix
Fixes #345
Types of change
Comments (optional)
Fixed a bug where the AddressInput allowed invalid inputs such as
0x
.Now the input is validated to ensure it meets the correct format:
0x
.If validation fails, an error message is displayed: "Invalid address format".