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

Function log_entry_serde_roundtrip

nodedb-raft/src/message.rs:188–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186
187 #[test]
188 fn log_entry_serde_roundtrip() {
189 let entry = LogEntry {
190 term: 5,
191 index: 42,
192 data: b"put key=val".to_vec(),
193 };
194 let json = sonic_rs::to_string(&entry).unwrap();
195 let decoded: LogEntry = sonic_rs::from_str(&json).unwrap();
196 assert_eq!(entry, decoded);
197 }
198
199 #[test]
200 fn append_entries_heartbeat() {

Callers

nothing calls this directly

Calls 1

to_vecMethod · 0.45

Tested by

no test coverage detected