| 467 | |
| 468 | #[test] |
| 469 | fn test_negotiation_json_roundtrip() { |
| 470 | let manifest = ChunkManifest::new(vec![ |
| 471 | ChunkManifestEntry::new(0, [0xAA; 32], 100, 200), |
| 472 | ChunkManifestEntry::new(1, [0xBB; 32], 300, 400), |
| 473 | ]); |
| 474 | |
| 475 | let result = ChunkNegotiation::compute(&manifest, &[[0xAA; 32]]); |
| 476 | let json = serde_json::to_string(&result).unwrap(); |
| 477 | let decoded: ChunkNegotiation = serde_json::from_str(&json).unwrap(); |
| 478 | assert_eq!(result, decoded); |
| 479 | } |
| 480 | |
| 481 | // ── StreamingPushOptions ─────────────────────────────────────── |
| 482 | |