()
| 356 | |
| 357 | #[test] |
| 358 | fn test_view_state_truncated() { |
| 359 | let state = ViewState { |
| 360 | id: 1, |
| 361 | name: "test".to_string(), |
| 362 | state: Merkle::ZERO, |
| 363 | change_count: 0, |
| 364 | kind: ViewScope::Shared, |
| 365 | parent: None, |
| 366 | }; |
| 367 | |
| 368 | let bytes = serialize_view_state(&state); |
| 369 | // Cut into the v1 portion (not just the v2 extension) |
| 370 | let truncated = &bytes[..12]; |
| 371 | let result = deserialize_view_state(truncated); |
| 372 | assert!(result.is_err()); |
| 373 | } |
| 374 | |
| 375 | #[test] |
| 376 | fn test_view_state_invalid_kind() { |
nothing calls this directly
no test coverage detected