mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Fix parsing .yml files to nodes (#543)
This commit is contained in:
parent
3c4ba6da53
commit
e011ab3e88
2 changed files with 7 additions and 8 deletions
|
@ -29,10 +29,9 @@ class Node extends HiveObject with Keyable {
|
|||
|
||||
Node.fromMap(Map<String, Object?> map)
|
||||
: uriRaw = map['uri'] as String? ?? '',
|
||||
login = map['login'] as String,
|
||||
password = map['password'] as String,
|
||||
typeRaw = map['typeRaw'] as int,
|
||||
useSSL = map['useSSL'] as bool;
|
||||
login = map['login'] as String?,
|
||||
password = map['password'] as String?,
|
||||
useSSL = map['useSSL'] as bool?;
|
||||
|
||||
static const typeId = 1;
|
||||
static const boxName = 'Nodes';
|
||||
|
|
|
@ -11,7 +11,7 @@ Future<List<Node>> loadDefaultNodes() async {
|
|||
|
||||
for (final raw in loadedNodes) {
|
||||
if (raw is Map) {
|
||||
final node = Node.fromMap(raw as Map<String, Object>);
|
||||
final node = Node.fromMap(Map<String, Object>.from(raw));
|
||||
node.type = WalletType.monero;
|
||||
nodes.add(node);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ Future<List<Node>> loadBitcoinElectrumServerList() async {
|
|||
|
||||
for (final raw in loadedServerList) {
|
||||
if (raw is Map) {
|
||||
final node = Node.fromMap(raw as Map<String, Object>);
|
||||
final node = Node.fromMap(Map<String, Object>.from(raw));
|
||||
node.type = WalletType.bitcoin;
|
||||
serverList.add(node);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ Future<List<Node>> loadLitecoinElectrumServerList() async {
|
|||
|
||||
for (final raw in loadedServerList) {
|
||||
if (raw is Map) {
|
||||
final node = Node.fromMap(raw as Map<String, Object>);
|
||||
final node = Node.fromMap(Map<String, Object>.from(raw));
|
||||
node.type = WalletType.litecoin;
|
||||
serverList.add(node);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ Future<List<Node>> loadDefaultHavenNodes() async {
|
|||
|
||||
for (final raw in loadedNodes) {
|
||||
if (raw is Map) {
|
||||
final node = Node.fromMap(raw as Map<String, Object>);
|
||||
final node = Node.fromMap(Map<String, Object>.from(raw));
|
||||
node.type = WalletType.haven;
|
||||
nodes.add(node);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue