Skip to content

Commit

Permalink
fixed e2e tests added missing struct params
Browse files Browse the repository at this point in the history
  • Loading branch information
MrishoLukamba committed Aug 26, 2024
1 parent 50d3a74 commit aecd20b
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/substrate-telemetry.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions backend/test_utils/src/feed_message_de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ pub struct NodeDetails {
pub version: String,
pub validator: Option<String>,
pub network_id: Option<String>,
pub os: String,
pub arch: String,
pub target_env: String,
pub ip: Option<String>,
pub sysinfo: Option<NodeSysInfo>,
}
Expand All @@ -144,7 +147,6 @@ impl FeedMessage {
/// Decode a slice of bytes into a vector of feed messages
pub fn from_bytes(bytes: &[u8]) -> Result<Vec<FeedMessage>, anyhow::Error> {
let v: Vec<&RawValue> = serde_json::from_slice(bytes)?;

let mut feed_messages = vec![];
for raw_keyval in v.chunks(2) {
let raw_key = raw_keyval[0];
Expand All @@ -161,6 +163,8 @@ impl FeedMessage {

// Deserialize the feed message to a value based on the "action" key
fn decode(action: u8, raw_val: &RawValue) -> Result<FeedMessage, anyhow::Error> {
println!("\n\n");
println!("{raw_val:#?}");
let feed_message = match action {
// Version:
0 => {
Expand Down Expand Up @@ -189,7 +193,19 @@ impl FeedMessage {
3 => {
let (
node_id,
(name, implementation, version, validator, network_id, ip, sysinfo, hwbench),
(
name,
implementation,
version,
validator,
network_id,
os,
arch,
target_env,
ip,
sysinfo,
hwbench,
),
stats,
io,
hardware,
Expand All @@ -209,6 +225,9 @@ impl FeedMessage {
version,
validator,
network_id,
os,
arch,
target_env,
ip,
sysinfo,
},
Expand Down

0 comments on commit aecd20b

Please sign in to comment.