mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
add trusted flag to node model
node model fix
This commit is contained in:
parent
02ab644baf
commit
6391e474f0
2 changed files with 12 additions and 3 deletions
|
@ -26,6 +26,8 @@ class NodeModel {
|
|||
final bool isFailover;
|
||||
// @HiveField(9)
|
||||
final bool isDown;
|
||||
// @HiveField(10)
|
||||
final bool? trusted;
|
||||
|
||||
NodeModel({
|
||||
required this.host,
|
||||
|
@ -38,6 +40,7 @@ class NodeModel {
|
|||
required this.isFailover,
|
||||
required this.isDown,
|
||||
this.loginName,
|
||||
this.trusted,
|
||||
});
|
||||
|
||||
NodeModel copyWith({
|
||||
|
@ -50,6 +53,7 @@ class NodeModel {
|
|||
String? coinName,
|
||||
bool? isFailover,
|
||||
bool? isDown,
|
||||
bool? trusted,
|
||||
}) {
|
||||
return NodeModel(
|
||||
host: host ?? this.host,
|
||||
|
@ -62,6 +66,7 @@ class NodeModel {
|
|||
coinName: coinName ?? this.coinName,
|
||||
isFailover: isFailover ?? this.isFailover,
|
||||
isDown: isDown ?? this.isDown,
|
||||
trusted: trusted ?? this.trusted,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -82,6 +87,7 @@ class NodeModel {
|
|||
map['coinName'] = coinName;
|
||||
map['isFailover'] = isFailover;
|
||||
map['isDown'] = isDown;
|
||||
map['trusted'] = trusted;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,14 +26,15 @@ class NodeModelAdapter extends TypeAdapter<NodeModel> {
|
|||
loginName: fields[5] as String?,
|
||||
coinName: fields[7] as String,
|
||||
isFailover: fields[8] as bool,
|
||||
isDown: fields[8] as bool,
|
||||
isDown: fields[9] as bool,
|
||||
trusted: fields[10] as bool?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, NodeModel obj) {
|
||||
writer
|
||||
..writeByte(10)
|
||||
..writeByte(11)
|
||||
..writeByte(0)
|
||||
..write(obj.id)
|
||||
..writeByte(1)
|
||||
|
@ -53,7 +54,9 @@ class NodeModelAdapter extends TypeAdapter<NodeModel> {
|
|||
..writeByte(8)
|
||||
..write(obj.isFailover)
|
||||
..writeByte(9)
|
||||
..write(obj.isDown);
|
||||
..write(obj.isDown)
|
||||
..writeByte(10)
|
||||
..write(obj.trusted);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue