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(resolver): wrong blockchain error #3037

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

banklesss
Copy link
Contributor

@banklesss banklesss commented Jan 24, 2024

Related to YOMO-1122

@github-actions github-actions bot added the fix label Jan 24, 2024
Signed-off-by: banklesss <105349292+banklesss@users.noreply.github.com>
@banklesss banklesss requested a review from stackchain January 24, 2024 16:03

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()
Copy link
Contributor Author

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
Copy link
Contributor Author

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()),
})

Copy link
Member

@stackchain stackchain left a comment

Choose a reason for hiding this comment

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

lgtm

@stackchain stackchain merged commit 910b52b into develop Jan 24, 2024
2 checks passed
@stackchain stackchain deleted the fix/resolver-wrong-blockchain branch January 24, 2024 16:10
@stackchain stackchain added this to the 4.25.0 milestone Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants