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

ETH-946 - save send fee payer #2194

Merged
merged 7 commits into from
Feb 14, 2024

Conversation

eduardmaximovich
Copy link
Collaborator

Jira Ticket

https://linear.app/etherean/issue/ETH-946/[android]-[keyapp]-zapominat-vybrannyj-token-kompensacii-dlya-send

Description of Work

  • fixed fee payer token auto selection
  • clarified some points

- fixed fee payer token auto selection
- clarified some points
Copy link

github-actions bot commented Feb 13, 2024

Code coverage report

File Coverage [0.00%] Min. Covered
FeeRelayerFee.kt 0.00% 💩
SendFeeRelayerManager.kt 0.00% 💩
FeePayersRepository.kt 0.00% 💩
SendInteractor.kt 0.00% 💩
GetFeesInPayingTokenUseCase.kt 0.00% 💩
SendSolanaFee.kt 0.00% 💩
FeePayerTokenValidityRepository.kt 0.00% 💩
SendStorage.kt 0.00% 💩
NewSendPresenter.kt 0.00% 💩
AmountExtensions.kt 0.00% 💩
TokenServiceAmountsRemoteConverter.kt 0.00% 💩
Total Project Coverage 4.67% 💩

Comment on lines +198 to +204
feePayerTokenCanCoverExpenses -> {
if (feePayerToken.isSOL) {
SwitchToSol
} else {
SwitchToSpl(feePayerToken)
}
}
Copy link
Collaborator Author

@eduardmaximovich eduardmaximovich Feb 13, 2024

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..

feesInSourceToken: FeeAmount,
expectedFee: FeeAmount
) : this(
transactionFeeInSol = feesInSol.transactionFee,
Copy link
Contributor

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

Copy link
Collaborator Author

@eduardmaximovich eduardmaximovich Feb 14, 2024

Choose a reason for hiding this comment

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

} else {
feeRelayerFee.accountCreationFeeInFeePayerToken
}
return amount.fromLamports(feePayerToken.decimals).scaleLong()
Copy link
Contributor

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()
Copy link
Contributor

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? {
Copy link
Contributor

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

Copy link
Collaborator Author

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@eduardmaximovich eduardmaximovich merged commit 9a492af into develop Feb 14, 2024
3 of 4 checks passed
@eduardmaximovich eduardmaximovich deleted the feature/ETH-946-send-save-fee-payer branch February 14, 2024 13:15
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