Closed mycognosist closed 1 year ago
The peers field of ReplicationConfig is defined as HashMap<PublicKey, String>.
peers
ReplicationConfig
HashMap<PublicKey, String>
Deserialization fails because serde doesn't know how to deserialize bytes into a PublicKey:
serde
PublicKey
thread 'main' panicked at 'could not load configuration: DeserializeToml(Error { inner: ErrorInner { kind: Custom, line: Some(0), col: 0, at: Some(0), message: "invalid type: string \"@QlQwWaj48J1Du5rHQXTPfifUFsPKLrOo6T5EfWfkqXU=.ed25519\", expected PublicKey", key: ["peers"] } })', solar_cli/src/main.rs:253:33
Two options:
1) Write a custom deserializer (tedious when dealing with a HashMap) 2) Change the peers field to HashMap<String, String> and then map to HashMap<PublicKey, String> downstream
HashMap
HashMap<String, String>
I'm going for 2.
The
peers
field ofReplicationConfig
is defined asHashMap<PublicKey, String>
.Deserialization fails because
serde
doesn't know how to deserialize bytes into aPublicKey
:thread 'main' panicked at 'could not load configuration: DeserializeToml(Error { inner: ErrorInner { kind: Custom, line: Some(0), col: 0, at: Some(0), message: "invalid type: string \"@QlQwWaj48J1Du5rHQXTPfifUFsPKLrOo6T5EfWfkqXU=.ed25519\", expected PublicKey", key: ["peers"] } })', solar_cli/src/main.rs:253:33
Two options:
1) Write a custom deserializer (tedious when dealing with a
HashMap
) 2) Change the peers field toHashMap<String, String>
and then map toHashMap<PublicKey, String>
downstreamI'm going for 2.