Cw 602 nano bad rep (#1356)

* add support for paths in node settings

* update translations and fixes

* fix node path

* add rep warning flag

* update translations

* code cleanup [skip ci]

* add additional node options

* add migration

* update transaction history rpc to be under the limit

* review fixes [skip ci]

* [skip ci] updates

* move n2_node.dart

* minor code improvements

* more minor code cleanup
This commit is contained in:
Matthew Fosse 2024-04-12 05:36:42 -07:00 committed by GitHub
parent 7abe5735c0
commit fce6394bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 881 additions and 264 deletions

View file

@ -216,6 +216,10 @@ Future<void> defaultSettingsMigration(
await disableServiceStatusFiatDisabled(sharedPreferences);
break;
case 31:
await updateNanoNodeList(nodes: nodes);
break;
default:
break;
}
@ -230,9 +234,35 @@ Future<void> defaultSettingsMigration(
await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version);
}
Future<void> updateNanoNodeList({required Box<Node> nodes}) async {
final nodeList = await loadDefaultNanoNodes();
var listOfNewEndpoints = <String>[
"app.natrium.io",
"rainstorm.city",
"node.somenano.com",
"nanoslo.0x.no",
"www.bitrequest.app",
];
// add new nodes:
for (final node in nodeList) {
if (listOfNewEndpoints.contains(node.uriRaw)) {
await nodes.add(node);
}
}
// update the nautilus node:
final nautilusNode =
nodes.values.firstWhereOrNull((element) => element.uriRaw == "node.perish.co");
if (nautilusNode != null) {
nautilusNode.uriRaw = "node.nautilus.io";
nautilusNode.path = "/api";
nautilusNode.useSSL = true;
await nautilusNode.save();
}
}
Future<void> disableServiceStatusFiatDisabled(SharedPreferences sharedPreferences) async {
final currentFiat =
await sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? -1;
final currentFiat = await sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? -1;
if (currentFiat == -1 || currentFiat == FiatApiMode.enabled.raw) {
return;
}