MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_view_state_truncated

Function test_view_state_truncated

atomic-core/src/pristine/txn/helpers.rs:453–468  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451
452 #[test]
453 fn test_view_state_truncated() {
454 let state = ViewState {
455 id: 1,
456 name: "test".to_string(),
457 state: Merkle::ZERO,
458 change_count: 0,
459 kind: ViewScope::Shared,
460 parent: None,
461 };
462
463 let bytes = serialize_view_state(&state);
464 // Cut into the v1 portion (not just the v2 extension)
465 let truncated = &bytes[..12];
466 let result = deserialize_view_state(truncated);
467 assert!(result.is_err());
468 }
469
470 #[test]
471 fn test_view_state_invalid_kind() {

Callers

nothing calls this directly

Calls 2

serialize_view_stateFunction · 0.85
deserialize_view_stateFunction · 0.85

Tested by

no test coverage detected