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

AND-9337, AND-9340, AND-9341, AND-9348, AND-9349, AND-9350, AND-9364: Fix KRC-20 issues #855

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

nzeeei
Copy link
Contributor

@nzeeei nzeeei commented Dec 9, 2024

No description provided.

@nzeeei nzeeei requested review from dbaturin and a team as code owners December 9, 2024 02:27
@nzeeei nzeeei force-pushed the fix/krc-20-issues branch from 7fc12bf to 4b8dcad Compare December 9, 2024 02:55
@nzeeei nzeeei changed the base branch from develop to release-app_5.19 December 9, 2024 02:55

if (change < BigDecimal.ZERO) { // unspentsToSpend not enough to cover transaction amount
Copy link
Collaborator

Choose a reason for hiding this comment

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

а куда уехала эта логика с max 84 utxo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Проверка на utxo есть в checkUtxoAmountLimit(), логику этого метода обновил

@nzeeei nzeeei force-pushed the fix/krc-20-issues branch 2 times, most recently from a172aee to a15cfaf Compare December 9, 2024 18:50
@@ -10,7 +10,7 @@ interface UtxoAmountLimitProvider {
/**
* Checks if [amount] and [fee] is not greater than utxo limit. Returns limit otherwise.
*/
fun checkUtxoAmountLimit(amount: BigDecimal, fee: BigDecimal): UtxoAmountLimit?
fun checkUtxoAmountLimit(amount: BigDecimal, fee: BigDecimal, currencyType: CryptoCurrencyType): UtxoAmountLimit?
Copy link
Contributor

Choose a reason for hiding this comment

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

Эта функция для KRC20 токенов не имеет смысла.

CryptoCurrencyType - это вообще какая-то фигня, есть же AmountType, если нужно отдельный кейс только для токенов и коинов, то надо бы вложенный сделать, но никак не отдельный. Надо убрать это в принципе.

А есть какая-то причина для этого интерфейса вообще? Чем нас validateTransaction не устраивает?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ревертнул, в приложении сделаю так, чтобы для токенов проверки не было

Comment on lines 506 to 509
is Result.Success -> {
transactionBuilder.unspentOutputs = balanceResponse.data.unspentOutputs
}
is Result.Failure -> Unit
Copy link
Contributor

Choose a reason for hiding this comment

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

successOr лаконичнее будет

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Заменил на map

@kozarezvlad kozarezvlad merged commit 5068da7 into release-app_5.19 Dec 10, 2024
3 checks passed
@kozarezvlad kozarezvlad deleted the fix/krc-20-issues branch December 10, 2024 17:13
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