fix type in config

This commit is contained in:
John Smith 2023-07-02 11:31:53 -04:00
parent 82e87042a4
commit 77c068cd19
2 changed files with 8 additions and 6 deletions

View File

@ -645,8 +645,8 @@ class VeilidConfigRPC {
//////////// ////////////
class VeilidConfigRoutingTable { class VeilidConfigRoutingTable {
List<PublicKey> nodeId; List<TypedKey> nodeId;
List<PublicKey> nodeIdSecret; List<TypedSecret> nodeIdSecret;
List<String> bootstrap; List<String> bootstrap;
int limitOverAttached; int limitOverAttached;
int limitFullyAttached; int limitFullyAttached;
@ -679,10 +679,10 @@ class VeilidConfigRoutingTable {
} }
VeilidConfigRoutingTable.fromJson(dynamic json) VeilidConfigRoutingTable.fromJson(dynamic json)
: nodeId = List<PublicKey>.from( : nodeId = List<TypedKey>.from(
json['node_id'].map((j) => PublicKey.fromJson(j))), json['node_id'].map((j) => TypedKey.fromJson(j))),
nodeIdSecret = List<PublicKey>.from( nodeIdSecret = List<TypedSecret>.from(
json['node_id_secret'].map((j) => PublicKey.fromJson(j))), json['node_id_secret'].map((j) => TypedSecret.fromJson(j))),
bootstrap = List<String>.from(json['bootstrap'].map((j) => j)), bootstrap = List<String>.from(json['bootstrap'].map((j) => j)),
limitOverAttached = json['limit_over_attached'], limitOverAttached = json['limit_over_attached'],
limitFullyAttached = json['limit_fully_attached'], limitFullyAttached = json['limit_fully_attached'],

View File

@ -132,6 +132,8 @@ typedef SharedSecret = CryptoKey;
typedef CryptoKeyDistance = CryptoKey; typedef CryptoKeyDistance = CryptoKey;
typedef TypedKey = Typed<CryptoKey>; typedef TypedKey = Typed<CryptoKey>;
typedef TypedSecret = Typed<SecretKey>;
typedef TypedSignature = Typed<Signature>; typedef TypedSignature = Typed<Signature>;
////////////////////////////////////// //////////////////////////////////////