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

fix: correct address regex in AddressInput #421

Merged
merged 3 commits into from
Jan 19, 2025

Conversation

kfastov
Copy link
Contributor

@kfastov kfastov commented Jan 19, 2025

Fix address check in AddressInput

Fixes #420

Types of change

  • Feature
  • Bug
  • Enhancement

Comments (optional)

Changes made:

  1. Updated the regex to /^0x[a-f0-9]{1,64}$/ which:
    • Matches 0x prefix
    • Followed by 1-64 hex characters (a-f, 0-9)
    • No need for capture groups or additional checks
  2. Removed the redundant length check since it's handled by the regex
  3. Removed the redundant double-0x check since the regex ensures only one 0x at the start
  4. Fixed formatting issues in deploy-wrapper.ts

The validation is now more appropriate for Starknet addresses while being simpler and more maintainable.

Copy link
Collaborator

@Nadai2010 Nadai2010 left a comment

Choose a reason for hiding this comment

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

Hi thanks for the input @kfastov, for the action flow to be correct ‘in green’ and formatted properly, you should check the yarn format:check and yarn format.

The rest is fine by me, @metalboyrick check it here please

@kfastov
Copy link
Contributor Author

kfastov commented Jan 19, 2025

@Nadai2010 The formatting issue is in the mainstream, but no problem, I'll fix it

@Nadai2010
Copy link
Collaborator

Ah I just uploaded that correct format from before, it looks like you just took that version, I'll close my PR and leave it in this one thanks

@0xquantum3labs
Copy link
Collaborator

thanks for your contribution @kfastov 🤝

@0xquantum3labs 0xquantum3labs merged commit ffdb0b3 into Scaffold-Stark:main Jan 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Starknet addresses can't be pasted into faucet input
3 participants