Allow marking Monero Nodes as trusted

This commit is contained in:
OmarHatem 2022-10-04 14:54:39 +02:00
parent 40e4f7de1f
commit d748f12e44
18 changed files with 47 additions and 6 deletions

View file

@ -20,7 +20,8 @@ class Node extends HiveObject with Keyable {
@required WalletType type,
this.login,
this.password,
this.useSSL}) {
this.useSSL,
this.trusted}) {
uriRaw = uri;
this.type = type;
}
@ -30,7 +31,8 @@ class Node extends HiveObject with Keyable {
login = map['login'] as String,
password = map['password'] as String,
typeRaw = map['typeRaw'] as int,
useSSL = map['useSSL'] as bool;
useSSL = map['useSSL'] as bool,
trusted = map['trusted'] as bool ?? false;
static const typeId = 1;
static const boxName = 'Nodes';
@ -50,8 +52,13 @@ class Node extends HiveObject with Keyable {
@HiveField(4)
bool useSSL;
@HiveField(5)
bool trusted;
bool get isSSL => useSSL ?? false;
bool get isTrusted => trusted ?? false;
Uri get uri {
switch (type) {
case WalletType.monero: