mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
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:
parent
7abe5735c0
commit
fce6394bca
46 changed files with 881 additions and 264 deletions
|
@ -21,6 +21,7 @@ class Node extends HiveObject with Keyable {
|
|||
this.trusted = false,
|
||||
this.socksProxyAddress,
|
||||
String? uri,
|
||||
String? path,
|
||||
WalletType? type,
|
||||
}) {
|
||||
if (uri != null) {
|
||||
|
@ -29,10 +30,14 @@ class Node extends HiveObject with Keyable {
|
|||
if (type != null) {
|
||||
this.type = type;
|
||||
}
|
||||
if (path != null) {
|
||||
this.path = path;
|
||||
}
|
||||
}
|
||||
|
||||
Node.fromMap(Map<String, Object?> map)
|
||||
: uriRaw = map['uri'] as String? ?? '',
|
||||
path = map['path'] as String? ?? '',
|
||||
login = map['login'] as String?,
|
||||
password = map['password'] as String?,
|
||||
useSSL = map['useSSL'] as bool?,
|
||||
|
@ -63,6 +68,9 @@ class Node extends HiveObject with Keyable {
|
|||
@HiveField(6)
|
||||
String? socksProxyAddress;
|
||||
|
||||
@HiveField(7, defaultValue: '')
|
||||
String? path;
|
||||
|
||||
bool get isSSL => useSSL ?? false;
|
||||
|
||||
bool get useSocksProxy => socksProxyAddress == null ? false : socksProxyAddress!.isNotEmpty;
|
||||
|
@ -79,9 +87,9 @@ class Node extends HiveObject with Keyable {
|
|||
case WalletType.nano:
|
||||
case WalletType.banano:
|
||||
if (isSSL) {
|
||||
return Uri.https(uriRaw, '');
|
||||
return Uri.https(uriRaw, path ?? '');
|
||||
} else {
|
||||
return Uri.http(uriRaw, '');
|
||||
return Uri.http(uriRaw, path ?? '');
|
||||
}
|
||||
case WalletType.ethereum:
|
||||
case WalletType.polygon:
|
||||
|
@ -103,7 +111,8 @@ class Node extends HiveObject with Keyable {
|
|||
other.typeRaw == typeRaw &&
|
||||
other.useSSL == useSSL &&
|
||||
other.trusted == trusted &&
|
||||
other.socksProxyAddress == socksProxyAddress);
|
||||
other.socksProxyAddress == socksProxyAddress &&
|
||||
other.path == path);
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
|
@ -113,7 +122,8 @@ class Node extends HiveObject with Keyable {
|
|||
typeRaw.hashCode ^
|
||||
useSSL.hashCode ^
|
||||
trusted.hashCode ^
|
||||
socksProxyAddress.hashCode;
|
||||
socksProxyAddress.hashCode ^
|
||||
path.hashCode;
|
||||
|
||||
@override
|
||||
dynamic get keyIndex {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue