Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-01 11:47:36 +03:00
commit 1edf995ab0
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.isTezos
import com.tangem.utils.Provider
import com.tangem.utils.extensions.isZero
import com.tangem.utils.extensions.orZero
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
@ -215,7 +216,7 @@ internal class SwapNotificationsFactory(
actions.onReduceToAmount(amount.copy(value = reduceTo))
},
)
if (!isCardano) {
if (!isCardano && !feeValue.isZero()) {
addDustWarningNotification(
dustValue = quoteModel.currencyCheck?.dustValue,
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.isTezos
import com.tangem.lib.crypto.BlockchainUtils.isTron
import com.tangem.utils.extensions.isZero
import com.tangem.utils.extensions.orZero
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList
@ -112,7 +113,7 @@ internal class SwapTransferNotificationsFactory @Inject constructor() {
onReduceToAmount(amount.copy(value = reduceTo))
},
)
if (!isCardano) {
if (!isCardano && !feeValue.isZero()) {
addDustWarningNotification(
dustValue = state.currencyCheck?.dustValue,
feeValue = feeValue,

View file

@ -113,7 +113,9 @@ internal class SwapTransferNotificationsFactoryTest {
val result = sut.getNotifications(
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,
actions = actions,
)