-
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
Changes from 9 commits
f00b3f9
6ec0fe9
a676a85
ceef5ce
d916a20
43231b8
9008d7b
55aa7ad
4b0037f
ccace85
6eaffe0
8e99f25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The docs would need to be updated to include |
||
|
||
void setQuoteId(String quoteId); | ||
|
||
String getSourceAsset(); | ||
|
||
void setSourceAsset(String sourceAsset); | ||
|
||
String getDestinationAsset(); | ||
|
||
void setDestinationAsset(String sourceAsset); | ||
|
||
enum Kind { | ||
DEPOSIT("deposit"), | ||
WITHDRAWAL("withdrawal"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,24 @@ package org.stellar.anchor.sep24 | |
|
||
import org.stellar.anchor.TestConstants | ||
|
||
fun createTestTransactionRequest(): MutableMap<String, String> { | ||
return mutableMapOf( | ||
"lang" to "en", | ||
"asset_code" to TestConstants.TEST_ASSET, | ||
"asset_issuer" to TestConstants.TEST_ASSET_ISSUER_ACCOUNT_ID, | ||
"account" to TestConstants.TEST_ACCOUNT, | ||
"amount" to "123.4", | ||
"email_address" to "[email protected]", | ||
"first_name" to "Jamie", | ||
"last_name" to "Li" | ||
) | ||
fun createTestTransactionRequest( | ||
quoteID: String? = null, | ||
): MutableMap<String, String> { | ||
val request = | ||
mutableMapOf( | ||
"lang" to "en", | ||
"asset_code" to TestConstants.TEST_ASSET, | ||
"asset_issuer" to TestConstants.TEST_ASSET_ISSUER_ACCOUNT_ID, | ||
"account" to TestConstants.TEST_ACCOUNT, | ||
"amount" to "542", | ||
"email_address" to "[email protected]", | ||
"first_name" to "Jamie", | ||
"last_name" to "Li", | ||
) | ||
if (quoteID != null) { | ||
request["quote_id"] = quoteID | ||
} | ||
return request | ||
} | ||
|
||
fun createTestTransaction(kind: String): Sep24Transaction { | ||
|
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