()
| 469 | |
| 470 | #[test] |
| 471 | fn test_view_state_invalid_kind() { |
| 472 | // Build valid v2 bytes but with an invalid kind byte |
| 473 | let mut bytes = Vec::new(); |
| 474 | bytes.extend_from_slice(&1u64.to_le_bytes()); // id |
| 475 | let name = "test"; |
| 476 | bytes.extend_from_slice(&(name.len() as u32).to_le_bytes()); |
| 477 | bytes.extend_from_slice(name.as_bytes()); |
| 478 | bytes.extend_from_slice(&[0u8; 32]); // merkle |
| 479 | bytes.extend_from_slice(&0u64.to_le_bytes()); // change_count |
| 480 | bytes.push(99); // invalid kind |
| 481 | bytes.extend_from_slice(&u64::MAX.to_le_bytes()); // parent (none) |
| 482 | |
| 483 | let result = deserialize_view_state(&bytes); |
| 484 | assert!(result.is_err()); |
| 485 | } |
| 486 | |
| 487 | #[test] |
| 488 | fn try_collect_rejects_partial_success() { |
nothing calls this directly
no test coverage detected