-
Notifications
You must be signed in to change notification settings - Fork 757
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: add starkid improvements #1301
fix: add starkid improvements #1301
Conversation
3047892
to
cd2bfc4
Compare
__tests__/account.starknetId.test.ts
Outdated
@@ -85,6 +85,12 @@ describe('deploy and test Wallet', () => { | |||
expect(hexToDecimalString(address)).toEqual(hexToDecimalString(account.address)); | |||
}); | |||
|
|||
test('Should throw error when invalid stark domain is provided', async () => { | |||
await expect(account.getAddressFromStarkName('invalid-domain', namingAddress)).rejects.toThrow( |
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.
await expect(account.getAddressFromStarkName('invalid-domain', namingAddress)).rejects.toThrow( | |
await expect(account.getAddressFromStarkName('InvalidDomain', namingAddress)).rejects.toThrow( |
Since the opening ternary from getAddressFromStarkName
appends .stark
to the name input invalid-domain.stark
ends up matching the isStarkDomain
regex and the test fails.
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 my bad, added a forbidden character _
so it works
## [6.21.2](v6.21.1...v6.21.2) (2025-01-29) ### Bug Fixes * add starkid improvements ([#1301](#1301)) ([51702db](51702db))
🎉 This PR is included in version 6.21.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Resolution
Argent ran into a problem using
useDecoded
when decoding the domainGrug.stark
, this should have been passed asgrug.stark
but they didn't have theisStarkDomain
to do so easily.Usage related changes
I'm addding two things to help wallet and devs in general:
isStarkDomain
to permit manual verificationgetAddressFromStarkName
to make the function detect this kind of name errors in the future