From a05287bae465761ddc665d2ca51719aa398cf31a Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 10 May 2024 11:45:23 -0600 Subject: [PATCH] lints --- lib/wallets/wallet/impl/peercoin_wallet.dart | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/wallets/wallet/impl/peercoin_wallet.dart b/lib/wallets/wallet/impl/peercoin_wallet.dart index 9e12066e8..d418ec485 100644 --- a/lib/wallets/wallet/impl/peercoin_wallet.dart +++ b/lib/wallets/wallet/impl/peercoin_wallet.dart @@ -51,8 +51,9 @@ class PeercoinWallet extends Bip39HDWallet Amount roughFeeEstimate(int inputCount, int outputCount, int feeRatePerKB) { return Amount( rawValue: BigInt.from( - ((42 + (272 * inputCount) + (128 * outputCount)) / 4).ceil() * - (feeRatePerKB / 1000).ceil()), + ((42 + (272 * inputCount) + (128 * outputCount)) / 4).ceil() * + (feeRatePerKB / 1000).ceil(), + ), fractionDigits: cryptoCurrency.fractionDigits, ); } @@ -83,14 +84,15 @@ class PeercoinWallet extends Bip39HDWallet @override Future updateTransactions() async { // Get all addresses. - List
allAddressesOld = await fetchAddressesForElectrumXScan(); + final List
allAddressesOld = + await fetchAddressesForElectrumXScan(); // Separate receiving and change addresses. - Set receivingAddresses = allAddressesOld + final Set receivingAddresses = allAddressesOld .where((e) => e.subType == AddressSubType.receiving) .map((e) => e.value) .toSet(); - Set changeAddresses = allAddressesOld + final Set changeAddresses = allAddressesOld .where((e) => e.subType == AddressSubType.change) .map((e) => e.value) .toSet(); @@ -103,7 +105,7 @@ class PeercoinWallet extends Bip39HDWallet await fetchHistory(allAddressesSet); // Only parse new txs (not in db yet). - List> allTransactions = []; + final List> allTransactions = []; for (final txHash in allTxHashes) { // Check for duplicates by searching for tx by tx_hash in db. final storedTx = await mainDB.isar.transactionV2s @@ -164,8 +166,8 @@ class PeercoinWallet extends Bip39HDWallet ); final prevOutJson = Map.from( - (inputTx["vout"] as List).firstWhere((e) => e["n"] == vout) - as Map); + (inputTx["vout"] as List).firstWhere((e) => e["n"] == vout) as Map, + ); final prevOut = OutputV2.fromElectrumXJson( prevOutJson, @@ -239,7 +241,7 @@ class PeercoinWallet extends Bip39HDWallet .fold(BigInt.zero, (value, element) => value + element); TransactionType type; - TransactionSubType subType = TransactionSubType.none; + const TransactionSubType subType = TransactionSubType.none; // At least one input was owned by this wallet. if (wasSentFromThisWallet) {