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-752] Remove amount_out requirement in RequestOnchainFunds #1451

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

philipliu
Copy link
Contributor

@philipliu philipliu commented Aug 7, 2024

Description

amount_out is not set if a transaction has an associated indicative quote but has not yet received funds.

Context

N/A

Testing

  • ./gradlew test

Documentation

N/A

Known limitations

N/A

@philipliu philipliu marked this pull request as ready for review August 8, 2024 15:43
Comment on lines 143 to 145
if (request.getAmountOut() == null && txn.getAmountOut() == null) {
throw new InvalidParamsException("amount_out is required");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we require amount_out when a quote was used or when amount_in_asset == amount_out_asset?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. I think we should require amount_out if there was no quote as well

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we can require amount_out if there was no quote, since the business doesn't have to commit to a payout amount until its about to send funds. The exception is if amount_out_asset = amount_in_asset, since its always 1:1 minus fees.

Copy link
Contributor

@Ifropc Ifropc Aug 8, 2024

Choose a reason for hiding this comment

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

Sorry we should require either amount_out to be present either in request or in transaction

Copy link
Contributor

@Ifropc Ifropc left a comment

Choose a reason for hiding this comment

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

LGTM thanks @philipliu !

@philipliu philipliu merged commit 01c767e into stellar:develop Aug 12, 2024
8 checks passed
@philipliu philipliu deleted the fix/anchor-752-remove-amount-out branch August 12, 2024 21:06
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