Skip to content
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

Migrate example #511

Closed
ethanfrey opened this issue Oct 26, 2021 · 2 comments · Fixed by #525
Closed

Migrate example #511

ethanfrey opened this issue Oct 26, 2021 · 2 comments · Fixed by #525
Assignees

Comments

@ethanfrey
Copy link
Member

Builds on #510

I think we no longer have valid migrate implementations in cw-plus, which makes it hard to explain. We should at least provide a stub to serve as documentation and a guide.

My idea was to allow cw-plus to upgrade from, say, v0.8.0 or newer to the current version (but must be <= current version). This migrate should be a no-op, but will allow someone to swap out the code ids to use newer functionality.

Make use of the Semver type from #510 to check for version requirements.

This is mainly meant for example/documentation purposes, go heavy on the comments.

@ethanfrey
Copy link
Member Author

ethanfrey commented Oct 26, 2021

I think hack atom contract in cosmwasm uses migrate

https://github.com/CosmWasm/cosmwasm/blob/main/contracts/hackatom/src/contract.rs#L37-L48

@ethanfrey
Copy link
Member Author

Check that cw2 info.name is the same as current contract.

Check that cw2 info.version is >= "0.8.0" && <= CURRENT VERSION (from env!)

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 a pull request may close this issue.

2 participants