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

[ANCHOR-784] Remove 0 amounts from SEP-6 transaction responses #1469

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

philipliu
Copy link
Contributor

Description

This removes the 0 amount_out and 0 amount_fee placeholder values from the SEP-6 exchange transaction responses.

Context

This was set as a placeholder because the request funds RPCs expected these fields always to be set.

Testing

  • ./gradlew test

Documentation

N/A

Known limitations

N/A

expectedResponse.amountExpected = Amount(null, FIAT_USD)
expectedResponse.amountIn = Amount("1", FIAT_USD)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems wrong, we default to the request asset code when the assets are not found in the transaction.

AssetInfo info = service.getAsset(txn.getRequestAssetCode(), txn.getRequestAssetIssuer());

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is possible that the transaction asset had not been written by RPC and we need to respond with the asset id.

Same logic exists at:

AssetInfo info = service.getAsset(txn.getRequestAssetCode(), txn.getRequestAssetIssuer());

@philipliu philipliu changed the title Remove 0 amounts from SEP-6 transaction responses [ANCHOR-784] Remove 0 amounts from SEP-6 transaction responses Aug 25, 2024
@philipliu philipliu marked this pull request as ready for review August 25, 2024 23:08
Copy link
Collaborator

@lijamie98 lijamie98 left a comment

Choose a reason for hiding this comment

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

LGTM

expectedResponse.amountExpected = Amount(null, FIAT_USD)
expectedResponse.amountIn = Amount("1", FIAT_USD)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is possible that the transaction asset had not been written by RPC and we need to respond with the asset id.

Same logic exists at:

AssetInfo info = service.getAsset(txn.getRequestAssetCode(), txn.getRequestAssetIssuer());

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.

2 participants