confio / poe-contracts

Tgrade PoE smart contracts
Apache License 2.0
25 stars 8 forks source link

Older version migration helper #164

Closed maurolacy closed 2 years ago

maurolacy commented 2 years ago

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 commented 2 years ago

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.