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(sdk-coin-ada): add multi-asset to init builder flow #4033

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

Vijay-Jagannathan
Copy link
Contributor

@Vijay-Jagannathan Vijay-Jagannathan commented Nov 1, 2023

Ticket: WIN-736

Context

We recently added the following PRs for ADA token consolidation support:

While testing the ADA token consolidation flow, we found that in the parseTransaction method that's used in WP, we don't have the asset data in the tx. This is due to the fact that, asset data is not added in outputs of the initBuilder method. And when we build the transaction, we weren't adding the assets to the transaction outputs

This PR ensures that the tx data contains outputs, along with the asset data in them, especially in the parseTransaction flow

asset.insert(assetName, quantity!);
multiAsset.insert(policyId, asset);
txOutputAmountBuilder = txOutputAmountBuilder.with_coin_and_asset(outputAmount, multiAsset);
const txOutput = txOutputAmountBuilder.build();
Copy link
Contributor

Choose a reason for hiding this comment

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

Small question, why are we just initializing the txOutputAmountBuilder here? is it not used in any other part of code?

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise looks fine to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do use it another place (when we go through the consolidation builder - #3994), but that flow is not related to the parseTransaction flow that this PR deals with

@Vijay-Jagannathan Vijay-Jagannathan marked this pull request as ready for review November 1, 2023 18:02
@Vijay-Jagannathan Vijay-Jagannathan requested a review from a team as a code owner November 1, 2023 18:02
@Vijay-Jagannathan Vijay-Jagannathan merged commit 4b04279 into master Nov 1, 2023
5 checks passed
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.

3 participants