Expose GitHub hash in UI (#604)

* Expose GitHub hash in UI

* Prettier:fix

* cargo fmt

* Update tests

* Fix test
This commit is contained in:
James Wilson
2025-08-28 18:05:46 +01:00
committed by GitHub
parent 4a5cd54cd8
commit 71744ade7c
16 changed files with 115 additions and 33 deletions
+1
View File
@@ -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"
+15
View File
@@ -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();