MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / empty_payload

Function empty_payload

nodedb-cluster/src/wire.rs:369–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367
368 #[test]
369 fn empty_payload() {
370 let env = VShardEnvelope::new(VShardMessageType::RoutingAck, 5, 6, 999, vec![]);
371 let bytes = env.to_bytes();
372 assert_eq!(bytes.len(), 28); // header only (v2: vshard_id widened u16→u32)
373 let decoded = VShardEnvelope::from_bytes(&bytes).unwrap();
374 assert!(decoded.payload.is_empty());
375 }
376
377 #[test]
378 fn unknown_message_type_returns_none() {

Callers

nothing calls this directly

Calls 1

to_bytesMethod · 0.45

Tested by

no test coverage detected