aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/wire.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-30 21:47:31 +0100
committertv <tv@krebsco.de>2026-10-30 21:47:31 +0100
commitce191f8319876b0e369c29c565fd9eb63892187c (patch)
tree5f4c759f1fcce14570205736f42253359204671e /src/transport/wire.rs
parentdb6e1ad6592aefce8a99db8478fac0baae09b228 (diff)
allow links subscriptions
Diffstat (limited to 'src/transport/wire.rs')
-rw-r--r--src/transport/wire.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/transport/wire.rs b/src/transport/wire.rs
index dc94ab3..40e32a2 100644
--- a/src/transport/wire.rs
+++ b/src/transport/wire.rs
@@ -14,7 +14,7 @@ use super::{MessageKind, ParsedMessage};
/// The wire format's version, the first byte of every payload. Bump it with every change
/// to a message type or a codec (`golden_bytes` fails then).
-pub(crate) const VERSION: u8 = 10;
+pub(crate) const VERSION: u8 = 11;
/// What the second byte of a payload says.
fn tag(kind: MessageKind) -> u8 {
@@ -409,6 +409,7 @@ pub(crate) fn samples() -> Vec<ParsedMessage> {
epoch,
epoch_seq: 1,
nonce: 3,
+ subscribe_secs: 60,
}),
ParsedMessage::LinksReply(crate::transport::LinksReply {
epoch,
@@ -599,7 +600,7 @@ mod tests {
});
assert_eq!(
hex(&encode(&hello).unwrap()),
- format!("0a0097a5737761726d{epoch_hex}01c403010203c3{}07", run("04"))
+ format!("0b0097a5737761726d{epoch_hex}01c403010203c3{}07", run("04"))
);
let reply = ParsedMessage::HelloReply(HelloReply {
@@ -619,7 +620,7 @@ mod tests {
assert_eq!(
hex(&encode(&reply).unwrap()),
format!(
- "0a0199a5737761726d9192a17091a161{epoch_hex}01c400c2{}05{}",
+ "0b0199a5737761726d9192a17091a161{epoch_hex}01c400c2{}05{}",
run("04"),
run("06")
)
@@ -635,7 +636,7 @@ mod tests {
});
assert_eq!(
hex(&encode(&status).unwrap()),
- format!("0a03969290c400{epoch_hex}01c3c2c2")
+ format!("0b03969290c400{epoch_hex}01c3c2c2")
);
let who = ParsedMessage::Who(IdentityProof {
@@ -644,7 +645,7 @@ mod tests {
});
assert_eq!(
hex(&encode(&who).unwrap()),
- format!("0a0692c420{}c440{}", "08".repeat(32), "09".repeat(64))
+ format!("0b0692c420{}c440{}", "08".repeat(32), "09".repeat(64))
);
let ParsedMessage::Me(proof) = decode(
&encode(&ParsedMessage::Me(IdentityProof {
@@ -658,10 +659,10 @@ mod tests {
};
assert_eq!((proof.key, proof.signature), ([8; 32], [9; 64]));
- assert_eq!(hex(&encode(&ParsedMessage::Ping(7)).unwrap()), "0a0807");
+ assert_eq!(hex(&encode(&ParsedMessage::Ping(7)).unwrap()), "0b0807");
assert_eq!(
hex(&encode(&ParsedMessage::Pong(u64::MAX)).unwrap()),
- "0a09cfffffffffffffffff"
+ "0b09cfffffffffffffffff"
);
let ParsedMessage::Pong(nonce) = decode(&[VERSION, 9, 0x2a]).unwrap() else {
panic!("not a PONG");