Skip to content

Feat/migration tests#459

Merged
Xhristin3 merged 2 commits intorinafcode:mainfrom
Faromzy:feat/migration-tests
Apr 28, 2026
Merged

Feat/migration tests#459
Xhristin3 merged 2 commits intorinafcode:mainfrom
Faromzy:feat/migration-tests

Conversation

@Faromzy
Copy link
Copy Markdown
Contributor

@Faromzy Faromzy commented Apr 27, 2026

Add migration tests

Adds tests/test_migration.rs with four tests covering the contract
upgrade/migration lifecycle:

  • Data migration — verifies state (version counter + history record) is
    preserved after an upgrade cycle
  • Schema updates — confirms the migration hash and upgrader address are
    recorded in the upgrade history entry
  • Rollback — asserts the version reverts to the original and the rollback flag
    clears after rollback_upgrade
  • Data integrity — ensures rollback_upgrade is rejected when no backup exists
    (no prior prepare_upgrade)

Also registers the new [[test]] target in contracts/teachlink/Cargo.toml.

Testing:

cargo test --test test_migration
closes #345

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@Faromzy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Xhristin3 Xhristin3 merged commit 4567a78 into rinafcode:main Apr 28, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comprehensive migration tests

2 participants