diff --git a/app/build.gradle b/app/build.gradle index 9788ecc0cb..7920e424ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ android { applicationId "com.tangem.wallet" minSdkVersion 21 targetSdkVersion 27 - versionCode 50 + versionCode 51 versionName "0.87.1." + generateVersionName() testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/tangem/domain/wallet/EthEngine.java b/app/src/main/java/com/tangem/domain/wallet/EthEngine.java index 08e8c62007..fb3167f9a8 100644 --- a/app/src/main/java/com/tangem/domain/wallet/EthEngine.java +++ b/app/src/main/java/com/tangem/domain/wallet/EthEngine.java @@ -243,34 +243,36 @@ public class EthEngine extends CoinEngine { public boolean CheckAmountValie(TangemCard mCard, String amountValue, String feeValue, Long minFeeInInternalUnits) { - Long fee = null; - Long amount = null; +// Long fee = null; +// Long amount = null; +// try { +// amount = mCard.InternalUnitsFromString(amountValue); +// fee = mCard.InternalUnitsFromString(feeValue); +// } catch (Exception e) { +// e.printStackTrace(); +// return false; +// } +// +// if (fee == null || amount == null) +// return false; +// +// if (fee == 0 || amount == 0) +// return false; +// +// +// if (fee < minFeeInInternalUnits) +// return false; + try { - amount = mCard.InternalUnitsFromString(amountValue); - fee = mCard.InternalUnitsFromString(feeValue); - } catch (Exception e) { + BigDecimal tmpFee = new BigDecimal(feeValue); + BigDecimal tmpAmount = new BigDecimal(amountValue); + tmpAmount = tmpAmount.multiply(new BigDecimal("1000000000")); + if (tmpFee.compareTo(tmpAmount) > 0) + return false; + } catch (NumberFormatException e) { e.printStackTrace(); - return false; } - if (fee == null || amount == null) - return false; - - if (fee == 0 || amount == 0) - return false; - - - if (fee < minFeeInInternalUnits) - return false; - - - BigDecimal tmpFee = new BigDecimal(feeValue); - BigDecimal tmpAmount = new BigDecimal(amountValue); - tmpAmount = tmpAmount.multiply(new BigDecimal("1000000000")); - - if (tmpFee.compareTo(tmpAmount) > 0) - return false; - return true; }