Skip to content

Conversation

@michael-gallegos-bg
Copy link
Contributor

@michael-gallegos-bg michael-gallegos-bg commented Jul 19, 2022

There is a bug regarding build intent with the enabletoken createAccount intent flow when enabling tokens on Solana.
We need to add the missing tokenName to the token property of the whitelistedParams in prebuildTxWithIntent.

Previously, the bug would output this when trying to use the enabletoken flow on the txrequests endpoint:

(node:65500) UnhandledPromiseRejectionWarning: ApiResponseError: .intent.intentType should be equal to one of the allowed values, .intent should have required property 'token', .intent.intentType should be equal to one of the allowed values, .intent should have required property 'stakingRequestId', .intent should have required property 'stakingRequestId', .intent should have required property 'stakingRequestId', .intent should match some schema in anyOf
    at errFromResponse (/Users/michaelgallegos/git/BitGoJS/modules/sdk-api/dist/src/api.js:62:12)
    at handleResponseError (/Users/michaelgallegos/git/BitGoJS/modules/sdk-api/dist/src/api.js:71:15)
    at /Users/michaelgallegos/git/BitGoJS/modules/sdk-api/dist/src/api.js:30:101
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async EddsaUtils.prebuildTxWithIntent (/Users/michaelgallegos/git/BitGoJS/modules/sdk-core/dist/src/bitgo/utils/tss/eddsa/eddsa.js:275:29)
    at async Wallet.prebuildTransactionTss (/Users/michaelgallegos/git/BitGoJS/modules/sdk-core/dist/src/bitgo/wallet/wallet.js:1973:29)
    at async Wallet.prebuildAndSignTransaction (/Users/michaelgallegos/git/BitGoJS/modules/sdk-core/dist/src/bitgo/wallet/wallet.js:1381:29)
    at async Wallet.sendManyTss (/Users/michaelgallegos/git/BitGoJS/modules/sdk-core/dist/src/bitgo/wallet/wallet.js:2042:36)
    at async enableToken 

This PR alleviates this issue.

Ticket: https://bitgoinc.atlassian.net/browse/BG-52482

@michael-gallegos-bg michael-gallegos-bg marked this pull request as ready for review July 19, 2022 19:18
@michael-gallegos-bg michael-gallegos-bg requested a review from a team July 19, 2022 19:18
Copy link
Contributor

@joey-bai joey-bai left a comment

Choose a reason for hiding this comment

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

good find, thanks!

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.

4 participants