()
| 375 | |
| 376 | #[test] |
| 377 | fn test_view_state_truncated() { |
| 378 | let state = ViewState { |
| 379 | id: 1, |
| 380 | name: "test".to_string(), |
| 381 | state: Merkle::ZERO, |
| 382 | change_count: 0, |
| 383 | kind: ViewScope::Shared, |
| 384 | parent: None, |
| 385 | }; |
| 386 | |
| 387 | let bytes = serialize_view_state(&state); |
| 388 | // Cut into the v1 portion (not just the v2 extension) |
| 389 | let truncated = &bytes[..12]; |
| 390 | let result = deserialize_view_state(truncated); |
| 391 | assert!(result.is_err()); |
| 392 | } |
| 393 | |
| 394 | #[test] |
| 395 | fn test_view_state_invalid_kind() { |
nothing calls this directly
no test coverage detected