-
Notifications
You must be signed in to change notification settings - Fork 50
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(resolver): wrong blockchain error #3037
Conversation
Signed-off-by: banklesss <105349292+banklesss@users.noreply.github.com>
|
||
if (hasCardanoAddress) | ||
return response.value.data.records['crypto.ADA.address'] | ||
|
||
if (hasOtherBlockchainAddress) | ||
throw new Resolver.Errors.WrongBlockchain() | ||
|
||
if (hasNotAnyAddress) throw new Resolver.Errors.NotFound() | ||
|
||
throw new Resolver.Errors.InvalidResponse() |
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.
keeping this to cover the case when a wrong result is resolved
i.e.
{ '...ADA...': undefined }
Object.keys(response.value.data.records).length > 0 | ||
const hasNotAnyAddress = | ||
!hasOtherBlockchainAddress && safeParsedGeneralResponse.success | ||
const hasOtherBlockchainAddress = safeParsedGeneralResponse.success |
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.
const UnstoppableApiGeneralResponseSchema = z.object({
records: z.record(z.string(), z.string()),
})
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.
lgtm
Related to YOMO-1122