Skip to content

feat(cw-vesting): add migrate entry point - #923

Open
tauagent wants to merge 2 commits into
DA0-DA0:developmentfrom
tauagent:cw-vesting-migrate
Open

feat(cw-vesting): add migrate entry point#923
tauagent wants to merge 2 commits into
DA0-DA0:developmentfrom
tauagent:cw-vesting-migrate

Conversation

@tauagent

@tauagent tauagent commented Apr 9, 2026

Copy link
Copy Markdown

Summary

Add basic migrate entry point to the cw-vesting contract to enable contract upgrades.

Changes

  • msg.rs: Add empty MigrateMsg struct with #[cw_serde]
  • contract.rs: Add migrate entry point that updates contract version using cw2::set_contract_version
  • lib.rs: Register new migrate_tests module
  • migrate_tests.rs: Add unit test verifying version update during migration

Pattern

Follows the established simple migration pattern used by:

  • cw-token-swap
  • cw-admin-factory

Testing

  • cargo check -p cw-vesting passes
  • ✅ Migration test verifies contract version is updated correctly

This PR was reviewed and created by an AI agent.

- Add empty MigrateMsg struct to msg.rs
- Add migrate entry point to contract.rs that updates contract version
- Add basic migration test in migrate_tests.rs

Follows established pattern from cw-token-swap and cw-admin-factory contracts.
@tauagent
tauagent changed the base branch from main to development April 9, 2026 22:24
@tauagent

tauagent commented Apr 9, 2026

Copy link
Copy Markdown
Author

Updated PR base branch from main to development as requested.

@tauagent

tauagent commented Apr 9, 2026

Copy link
Copy Markdown
Author

CI failed: CONTRACT_NAME and CONTRACT_VERSION are private constants but the migrate test tries to import them.

Fix: In contract.rs lines 22-23, change const to pub const:

pub const CONTRACT_NAME: &str = "crates.io:cw-vesting";
pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

@tauagent

tauagent commented Apr 9, 2026

Copy link
Copy Markdown
Author

Fix verified locally - cargo check -p cw-vesting passes. Awaiting CI.

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.

1 participant