mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-21 14:48:55 +00:00
lints
This commit is contained in:
parent
5cda658bd2
commit
a05287bae4
1 changed files with 11 additions and 9 deletions
|
@ -52,7 +52,8 @@ class PeercoinWallet extends Bip39HDWallet
|
||||||
return Amount(
|
return Amount(
|
||||||
rawValue: BigInt.from(
|
rawValue: BigInt.from(
|
||||||
((42 + (272 * inputCount) + (128 * outputCount)) / 4).ceil() *
|
((42 + (272 * inputCount) + (128 * outputCount)) / 4).ceil() *
|
||||||
(feeRatePerKB / 1000).ceil()),
|
(feeRatePerKB / 1000).ceil(),
|
||||||
|
),
|
||||||
fractionDigits: cryptoCurrency.fractionDigits,
|
fractionDigits: cryptoCurrency.fractionDigits,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -83,14 +84,15 @@ class PeercoinWallet extends Bip39HDWallet
|
||||||
@override
|
@override
|
||||||
Future<void> updateTransactions() async {
|
Future<void> updateTransactions() async {
|
||||||
// Get all addresses.
|
// Get all addresses.
|
||||||
List<Address> allAddressesOld = await fetchAddressesForElectrumXScan();
|
final List<Address> allAddressesOld =
|
||||||
|
await fetchAddressesForElectrumXScan();
|
||||||
|
|
||||||
// Separate receiving and change addresses.
|
// Separate receiving and change addresses.
|
||||||
Set<String> receivingAddresses = allAddressesOld
|
final Set<String> receivingAddresses = allAddressesOld
|
||||||
.where((e) => e.subType == AddressSubType.receiving)
|
.where((e) => e.subType == AddressSubType.receiving)
|
||||||
.map((e) => e.value)
|
.map((e) => e.value)
|
||||||
.toSet();
|
.toSet();
|
||||||
Set<String> changeAddresses = allAddressesOld
|
final Set<String> changeAddresses = allAddressesOld
|
||||||
.where((e) => e.subType == AddressSubType.change)
|
.where((e) => e.subType == AddressSubType.change)
|
||||||
.map((e) => e.value)
|
.map((e) => e.value)
|
||||||
.toSet();
|
.toSet();
|
||||||
|
@ -103,7 +105,7 @@ class PeercoinWallet extends Bip39HDWallet
|
||||||
await fetchHistory(allAddressesSet);
|
await fetchHistory(allAddressesSet);
|
||||||
|
|
||||||
// Only parse new txs (not in db yet).
|
// Only parse new txs (not in db yet).
|
||||||
List<Map<String, dynamic>> allTransactions = [];
|
final List<Map<String, dynamic>> allTransactions = [];
|
||||||
for (final txHash in allTxHashes) {
|
for (final txHash in allTxHashes) {
|
||||||
// Check for duplicates by searching for tx by tx_hash in db.
|
// Check for duplicates by searching for tx by tx_hash in db.
|
||||||
final storedTx = await mainDB.isar.transactionV2s
|
final storedTx = await mainDB.isar.transactionV2s
|
||||||
|
@ -164,8 +166,8 @@ class PeercoinWallet extends Bip39HDWallet
|
||||||
);
|
);
|
||||||
|
|
||||||
final prevOutJson = Map<String, dynamic>.from(
|
final prevOutJson = Map<String, dynamic>.from(
|
||||||
(inputTx["vout"] as List).firstWhere((e) => e["n"] == vout)
|
(inputTx["vout"] as List).firstWhere((e) => e["n"] == vout) as Map,
|
||||||
as Map);
|
);
|
||||||
|
|
||||||
final prevOut = OutputV2.fromElectrumXJson(
|
final prevOut = OutputV2.fromElectrumXJson(
|
||||||
prevOutJson,
|
prevOutJson,
|
||||||
|
@ -239,7 +241,7 @@ class PeercoinWallet extends Bip39HDWallet
|
||||||
.fold(BigInt.zero, (value, element) => value + element);
|
.fold(BigInt.zero, (value, element) => value + element);
|
||||||
|
|
||||||
TransactionType type;
|
TransactionType type;
|
||||||
TransactionSubType subType = TransactionSubType.none;
|
const TransactionSubType subType = TransactionSubType.none;
|
||||||
|
|
||||||
// At least one input was owned by this wallet.
|
// At least one input was owned by this wallet.
|
||||||
if (wasSentFromThisWallet) {
|
if (wasSentFromThisWallet) {
|
||||||
|
|
Loading…
Reference in a new issue