Fix network ID and validator icons (#189)

* fix: Validator icons

* fix: Propagation time for blocks < highest

* fix: Reintroduce network_id to Rust backend
This commit is contained in:
Maciej Hirsz
2019-11-08 13:36:19 +01:00
committed by GitHub
parent a3b6f6a5a1
commit adbd7cb592
11 changed files with 380 additions and 330 deletions
+5 -3
View File
@@ -11,6 +11,8 @@ pub struct NodeDetails {
pub name: Box<str>,
pub implementation: Box<str>,
pub version: Box<str>,
pub validator: Option<Box<str>>,
pub network_id: Option<Box<str>>,
}
#[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
@@ -31,7 +33,7 @@ pub struct BlockDetails {
pub block: Block,
pub block_time: u64,
pub block_timestamp: u64,
pub propagation_time: u64,
pub propagation_time: Option<u64>,
}
pub type NodeHardware<'a> = (&'a [f32], &'a [f32], &'a [f64], &'a [f64], &'a [f64]);
@@ -52,8 +54,8 @@ impl Serialize for NodeDetails {
tup.serialize_element(&self.name)?;
tup.serialize_element(&self.implementation)?;
tup.serialize_element(&self.version)?;
tup.serialize_element::<Option<String>>(&None)?; // TODO Maybe<Address>
tup.serialize_element::<Option<usize>>(&None)?; // TODO Maybe<NetworkId>
tup.serialize_element(&self.validator)?; // TODO Maybe<Address>
tup.serialize_element(&self.network_id)?; // TODO Maybe<NetworkId>
tup.serialize_element("")?; // TODO Address
tup.end()
}