mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-07-20 06:55:44 +00:00
Expose GitHub hash in UI (#604)
* Expose GitHub hash in UI * Prettier:fix * cargo fmt * Update tests * Fix test
This commit is contained in:
@@ -11,6 +11,7 @@ anyhow = "1.0.41"
|
||||
futures = "0.3.15"
|
||||
http = "0.2.4"
|
||||
log = "0.4.14"
|
||||
serde = "1"
|
||||
serde_json = "1.0.64"
|
||||
soketto = "0.7.1"
|
||||
thiserror = "1.0.25"
|
||||
|
||||
@@ -122,6 +122,9 @@ pub enum FeedMessage {
|
||||
node_id: usize,
|
||||
// details: NodeIO, // can't losslessly deserialize
|
||||
},
|
||||
TelemetryInfo {
|
||||
git_hash: String,
|
||||
},
|
||||
/// A "special" case when we don't know how to decode an action:
|
||||
UnknownValue {
|
||||
action: u8,
|
||||
@@ -367,6 +370,18 @@ impl FeedMessage {
|
||||
let (node_id, _node_io): (_, &RawValue) = serde_json::from_str(raw_val.get())?;
|
||||
FeedMessage::NodeIOUpdate { node_id }
|
||||
}
|
||||
// Note: 22: ChainStatsUpdate is not here. Add when we want to test it.
|
||||
// TelemetryInfo
|
||||
23 => {
|
||||
#[derive(serde::Deserialize)]
|
||||
struct TelemetryInfo {
|
||||
git_hash: String,
|
||||
}
|
||||
let val: TelemetryInfo = serde_json::from_str(raw_val.get())?;
|
||||
FeedMessage::TelemetryInfo {
|
||||
git_hash: val.git_hash,
|
||||
}
|
||||
}
|
||||
// A catchall for messages we don't know/care about yet:
|
||||
_ => {
|
||||
let value = raw_val.to_string();
|
||||
|
||||
Reference in New Issue
Block a user