Skip to content

Add contract storage layout snapshot test to detect breaking migrations #331

Description

@Kingsman-99

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptstestingTests — unit, integration, fuzz

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions