-
Notifications
You must be signed in to change notification settings - Fork 2
Migration-2.4.1 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration-2.4.1 #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub fn migrate(deps: DepsMut) -> Result<Response, ContractError> { | ||
| // make sure we're migrating the correct contract and from the correct version | ||
| assert_contract_version(deps.storage, &format!("crates.io:{CONTRACT_NAME}"), FROM_VERSION)?; | ||
|
|
||
| set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; | ||
| set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), TO_VERSION)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set migration version to deployed code level
The v2_2_0→v2_3_0 migration writes the cw2 contract version to the hard-coded TO_VERSION "2.3.0" while the package/CONTRACT_VERSION has been bumped to 2.3.1. Migrating a 2.2.0 deployment with this new binary will therefore leave state reporting 2.3.0, and any later migration that asserts from 2.3.1 will fail for those contracts. The migration should record the current code version (2.3.1) or perform the full 2.2.0→2.3.1 step in one call.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codex getting confused haha
| pub fn migrate(deps: DepsMut) -> Result<Response, ContractError> { | ||
| // make sure we're migrating the correct contract and from the correct version | ||
| assert_contract_version(deps.storage, &format!("crates.io:{CONTRACT_NAME}"), FROM_VERSION)?; | ||
|
|
||
| set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; | ||
| set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), TO_VERSION)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codex getting confused haha
* add reward collector fee events in CM and RB * update tests * add CM , RB migration (#46)
No description provided.