diff --git a/api/src/api/status.rs b/api/src/api/status.rs index f564cec2..a0d4ef3b 100644 --- a/api/src/api/status.rs +++ b/api/src/api/status.rs @@ -15,7 +15,12 @@ pub struct EnvoyStatus { } #[quantum_link] -pub struct Heartbeat {} +pub struct Heartbeat { + #[n(0)] + pub request_id: Option<[u8; 16]>, + #[n(1)] + pub timestamp_ms: Option, +} #[quantum_link] pub struct TimezoneRequest {} diff --git a/api/tests/golden_tests.rs b/api/tests/golden_tests.rs index e240c9e3..a151f7f7 100644 --- a/api/tests/golden_tests.rs +++ b/api/tests/golden_tests.rs @@ -546,5 +546,16 @@ fn golden_restore_magic_backup_result_error() { #[test] fn golden_heartbeat() { - assert_golden!(QuantumLinkMessage::Heartbeat(Heartbeat {})) + assert_golden!(QuantumLinkMessage::Heartbeat(Heartbeat { + request_id: None, + timestamp_ms: None, + })) +} + +#[test] +fn golden_heartbeat_with_request_id() { + assert_golden!(QuantumLinkMessage::Heartbeat(Heartbeat { + request_id: Some([0x42; 16]), + timestamp_ms: Some(1_700_000_000_123), + })) } diff --git a/api/tests/snapshots/golden_tests__golden_heartbeat_with_request_id.snap b/api/tests/snapshots/golden_tests__golden_heartbeat_with_request_id.snap new file mode 100644 index 00000000..25d21223 --- /dev/null +++ b/api/tests/snapshots/golden_tests__golden_heartbeat_with_request_id.snap @@ -0,0 +1,5 @@ +--- +source: api/tests/golden_tests.rs +expression: hex.clone() +--- +82181fa2005042424242424242424242424242424242011b0000018bcfe5687b