-
Notifications
You must be signed in to change notification settings - Fork 18
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
ETH-946 - save send fee payer #2194
ETH-946 - save send fee payer #2194
Conversation
- fixed fee payer token auto selection - clarified some points
Code coverage report
|
feePayerTokenCanCoverExpenses -> { | ||
if (feePayerToken.isSOL) { | ||
SwitchToSol | ||
} else { | ||
SwitchToSpl(feePayerToken) | ||
} | ||
} |
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 don't want to add a new useless state like NoSwitch
, but it can be a better choise..
…ture/ETH-946-send-save-fee-payer
feesInSourceToken: FeeAmount, | ||
expectedFee: FeeAmount | ||
) : this( | ||
transactionFeeInSol = feesInSol.transactionFee, |
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.
god damn that's a lot of fees
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.
yes, adding them fixes this code https://github.com/p2p-org/key-app-android/pull/2194/files#diff-d782fed09c04c9160bdc93c75c19e0f8a4b12ee5934aa7e4daf3a97c933838c4R169
} else { | ||
feeRelayerFee.accountCreationFeeInFeePayerToken | ||
} | ||
return amount.fromLamports(feePayerToken.decimals).scaleLong() |
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.
scaleLong already inside fromLamports
} | ||
|
||
return amount.fromLamports(feePayerToken.decimals) | ||
.scaleLong() |
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.
same
const val KEY_TOKEN_MINT = "TOKEN_MINT" | ||
} | ||
|
||
override fun restoreFeePayerToken(): Base58String? { |
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.
restore is more like domain layer method
storage only set/save get/require
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.
yep, refactored this point a bit
val initialToken = if (selectedToken != null) selectedToken!! else userNonZeroTokens.first() | ||
token = initialToken | ||
|
||
// paths where this fee payer token is settling down: |
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.
❤️
…ture/ETH-946-send-save-fee-payer
…ken, fixed "fromLamports"
…ture/ETH-946-send-save-fee-payer
Jira Ticket
https://linear.app/etherean/issue/ETH-946/[android]-[keyapp]-zapominat-vybrannyj-token-kompensacii-dlya-send
Description of Work