Overview
Storage key layouts can change silently between contract versions, breaking data migrations. Add a snapshot test that locks the serialized XDR of every storage key so any accidental layout change fails CI.
Acceptance Criteria
- Snapshot test serializes every
StorageKey variant to XDR hex and compares against a committed baseline
- Baseline file:
tests/snapshots/storage_keys.json — committed to the repo
- Test fails if any key's XDR diverges from the baseline
- Intentional changes: developer updates baseline file explicitly and includes a migration note in the PR
- Test also asserts that no two
StorageKey variants produce the same XDR (no collision)
- Snapshot file includes a version comment listing when each key was introduced
- CI step
cargo test storage_snapshot runs on every PR
- README section "Storage Key Registry" explains the snapshot policy
Overview
Storage key layouts can change silently between contract versions, breaking data migrations. Add a snapshot test that locks the serialized XDR of every storage key so any accidental layout change fails CI.
Acceptance Criteria
StorageKeyvariant to XDR hex and compares against a committed baselinetests/snapshots/storage_keys.json— committed to the repoStorageKeyvariants produce the same XDR (no collision)cargo test storage_snapshotruns on every PR