From 9baa30c1a40b422bb5f4746efc1220b52691ace6 Mon Sep 17 00:00:00 2001 From: likho Date: Wed, 26 Oct 2022 10:52:02 +0200 Subject: [PATCH] REmove testnet --- lib/pages/exchange_view/send_from_view.dart | 1 - .../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 - 12 files changed, 3 insertions(+), 75 deletions(-) diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index 7dd841d65..271e2b349 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -61,7 +61,6 @@ class _SendFromViewState extends ConsumerState { case Coin.bitcoincashTestnet: case Coin.dogecoinTestNet: case Coin.firoTestNet: - case Coin.particlTestNet: return amount.toStringAsFixed(Constants.decimalPlaces); case Coin.monero: return amount.toStringAsFixed(Constants.decimalPlacesMonero); 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 ce422ddf9..df4921af9 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 @@ -123,7 +123,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!, @@ -540,7 +539,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 6d3cbd4e3..d2ac174f5 100644 --- a/lib/services/coins/coin_service.dart +++ b/lib/services/coins/coin_service.dart @@ -156,15 +156,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 91cedefd9..3e0664b3d 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -69,8 +69,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 df26f4d8f..a7fb6c3e2 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -187,8 +187,6 @@ class _SVG { return firoTestnet; case Coin.dogecoinTestNet: return dogecoinTestnet; - case Coin.particlTestNet: - return particlTestnet; } } } @@ -233,7 +231,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 52d84b815..bc76b8173 100644 --- a/lib/utilities/block_explorers.dart +++ b/lib/utilities/block_explorers.dart @@ -33,7 +33,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 3258aa74f..acaac157f 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -52,7 +52,6 @@ abstract class Constants { case Coin.epicCash: case Coin.namecoin: case Coin.particl: - case Coin.particlTestNet: values.addAll([24, 21, 18, 15, 12]); break; @@ -98,7 +97,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 b2aad8fef..92f1e6f8c 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -119,8 +119,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, @@ -177,18 +177,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: @@ -229,9 +217,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 0454dc1f2..3f578c669 100644 --- a/lib/utilities/enums/coin_enum.dart +++ b/lib/utilities/enums/coin_enum.dart @@ -32,7 +32,6 @@ enum Coin { bitcoincashTestnet, dogecoinTestNet, firoTestNet, - particlTestNet } // remove firotestnet for now @@ -67,8 +66,6 @@ extension CoinExt on Coin { return "tFiro"; case Coin.dogecoinTestNet: return "tDogecoin"; - case Coin.particlTestNet: - return "tParticl"; } } @@ -100,8 +97,6 @@ extension CoinExt on Coin { return "tFIRO"; case Coin.dogecoinTestNet: return "tDOGE"; - case Coin.particlTestNet: - return "tPART"; } } @@ -134,8 +129,6 @@ extension CoinExt on Coin { return "firo"; case Coin.dogecoinTestNet: return "dogecoin"; - case Coin.particlTestNet: - return "particl"; } } @@ -151,7 +144,6 @@ extension CoinExt on Coin { case Coin.bitcoincashTestnet: case Coin.firoTestNet: case Coin.dogecoinTestNet: - case Coin.particlTestNet: return true; case Coin.epicCash: @@ -186,7 +178,6 @@ extension CoinExt on Coin { return xmr.MINIMUM_CONFIRMATIONS; case Coin.particl: - case Coin.particlTestNet: return particl.MINIMUM_CONFIRMATIONS; case Coin.wownero: @@ -227,7 +218,6 @@ Coin coinFromPrettyName(String name) { case "Particl": case "particl": - case "particlTestNet": return Coin.particl; case "Namecoin": @@ -292,8 +282,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 443297363..4512dabfc 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -213,7 +213,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 33c5e306d..2a1ee7ce9 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -1424,7 +1424,6 @@ class StackColors extends ThemeExtension { case Coin.wownero: return _coin.wownero; case Coin.particl: - case Coin.particlTestNet: return _coin.particl; } }