From e76ee79c89247a6004b706e59b273ccc6801162e Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 7 Jun 2024 08:45:56 -0600 Subject: [PATCH] clean up some TODOs --- lib/pages/intro_view.dart | 3 --- lib/pages/wallet_view/wallet_view.dart | 11 ----------- lib/wallets/crypto_currency/coins/bitcoin.dart | 12 ++++++------ .../crypto_currency/coins/bitcoin_frost.dart | 13 +++++++------ lib/wallets/crypto_currency/coins/bitcoincash.dart | 12 ++++++------ lib/wallets/crypto_currency/coins/dogecoin.dart | 12 ++++++------ lib/wallets/crypto_currency/coins/ecash.dart | 12 ++++++------ lib/wallets/crypto_currency/coins/firo.dart | 12 ++++++------ lib/wallets/crypto_currency/coins/litecoin.dart | 12 ++++++------ lib/wallets/crypto_currency/coins/namecoin.dart | 6 +++--- lib/wallets/crypto_currency/coins/particl.dart | 6 +++--- lib/wallets/crypto_currency/crypto_currency.dart | 3 --- lib/wallets/wallet/impl/firo_wallet.dart | 3 ++- 13 files changed, 51 insertions(+), 66 deletions(-) diff --git a/lib/pages/intro_view.dart b/lib/pages/intro_view.dart index b1666cd04..576d99e3a 100644 --- a/lib/pages/intro_view.dart +++ b/lib/pages/intro_view.dart @@ -195,9 +195,6 @@ class AppNameText extends StatelessWidget { Widget build(BuildContext context) { return Text( AppConfig.appName, - // TODO [prio=high]: appName is now static due to `'appName' can't be - // accessed using static access.`", check that that doesn't cause issues - // elsewhere. textAlign: TextAlign.center, style: !isDesktop ? STextStyles.pageTitleH1(context) diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index fb21fe42a..e4bc2a755 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -191,17 +191,6 @@ class _WalletViewState extends ConsumerState { _rescanningOnOpen = true; _lelantusRescanRecovery = true; _firoRescanRecovery(); - // } else if (ref.read(managerProvider).rescanOnOpenVersion == - // TODO: [prio=med] - // Constants.rescanV1) { - // _rescanningOnOpen = true; - // ref.read(managerProvider).fullRescan(20, 1000).then( - // (_) => ref.read(managerProvider).resetRescanOnOpen().then( - // (_) => WidgetsBinding.instance.addPostFrameCallback( - // (_) => setState(() => _rescanningOnOpen = false), - // ), - // ), - // ); } else { wallet.refresh(); } diff --git a/lib/wallets/crypto_currency/coins/bitcoin.dart b/lib/wallets/crypto_currency/coins/bitcoin.dart index ffdd4c15d..ae1214e3e 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin.dart @@ -94,9 +94,9 @@ class Bitcoin extends Bip39HDCurrency pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -107,9 +107,9 @@ class Bitcoin extends Bip39HDCurrency pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/bitcoin_frost.dart b/lib/wallets/crypto_currency/coins/bitcoin_frost.dart index ed55766c8..9fe8fcf69 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin_frost.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin_frost.dart @@ -1,6 +1,7 @@ import 'dart:typed_data'; import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib; + import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/node_model.dart'; import '../../../utilities/amount/amount.dart'; @@ -126,9 +127,9 @@ class BitcoinFrost extends FrostCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -139,9 +140,9 @@ class BitcoinFrost extends FrostCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/bitcoincash.dart b/lib/wallets/crypto_currency/coins/bitcoincash.dart index fb2f66a92..99724e24b 100644 --- a/lib/wallets/crypto_currency/coins/bitcoincash.dart +++ b/lib/wallets/crypto_currency/coins/bitcoincash.dart @@ -101,9 +101,9 @@ class Bitcoincash extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -114,9 +114,9 @@ class Bitcoincash extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/dogecoin.dart b/lib/wallets/crypto_currency/coins/dogecoin.dart index cbb9bea1e..2af03fab5 100644 --- a/lib/wallets/crypto_currency/coins/dogecoin.dart +++ b/lib/wallets/crypto_currency/coins/dogecoin.dart @@ -143,9 +143,9 @@ class Dogecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x02facafd, bech32Hrp: "doge", messagePrefix: '\x18Dogecoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -156,9 +156,9 @@ class Dogecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tdge", messagePrefix: "\x18Dogecoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/ecash.dart b/lib/wallets/crypto_currency/coins/ecash.dart index 2b05784dd..5f420ad55 100644 --- a/lib/wallets/crypto_currency/coins/ecash.dart +++ b/lib/wallets/crypto_currency/coins/ecash.dart @@ -96,9 +96,9 @@ class Ecash extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -109,9 +109,9 @@ class Ecash extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/firo.dart b/lib/wallets/crypto_currency/coins/firo.dart index 6880190b6..530bf39e7 100644 --- a/lib/wallets/crypto_currency/coins/firo.dart +++ b/lib/wallets/crypto_currency/coins/firo.dart @@ -89,9 +89,9 @@ class Firo extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Zcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -102,9 +102,9 @@ class Firo extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Zcoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/litecoin.dart b/lib/wallets/crypto_currency/coins/litecoin.dart index 880a3260e..a859f9f64 100644 --- a/lib/wallets/crypto_currency/coins/litecoin.dart +++ b/lib/wallets/crypto_currency/coins/litecoin.dart @@ -96,9 +96,9 @@ class Litecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "ltc", messagePrefix: '\x19Litecoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); case CryptoCurrencyNetwork.test: return coinlib.Network( @@ -109,9 +109,9 @@ class Litecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tltc", messagePrefix: "\x19Litecoin Signed Message:\n", - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/namecoin.dart b/lib/wallets/crypto_currency/coins/namecoin.dart index 371406ddf..4bc2521bd 100644 --- a/lib/wallets/crypto_currency/coins/namecoin.dart +++ b/lib/wallets/crypto_currency/coins/namecoin.dart @@ -185,9 +185,9 @@ class Namecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "nc", messagePrefix: '\x18Namecoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet support. diff --git a/lib/wallets/crypto_currency/coins/particl.dart b/lib/wallets/crypto_currency/coins/particl.dart index 595f6fbf4..f250792cc 100644 --- a/lib/wallets/crypto_currency/coins/particl.dart +++ b/lib/wallets/crypto_currency/coins/particl.dart @@ -165,9 +165,9 @@ class Particl extends Bip39HDCurrency with ElectrumXCurrencyInterface { pubHDPrefix: 0x696e82d1, bech32Hrp: "pw", messagePrefix: '\x18Bitcoin Signed Message:\n', - minFee: BigInt.from(1), // TODO [prio=high]. - minOutput: dustLimit.raw, // TODO. - feePerKb: BigInt.from(1), // TODO. + minFee: BigInt.from(1), // Not used in stack wallet currently + minOutput: dustLimit.raw, // Not used in stack wallet currently + feePerKb: BigInt.from(1), // Not used in stack wallet currently ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet. diff --git a/lib/wallets/crypto_currency/crypto_currency.dart b/lib/wallets/crypto_currency/crypto_currency.dart index 7b30c85fe..eb6e88daa 100644 --- a/lib/wallets/crypto_currency/crypto_currency.dart +++ b/lib/wallets/crypto_currency/crypto_currency.dart @@ -29,9 +29,6 @@ enum CryptoCurrencyNetwork { } abstract class CryptoCurrency { - // @Deprecated("[prio=low] Should eventually move away from Coin enum") - // late final CryptoCurrency coin; - final CryptoCurrencyNetwork network; CryptoCurrency(this.network); diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index 89f6cdb3e..faa9df0a6 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -567,7 +567,8 @@ class FiroWallet extends Bip39HDWallet String? label; if (jsonUTXO["value"] is int) { - // TODO: [prio=med] use special electrumx call to verify the 1000 Firo output is masternode + // TODO: [prio=high] use special electrumx call to verify the 1000 Firo output is masternode + // electrumx call should exist now. Unsure if it works though blocked = Amount.fromDecimal( Decimal.fromInt( 1000, // 1000 firo output is a possible master node