Skip to content

Commit

Permalink
Merge pull request #1415 from novasamatech/rc/7.9.4
Browse files Browse the repository at this point in the history
Rc/7.9.4
  • Loading branch information
valentunn committed Mar 1, 2024
2 parents 5c98c0f + b1be9ff commit 0325b52
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
// App version
versionName = '7.9.3'
versionCode = 121
versionName = '7.9.4'
versionCode = 122

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@
<string name="wallet_search_empty_title">Убедитесь, что адрес\nиз правильной сети</string>
<string name="wallet_search_empty_title_v2_2_0">Неверный формат адреса.\nУбедитесь, что адрес \nсоответствует сети</string>
<string name="wallet_send_balance_minimal">Минимальный баланс</string>
<string name="wallet_send_cannot_dust_before_delivery_fee_message">Ваш доступный баланс %s, вам необходимо оставить минимум %s для доставки перевода и заплатить комиссию сети %s. Вы можете перевести не более %s</string>
<string name="wallet_send_cannot_dust_before_delivery_fee_message">Из-за межсетевых ограничений вы можете перевести не более %s</string>
<string name="wallet_send_cannot_pay_cross_chain_fee" formatted="false">У вас недостаточно токенов для оплаты межсетевой комиссии в размере %s.\nОстаток баланса после перевода: %s</string>
<string name="wallet_send_confirm_hint">Межсетевая комиссия добавляется к введенной сумме. Получатель может получить часть межсетевой комиссии</string>
<string name="wallet_send_confirm_transfer">Подтвердить</string>
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyEllipsis">
<string name="wallet_send_cannot_dust_before_delivery_fee_message">Your available balance is %s, you need to leave at least %s for transfer delivery and pay network fee of %s. You can transfer not more than %s</string>
<string name="wallet_send_cannot_dust_before_delivery_fee_message">Due to the cross-chain restrictions you can transfer not more than %s</string>

<string name="common_too_small_balance_title">Your balance is too small</string>
<string name="wallet_send_insufficient_balance_commission">You need to have at least %s to pay this transaction fee and stay above the minimum network balance. Your current balance is: %s. You need to add %s to your balance to perform this operation.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ fun CoroutineScope.mapAssetTransferValidationFailureToUI(
resourceManager.getString(R.string.common_not_enough_funds_title) to
resourceManager.getString(
R.string.wallet_send_cannot_dust_before_delivery_fee_message,
reason.balanceCountedTowardsEd.formatPlanks(reason.chainAsset),
reason.existentialDeposit.formatPlanks(reason.chainAsset),
reason.networkFee.formatPlanks(reason.chainAsset),
reason.maxPossibleTransferAmount.formatPlanks(reason.chainAsset)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ sealed class AssetTransferValidationFailure {
) : NotEnoughFunds()

class ToStayAboveEdBeforePayingDeliveryFees(
val balanceCountedTowardsEd: Balance,
val existentialDeposit: Balance,
val networkFee: Balance,
val maxPossibleTransferAmount: Balance,
val chainAsset: Chain.Asset,
) : NotEnoughFunds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class HydraDxRouterSwapExtractor(

override fun ExtrinsicVisit.extractSwapArgs(): SwapArgs {
val swapExecutedEvent = events.findEvent(Modules.ROUTER, "RouteExecuted")
?: events.findEvent(Modules.ROUTER, "Executed")

return when {
// successful swap, extract from event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class CannotDropBelowEdBeforePayingDeliveryFeeValidation(
val paysDeliveryFee = deliveryFeePart.isPositive()

val networkFeePlanks = value.originFee.networkFeePart().networkFee.amountByRequestedAccount
val sendingAmount = value.transfer.amountInPlanks + value.crossChainFee?.networkFee?.amountByRequestedAccount.orZero()
val crossChainFeePlanks = value.crossChainFee?.networkFee?.amountByRequestedAccount.orZero()

val sendingAmount = value.transfer.amountInPlanks + crossChainFeePlanks
val requiredAmountBeforePayingDeliveryFee = sendingAmount + networkFeePlanks + existentialDeposit

val balanceCountedTowardsEd = value.originUsedAsset.balanceCountedTowardsEDInPlanks
Expand All @@ -43,13 +45,10 @@ class CannotDropBelowEdBeforePayingDeliveryFeeValidation(
requiredAmountBeforePayingDeliveryFee <= balanceCountedTowardsEd -> valid()

else -> {
val availableBalance = (balanceCountedTowardsEd - networkFeePlanks - existentialDeposit).atLeastZero()
val availableBalance = (balanceCountedTowardsEd - networkFeePlanks - crossChainFeePlanks - existentialDeposit).atLeastZero()

validationError(
ToStayAboveEdBeforePayingDeliveryFees(
balanceCountedTowardsEd = balanceCountedTowardsEd,
existentialDeposit = existentialDeposit,
networkFee = networkFeePlanks,
maxPossibleTransferAmount = availableBalance,
chainAsset = value.transfer.originChainAsset
)
Expand Down

0 comments on commit 0325b52

Please sign in to comment.