-
Notifications
You must be signed in to change notification settings - Fork 34
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-514] Populate sep38quote info into sep24txn #1194
Conversation
platform/src/main/java/org/stellar/anchor/platform/data/JdbcSep24Transaction.java
Show resolved
Hide resolved
Why we aren't performing validation against the quote's attributes the the requests attributes. If I initiate a SEP-24 deposit transaction and specify an |
…-sdk into anchor-514
I think we would also need to update the SEP-38 implementation. Only SEP-6, and SEP-24 are supported currently https://github.com/stellar/java-stellar-anchor-sdk/blob/8e595eab7aa01147d610cb39313afa0c18d75630/api-schema/src/main/java/org/stellar/anchor/api/sep/sep38/Sep38Context.java#L6-L10. |
@@ -236,6 +236,18 @@ public interface Sep24Transaction extends SepTransaction { | |||
|
|||
String getMessage(); | |||
|
|||
String getQuoteId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would also need to add this field to the platform transaction. It's being mapped here https://github.com/stellar/java-stellar-anchor-sdk/blob/8e595eab7aa01147d610cb39313afa0c18d75630/core/src/main/java/org/stellar/anchor/util/TransactionHelper.java#L172-L196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs would need to be updated to include quote_id
under the SEP-24 transaction as well. https://developers.stellar.org/api/anchor-platform/resources/get-transaction
core/src/test/kotlin/org/stellar/anchor/sep24/Sep24ServiceTest.kt
Outdated
Show resolved
Hide resolved
@@ -555,4 +572,74 @@ public InfoResponse getInfo() { | |||
sep24Config.getFeatures().getClaimableBalances())) | |||
.build(); | |||
} | |||
|
|||
private void validatedAndPopulateQuote( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a utility class that does this validation for SEP-6. Do you think we can leverage it here? I think the logic should be the same. https://github.com/stellar/java-stellar-anchor-sdk/blob/8e595eab7aa01147d610cb39313afa0c18d75630/core/src/main/java/org/stellar/anchor/sep6/ExchangeAmountsCalculator.java#L31-L62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Please feel free to merge after the comments are taken care of.
Description
If
quote_id
is provided upon receiving the sep24 request, fetch quote details and populate it into sep24txn objectLeft out the quote validation since it's specified in doc
Context
Add
quote_id
andsource_asset_id
to sep24 txn so that quotes can be displayed to users while initiate deposit/withdraw sep24 transactionTesting
./gradlew test
Documentation
Updated in stellar/stellar-protocol#1358