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

v0.17 upgrade logic #112

Merged
merged 2 commits into from
Apr 3, 2023
Merged

v0.17 upgrade logic #112

merged 2 commits into from
Apr 3, 2023

Conversation

larry0x
Copy link
Collaborator

@larry0x larry0x commented Feb 28, 2023

  • Rename upgrades/v0_16.rs to upgrades/v0_17.rs (I think the filename should be the version being migrated to, not the version being migrated from)
  • Version check to make sure that correct contract is being migrated and it's being migrated from the correct version (using cw2::assert_contract_version; have to use our fork of cw2 before our PR is merged)

Copy link
Collaborator

@JakeHartnell JakeHartnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JakeHartnell JakeHartnell requested review from yubrew and Art3miX March 4, 2023 21:03
Copy link
Collaborator

@0xekez 0xekez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement. Thanks!

@0xekez
Copy link
Collaborator

0xekez commented Mar 29, 2023

@larry0x sorry for being so slow to review. should be able to rebase on main and merge this.

Copy link
Collaborator

@Art3miX Art3miX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good.

Just little comment about the cw2 library, I think version assertion is something custom to each contract (why cw2 didn't create a function for it?), would defo suggest just copy paste it as a helper.

Comment on lines +16 to +18
# FIXME: change back to the "official" crates.io release after this PR is merged:
# https://github.com/CosmWasm/cw-plus/pull/858
cw2 = { git = "https://github.com/mars-protocol/cw-plus", rev = "1a3a944" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be an overkill just to get the assert_contract_version helper: https://github.com/CosmWasm/cw-plus/pull/858/files#diff-a35715fa1fde56c42db0d8f2845ebc6a571a801699c0705f0080237820d96ee6R59-R83

Would suggest just to just put it in this contract until we have an "official" version of it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Art3miX My PR to cw2 referenced in the comment has been merged. Now we can use the main branch of cw2 instead of mars-protocol fork. Imo this is more elegant than including extra code in this repo which we need to remove later.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, so this can be changed to the official cw2 now?

I just didn't like the using some fork for a helper function just to revert back later to the previous package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change it to the main branch (use the latest commit) of the official cw-plus repo

@JakeHartnell JakeHartnell merged commit 5179de0 into main Apr 3, 2023
@JakeHartnell JakeHartnell deleted the v0.17-upgrade branch April 3, 2023 16:24
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.

5 participants