CAKE-345 | applied "any" method instead "where" and made single conditions in the createTransaction method (electrum and monero wallets); renamed credentialAmount on totalAmount and made it final in the monero_wallet.dart; made optional paymentId in createTransaction and createTransactionMultDest methods in the transaction_history.dart

This commit is contained in:
OleksandrSobol
2021-08-11 15:20:09 +03:00
parent 1e3ec8da1c
commit a8375321bc
3 changed files with 8 additions and 28 deletions
+2 -10
View File
@@ -186,16 +186,8 @@ abstract class ElectrumWalletBase extends WalletBase<ElectrumBalance,
var fee = 0;
if (hasMultiDestination) {
final sendAllItems = outputs.where((item) => item.sendAll).toList();
if (sendAllItems?.isNotEmpty ?? false) {
throw BitcoinTransactionWrongBalanceException(currency);
}
final nullAmountItems = outputs.where((item) =>
item.formattedCryptoAmount <= 0).toList();
if (nullAmountItems?.isNotEmpty ?? false) {
if (outputs.any((item) => item.sendAll) ||
outputs.any((item) => item.formattedCryptoAmount <= 0)) {
throw BitcoinTransactionWrongBalanceException(currency);
}