mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
use final
This commit is contained in:
parent
accc9a9b4e
commit
309a483026
2 changed files with 16 additions and 15 deletions
|
@ -62,14 +62,15 @@ class FiroWallet extends Bip39HDWallet
|
|||
|
||||
@override
|
||||
Future<void> updateTransactions() async {
|
||||
List<Address> allAddressesOld = await fetchAddressesForElectrumXScan();
|
||||
final List<Address> allAddressesOld =
|
||||
await fetchAddressesForElectrumXScan();
|
||||
|
||||
Set<String> receivingAddresses = allAddressesOld
|
||||
final Set<String> receivingAddresses = allAddressesOld
|
||||
.where((e) => e.subType == AddressSubType.receiving)
|
||||
.map((e) => convertAddressString(e.value))
|
||||
.toSet();
|
||||
|
||||
Set<String> changeAddresses = allAddressesOld
|
||||
final Set<String> changeAddresses = allAddressesOld
|
||||
.where((e) => e.subType == AddressSubType.change)
|
||||
.map((e) => convertAddressString(e.value))
|
||||
.toSet();
|
||||
|
@ -98,7 +99,7 @@ class FiroWallet extends Bip39HDWallet
|
|||
}
|
||||
}
|
||||
|
||||
List<Map<String, dynamic>> allTransactions = [];
|
||||
final List<Map<String, dynamic>> allTransactions = [];
|
||||
|
||||
// some lelantus transactions aren't fetched via wallet addresses so they
|
||||
// will never show as confirmed in the gui.
|
||||
|
@ -177,7 +178,7 @@ class FiroWallet extends Bip39HDWallet
|
|||
bool isMint = false;
|
||||
bool isJMint = false;
|
||||
bool isSparkMint = false;
|
||||
bool isMasterNodePayment = false;
|
||||
final bool isMasterNodePayment = false;
|
||||
final bool isSparkSpend = txData["type"] == 9 && txData["version"] == 3;
|
||||
final bool isMySpark = sparkTxids.contains(txData["txid"] as String);
|
||||
|
||||
|
@ -555,7 +556,7 @@ class FiroWallet extends Bip39HDWallet
|
|||
Map<String, dynamic>? jsonTX,
|
||||
String? utxoOwnerAddress,
|
||||
) async {
|
||||
bool blocked = false;
|
||||
final bool blocked = false;
|
||||
String? blockedReason;
|
||||
//
|
||||
// if (jsonTX != null) {
|
||||
|
|
|
@ -193,8 +193,8 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
.log('utxoObjectsToUse: $utxoObjectsToUse', level: LogLevel.Info);
|
||||
|
||||
// numberOfOutputs' length must always be equal to that of recipientsArray and recipientsAmtArray
|
||||
List<String> recipientsArray = [recipientAddress];
|
||||
List<int> recipientsAmtArray = [satoshiAmountToSend];
|
||||
final List<String> recipientsArray = [recipientAddress];
|
||||
final List<int> recipientsAmtArray = [satoshiAmountToSend];
|
||||
|
||||
// gather required signing data
|
||||
final utxoSigningData = await fetchBuildTxData(utxoObjectsToUse);
|
||||
|
@ -325,7 +325,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
feeForOneOutput + cryptoCurrency.dustLimit.raw.toInt()) {
|
||||
// Here, we know that theoretically, we may be able to include another output(change) but we first need to
|
||||
// factor in the value of this output in satoshis.
|
||||
int changeOutputSize =
|
||||
final int changeOutputSize =
|
||||
satoshisBeingUsed - satoshiAmountToSend - feeForTwoOutputs;
|
||||
// We check to see if the user can pay for the new transaction with 2 outputs instead of one. If they can and
|
||||
// the second output's size > cryptoCurrency.dustLimit satoshis, we perform the mechanics required to properly generate and use a new
|
||||
|
@ -370,7 +370,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
|
||||
// make sure minimum fee is accurate if that is being used
|
||||
if (txn.vSize! - feeBeingPaid == 1) {
|
||||
int changeOutputSize =
|
||||
final int changeOutputSize =
|
||||
satoshisBeingUsed - satoshiAmountToSend - txn.vSize!;
|
||||
feeBeingPaid =
|
||||
satoshisBeingUsed - satoshiAmountToSend - changeOutputSize;
|
||||
|
@ -526,7 +526,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
List<UTXO> utxosToUse,
|
||||
) async {
|
||||
// return data
|
||||
List<SigningData> signingData = [];
|
||||
final List<SigningData> signingData = [];
|
||||
|
||||
try {
|
||||
// Populating the addresses to check
|
||||
|
@ -879,7 +879,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
DerivePathType type,
|
||||
int chain,
|
||||
) async {
|
||||
List<Address> addressArray = [];
|
||||
final List<Address> addressArray = [];
|
||||
int gapCounter = 0;
|
||||
int highestIndexWithHistory = 0;
|
||||
|
||||
|
@ -891,7 +891,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
"index: $index, \t GapCounter $chain ${type.name}: $gapCounter",
|
||||
level: LogLevel.Info);
|
||||
|
||||
List<String> txCountCallArgs = [];
|
||||
final List<String> txCountCallArgs = [];
|
||||
|
||||
for (int j = 0; j < txCountBatchSize; j++) {
|
||||
final derivePath = cryptoCurrency.constructDerivePath(
|
||||
|
@ -960,7 +960,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
DerivePathType type,
|
||||
int chain,
|
||||
) async {
|
||||
List<Address> addressArray = [];
|
||||
final List<Address> addressArray = [];
|
||||
int gapCounter = 0;
|
||||
int index = 0;
|
||||
for (;
|
||||
|
@ -1023,7 +1023,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
Iterable<String> allAddresses,
|
||||
) async {
|
||||
try {
|
||||
List<Map<String, dynamic>> allTxHashes = [];
|
||||
final List<Map<String, dynamic>> allTxHashes = [];
|
||||
|
||||
if (serverCanBatch) {
|
||||
final Map<int, List<List<dynamic>>> batches = {};
|
||||
|
|
Loading…
Reference in a new issue