From ec399ade0aef1d9ab2dd78876a2d20819dae4ba0 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 29 Nov 2022 13:14:11 -0600 Subject: [PATCH] Remove testnet --- .../add_edit_node_view.dart | 2 -- lib/services/coins/coin_service.dart | 9 ------- .../coins/particl/particl_wallet.dart | 24 +------------------ lib/utilities/address_utils.dart | 2 -- lib/utilities/assets.dart | 3 --- lib/utilities/block_explorers.dart | 2 -- lib/utilities/constants.dart | 2 -- lib/utilities/default_nodes.dart | 19 ++------------- lib/utilities/enums/coin_enum.dart | 12 ---------- lib/utilities/theme/color_theme.dart | 1 - lib/utilities/theme/stack_colors.dart | 1 - 11 files changed, 3 insertions(+), 74 deletions(-) diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index 0cf616013..6c515b468 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -148,7 +148,6 @@ class _AddEditNodeViewState extends ConsumerState { case Coin.bitcoincashTestnet: case Coin.firoTestNet: case Coin.dogecoinTestNet: - case Coin.particlTestNet: final client = ElectrumX( host: formData.host!, port: formData.port!, @@ -695,7 +694,6 @@ class _NodeFormState extends ConsumerState { case Coin.bitcoincashTestnet: case Coin.firoTestNet: case Coin.dogecoinTestNet: - case Coin.particlTestNet: return false; case Coin.epicCash: diff --git a/lib/services/coins/coin_service.dart b/lib/services/coins/coin_service.dart index e0031d781..c9c6c0138 100644 --- a/lib/services/coins/coin_service.dart +++ b/lib/services/coins/coin_service.dart @@ -191,15 +191,6 @@ abstract class CoinServiceAPI { cachedClient: cachedClient, tracker: tracker); - case Coin.particlTestNet: - return ParticlWallet( - walletId: walletId, - walletName: walletName, - coin: coin, - client: client, - cachedClient: cachedClient, - tracker: tracker); - case Coin.wownero: return WowneroWallet( walletId: walletId, diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index 77d0fa7db..5aaedfd23 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -46,7 +46,7 @@ const int MINIMUM_CONFIRMATIONS = 1; const int DUST_LIMIT = 294; const String GENESIS_HASH_MAINNET = - "0000ee0784c195317ac95623e22fddb8c7b8825dc3998e0bb924d66866eccf4c"; + "000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770"; const String GENESIS_HASH_TESTNET = "0000594ada5310b367443ee0afd4fa3d0bbd5850ea4e33cdc7d6a904a7ec7c90"; @@ -89,9 +89,6 @@ bip32.BIP32 getBip32NodeFromRoot( case 0x6c: // PART mainnet wif coinType = "44"; // PART mainnet break; - case 0x2e: // PART testnet wif - coinType = "1"; // PART testnet - break; default: throw Exception("Invalid Particl network type used!"); } @@ -153,8 +150,6 @@ class ParticlWallet extends CoinServiceAPI { switch (coin) { case Coin.particl: return particl; - case Coin.particlTestNet: - return particltestnet; default: throw Exception("Invalid network type!"); } @@ -352,10 +347,6 @@ class ParticlWallet extends CoinServiceAPI { throw Exception("genesis hash does not match main net!"); } break; - case Coin.particlTestNet: - if (features['genesis_hash'] != GENESIS_HASH_TESTNET) { - throw Exception("genesis hash does not match test net!"); - } break; default: throw Exception( @@ -1474,11 +1465,6 @@ class ParticlWallet extends CoinServiceAPI { throw Exception("genesis hash does not match main net!"); } break; - case Coin.particlTestNet: - if (features['genesis_hash'] != GENESIS_HASH_TESTNET) { - throw Exception("genesis hash does not match test net!"); - } - break; default: throw Exception( "Attempted to generate a ParticlWallet using a non particl coin type: ${coin.name}"); @@ -3803,11 +3789,3 @@ final particl = NetworkType( pubKeyHash: 0x38, scriptHash: 0x3c, wif: 0x6c); - -final particltestnet = NetworkType( - messagePrefix: '\x18Bitcoin Signed Message:\n', - bech32: 'tpw', - bip32: Bip32Type(public: 0xe1427800, private: 0x04889478), - pubKeyHash: 0x76, - scriptHash: 0x7a, - wif: 0x2e); diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index 376471c45..a6cbb8b58 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -74,8 +74,6 @@ class AddressUtils { return Address.validateAddress(address, firoTestNetwork); case Coin.dogecoinTestNet: return Address.validateAddress(address, dogecointestnet); - case Coin.particlTestNet: - return Address.validateAddress(address, particltestnet); } } diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index 74510418c..5e7e15f0b 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -228,8 +228,6 @@ class _SVG { return firoTestnet; case Coin.dogecoinTestNet: return dogecoinTestnet; - case Coin.particlTestNet: - return particlTestnet; } } } @@ -281,7 +279,6 @@ class _PNG { case Coin.namecoin: return namecoin; case Coin.particl: - case Coin.particlTestNet: return particl; } } diff --git a/lib/utilities/block_explorers.dart b/lib/utilities/block_explorers.dart index d259524d5..4b406b704 100644 --- a/lib/utilities/block_explorers.dart +++ b/lib/utilities/block_explorers.dart @@ -37,7 +37,5 @@ Uri getBlockExplorerTransactionUrlFor({ return Uri.parse("https://chainz.cryptoid.info/nmc/tx.dws?$txid.htm"); case Coin.particl: return Uri.parse("https://chainz.cryptoid.info/part/tx.dws?$txid.htm"); - case Coin.particlTestNet: - return Uri.parse(""); } } diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index a6fc902d5..25105d011 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -104,7 +104,6 @@ abstract class Constants { case Coin.epicCash: case Coin.namecoin: case Coin.particl: - case Coin.particlTestNet: values.addAll([24, 21, 18, 15, 12]); break; @@ -154,7 +153,6 @@ abstract class Constants { return 600; case Coin.particl: - case Coin.particlTestNet: return 600; } } diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index 1cbb4e07e..bab113cde 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -146,8 +146,8 @@ abstract class DefaultNodes { ); static NodeModel get particl => NodeModel( - host: "host", - port: 123, + host: "164.92.93.20", + port: 50002, name: defaultName, id: _nodeId(Coin.particl), useSSL: true, @@ -204,18 +204,6 @@ abstract class DefaultNodes { isDown: false, ); - static NodeModel get particlTestnet => NodeModel( - host: "host", - port: 60002, - name: defaultName, - id: _nodeId(Coin.particlTestNet), - useSSL: true, - enabled: true, - coinName: Coin.particlTestNet.name, - isFailover: true, - isDown: false, - ); - static NodeModel getNodeFor(Coin coin) { switch (coin) { case Coin.bitcoin: @@ -262,9 +250,6 @@ abstract class DefaultNodes { case Coin.dogecoinTestNet: return dogecoinTestnet; - - case Coin.particlTestNet: - return particlTestnet; } } diff --git a/lib/utilities/enums/coin_enum.dart b/lib/utilities/enums/coin_enum.dart index 4e45342bf..8c0c20f6e 100644 --- a/lib/utilities/enums/coin_enum.dart +++ b/lib/utilities/enums/coin_enum.dart @@ -38,7 +38,6 @@ enum Coin { bitcoincashTestnet, dogecoinTestNet, firoTestNet, - particlTestNet } final int kTestNetCoinCount = Util.isDesktop ? 5 : 4; @@ -76,8 +75,6 @@ extension CoinExt on Coin { return "tFiro"; case Coin.dogecoinTestNet: return "tDogecoin"; - case Coin.particlTestNet: - return "tParticl"; } } @@ -113,8 +110,6 @@ extension CoinExt on Coin { return "tFIRO"; case Coin.dogecoinTestNet: return "tDOGE"; - case Coin.particlTestNet: - return "tPART"; } } @@ -151,8 +146,6 @@ extension CoinExt on Coin { return "firo"; case Coin.dogecoinTestNet: return "dogecoin"; - case Coin.particlTestNet: - return "particl"; } } @@ -170,7 +163,6 @@ extension CoinExt on Coin { case Coin.bitcoincashTestnet: case Coin.firoTestNet: case Coin.dogecoinTestNet: - case Coin.particlTestNet: return true; case Coin.epicCash: @@ -209,7 +201,6 @@ extension CoinExt on Coin { return xmr.MINIMUM_CONFIRMATIONS; case Coin.particl: - case Coin.particlTestNet: return particl.MINIMUM_CONFIRMATIONS; case Coin.wownero: @@ -254,7 +245,6 @@ Coin coinFromPrettyName(String name) { case "Particl": case "particl": - case "particlTestNet": return Coin.particl; case "Namecoin": @@ -332,8 +322,6 @@ Coin coinFromTickerCaseInsensitive(String ticker) { return Coin.firoTestNet; case "tdoge": return Coin.dogecoinTestNet; - case "tparticl": - return Coin.particlTestNet; case "wow": return Coin.wownero; default: diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 8a73e7010..8de0954e8 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -221,7 +221,6 @@ class CoinThemeColor { case Coin.wownero: return wownero; case Coin.particl: - case Coin.particlTestNet: return particl; } } diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index 66ce107f1..9764128e4 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -1444,7 +1444,6 @@ class StackColors extends ThemeExtension { case Coin.wownero: return _coin.wownero; case Coin.particl: - case Coin.particlTestNet: return _coin.particl; } }