enable ssl for btc-electrum (#1765)
Some checks failed
Cache Dependencies / test (push) Has been cancelled

This commit is contained in:
Omar Hatem 2024-10-22 15:23:42 +03:00 committed by GitHub
parent 0a1e32c363
commit 20efba43cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -3,6 +3,7 @@
useSSL: true
-
uri: btc-electrum.cakewallet.com:50002
useSSL: true
isDefault: true
-
uri: electrs.cakewallet.com:50001

View file

@ -256,6 +256,9 @@ Future<void> defaultSettingsMigration(
await _addSethNode(nodes, sharedPreferences);
await updateTronNodesWithNowNodes(sharedPreferences: sharedPreferences, nodes: nodes);
break;
case 42:
updateBtcElectrumNodeToUseSSL(nodes, sharedPreferences);
break;
default:
break;
}
@ -270,6 +273,15 @@ Future<void> defaultSettingsMigration(
await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version);
}
void updateBtcElectrumNodeToUseSSL(Box<Node> nodes, SharedPreferences sharedPreferences) {
final btcElectrumNode = nodes.values.firstWhereOrNull((element) => element.uriRaw == newCakeWalletBitcoinUri);
if (btcElectrumNode != null) {
btcElectrumNode.useSSL = true;
btcElectrumNode.save();
}
}
void _deselectQuantex(SharedPreferences sharedPreferences) {
final Map<String, dynamic> exchangeProvidersSelection =
json.decode(sharedPreferences.getString(PreferencesKey.exchangeProvidersSelection) ?? "{}")

View file

@ -192,7 +192,7 @@ Future<void> initializeAppConfigs() async {
transactionDescriptions: transactionDescriptions,
secureStorage: secureStorage,
anonpayInvoiceInfo: anonpayInvoiceInfo,
initialMigrationVersion: 41,
initialMigrationVersion: 42,
);
}