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:377–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

serialize_view_stateFunction · 0.85
deserialize_view_stateFunction · 0.85

Tested by

no test coverage detected