Skip to content

Commit

Permalink
Merge pull request #1666 from novasamatech/fix/negative-amount-in-fai…
Browse files Browse the repository at this point in the history
…lure

Fixed negative amount in failure
  • Loading branch information
antonijzelinskij authored Sep 19, 2024
2 parents fccb326 + 3970dea commit 88ac696
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.novafoundation.nova.feature_wallet_api.domain.validation
import androidx.annotation.StringRes
import io.novafoundation.nova.common.base.TitleAndMessage
import io.novafoundation.nova.common.resources.ResourceManager
import io.novafoundation.nova.common.utils.atLeastZero
import io.novafoundation.nova.common.validation.Validation
import io.novafoundation.nova.common.validation.ValidationStatus
import io.novafoundation.nova.common.validation.ValidationSystemBuilder
Expand Down Expand Up @@ -32,7 +33,7 @@ class HasEnoughFreeBalanceValidation<P, E>(
val freeBalanceAfterFees = asset(value).free - fee(value).networkFeeByRequestedAccountOrZero

return (freeBalanceAfterFees >= requestedAmount(value)) isTrueOrError {
error(asset(value).token.configuration, freeBalanceAfterFees)
error(asset(value).token.configuration, freeBalanceAfterFees.atLeastZero())
}
}
}
Expand Down

0 comments on commit 88ac696

Please sign in to comment.