-
Notifications
You must be signed in to change notification settings - Fork 3
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
Normalize labelhash for ENSRainbow Heal request #347
base: main
Are you sure you want to change the base?
Normalize labelhash for ENSRainbow Heal request #347
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
).rejects.toThrow("Invalid labelhash length 65 characters (expected 66)"); | ||
labelByHash("0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0"), | ||
).rejects.toThrow( | ||
'Error healing labelhash: "0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0". Error (400): Invalid labelhash length: expected 32 bytes (64 hex chars), got 31 bytes: 0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0.', |
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.
should we make these errors non redundant?
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 I don't understand the question. Please share more details.
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.
E.g. labelhash is written twice in this error. I think it should be just:
Error (400): Invalid labelhash length: expected 32 bytes (64 hex chars), got 31 bytes: 0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0.
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.
@djstrong Thanks for updates 👍 Reviewed and shared feedback
|
||
export namespace EnsRainbow { | ||
export type ApiClientOptions = EnsRainbowApiClientOptions; | ||
|
||
export interface ApiClient { | ||
count(): Promise<CountResponse>; | ||
|
||
heal(labelhash: Labelhash): Promise<HealResponse>; | ||
heal(labelhash: Labelhash | string): Promise<HealResponse>; |
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 define a type for EncodedLabelhash
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 have created it for parseEncodedLabelhash
but string
needs to stay here because we accept unnormalized labelhashes.
).rejects.toThrow("Invalid labelhash length 65 characters (expected 66)"); | ||
labelByHash("0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0"), | ||
).rejects.toThrow( | ||
'Error healing labelhash: "0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0". Error (400): Invalid labelhash length: expected 32 bytes (64 hex chars), got 31 bytes: 0x0ca5d0b4ef1129e04bfe7d35ac9def2f4f91daeb202cbe6e613f1dd17b2da0.', |
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 I don't understand the question. Please share more details.
|
||
export namespace EnsRainbow { | ||
export type ApiClientOptions = EnsRainbowApiClientOptions; | ||
|
||
export interface ApiClient { | ||
count(): Promise<CountResponse>; | ||
|
||
heal(labelhash: Labelhash): Promise<HealResponse>; | ||
heal(labelhash: Labelhash | EncodedLabelhash | string): Promise<HealResponse>; |
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.
Or this should be just labelhash: string
?
#211