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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

serialize_view_stateFunction · 0.85
deserialize_view_stateFunction · 0.85

Tested by

no test coverage detected