Skip to content

core: add contract storage migration utilities #24

@EmeditWeb

Description

@EmeditWeb

Problem

When contracts are upgraded, new storage fields are
incompatible with existing stored data. There is no
migration system.

What To Build

  1. Add schema_version to each contract
  2. Add migrate() function to each contract
  3. Call migrate() automatically in upgrade()

Files To Touch

  • contracts/creditline-contract/src/lib.rs
  • contracts/creditline-contract/src/storage.rs
  • All contract lib.rs files

Acceptance Criteria

  • schema_version stored in all contracts
  • migrate() runs on upgrade
  • Existing data preserved through migration
  • Migration history prevents double-run

Mandatory Checks Before PR

  • cargo build passes
  • All tests pass
  • PR references this issue

Metadata

Metadata

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