mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user