Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-30 16:21:53 +03:00
parent e27052c85b
commit 8fc73abaf9
3 changed files with 7 additions and 3 deletions

View file

@ -36,6 +36,7 @@ import com.tangem.lib.crypto.BlockchainUtils
import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold
import com.tangem.lib.crypto.BlockchainUtils.isTezos import com.tangem.lib.crypto.BlockchainUtils.isTezos
import com.tangem.utils.Provider import com.tangem.utils.Provider
import com.tangem.utils.extensions.isZero
import com.tangem.utils.extensions.orZero import com.tangem.utils.extensions.orZero
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
@ -215,7 +216,7 @@ internal class SwapNotificationsFactory(
actions.onReduceToAmount(amount.copy(value = reduceTo)) actions.onReduceToAmount(amount.copy(value = reduceTo))
}, },
) )
if (!isCardano) { if (!isCardano && !feeValue.isZero()) {
addDustWarningNotification( addDustWarningNotification(
dustValue = quoteModel.currencyCheck?.dustValue, dustValue = quoteModel.currencyCheck?.dustValue,
feeValue = feeValue, feeValue = feeValue,

View file

@ -24,6 +24,7 @@ import com.tangem.lib.crypto.BlockchainUtils
import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold
import com.tangem.lib.crypto.BlockchainUtils.isTezos import com.tangem.lib.crypto.BlockchainUtils.isTezos
import com.tangem.lib.crypto.BlockchainUtils.isTron import com.tangem.lib.crypto.BlockchainUtils.isTron
import com.tangem.utils.extensions.isZero
import com.tangem.utils.extensions.orZero import com.tangem.utils.extensions.orZero
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList import kotlinx.collections.immutable.toPersistentList
@ -112,7 +113,7 @@ internal class SwapTransferNotificationsFactory @Inject constructor() {
onReduceToAmount(amount.copy(value = reduceTo)) onReduceToAmount(amount.copy(value = reduceTo))
}, },
) )
if (!isCardano) { if (!isCardano && !feeValue.isZero()) {
addDustWarningNotification( addDustWarningNotification(
dustValue = state.currencyCheck?.dustValue, dustValue = state.currencyCheck?.dustValue,
feeValue = feeValue, feeValue = feeValue,

View file

@ -113,7 +113,9 @@ internal class SwapTransferNotificationsFactoryTest {
val result = sut.getNotifications( val result = sut.getNotifications(
transferState = transferState, transferState = transferState,
feeSelectorUM = null, // A loaded (non-zero) fee is required: the manual dust check is now skipped when feeValue is zero
// (fee errored / not yet loaded), so it cannot duplicate the fee-error path's MinimumAmountError.
feeSelectorUM = contentWithFee(feeValue = BigDecimal("0.001")),
feeCryptoCurrencyStatus = null, feeCryptoCurrencyStatus = null,
actions = actions, actions = actions,
) )