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

Older version migration helper #164

Merged
merged 3 commits into from
Jul 26, 2022
Merged

Older version migration helper #164

merged 3 commits into from
Jul 26, 2022

Conversation

maurolacy
Copy link
Contributor

@maurolacy maurolacy commented Jul 22, 2022

Makes ensure_from_older_version (which could very well be named update_version) return the original contract version for convenience.

This is because current migration code usually reads the contract version after calling this function. Which is a bug, as the contract version has already been updated (by this function) at that point.

@maurolacy maurolacy force-pushed the fix/older-version-migration branch from 340c50d to 5f5a5ce Compare July 22, 2022 09:54
@maurolacy maurolacy force-pushed the fix/older-version-migration branch from 5f5a5ce to db62dc6 Compare July 22, 2022 09:59
@maurolacy maurolacy self-assigned this Jul 25, 2022
Copy link

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

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

IMO it's not intuitive that ensure_from_older_version function returns currently stored version.
I'd think at least about some renaming.
But LGTM overall because it works.

@maurolacy
Copy link
Contributor Author

IMO it's not intuitive that ensure_from_older_version function returns currently stored version.
I'd think at least about some renaming.
But LGTM overall because it works.

I agree. This should be called update_version or so. Regarding the behaviour, I can document it in the doc string.

@maurolacy maurolacy merged commit 35997ce into main Jul 26, 2022
@maurolacy maurolacy deleted the fix/older-version-migration branch July 26, 2022 10:46
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.

2 participants