-
Notifications
You must be signed in to change notification settings - Fork 838
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
chore(upgrade): improve v14 migration tests and utilities #1834
chore(upgrade): improve v14 migration tests and utilities #1834
Conversation
ENG-2132 Cover mainnet state in migration unit tests
ContextOne major problem (and now learning) was that the unit tests for the migration function did not fully replicate the mainnet state for the affected accounts. The big takeaway here is, that whenever something is targeting mainnet data, the unit tests should precisely model the way this data is stored on-chain and then do testing from there. ExpectedImprove the unit tests by replicating the state of the affected accounts at upgrade height. ENG-2128 Improve Migration functions to not return on first error
When encountering an error during the migration of multisigs in the v14 release, the corresponding functions immediately return an error and abort the rest of the operations. ExpectedThis should not return immediately but rather collect the errors and then return a joint error message afterwards. |
Codecov Report
@@ Coverage Diff @@
## release/v14.0.x #1834 +/- ##
===================================================
- Coverage 70.50% 70.49% -0.02%
===================================================
Files 313 313
Lines 23282 23302 +20
===================================================
+ Hits 16415 16426 +11
- Misses 6044 6052 +8
- Partials 823 824 +1
|
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.
LGTM! Great work @MalteHerrmann!!
Please address the lint issues and conflicts
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.
LGTM also, great job @MalteHerrmann !
@Mergifyio backport release/v14.2.x |
✅ Backports have been created
|
* commit WIP for migration tests * commit WIP for creating zero token delegations * finish mainnet state replication for tests * add safety checks to migrations logic for bond denom and zero unbonding amount * remove unnecessary pre-migration delegations entry * fix amount of by using NewCoins to create coins structs * log errors instead of aborting migration runs * adjust changelog * address linters (cherry picked from commit 695d91a)
…1834) (#1837) chore(upgrade): improve v14 migration tests and utilities (#1834) * commit WIP for migration tests * commit WIP for creating zero token delegations * finish mainnet state replication for tests * add safety checks to migrations logic for bond denom and zero unbonding amount * remove unnecessary pre-migration delegations entry * fix amount of by using NewCoins to create coins structs * log errors instead of aborting migration runs * adjust changelog * address linters (cherry picked from commit 695d91a) Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
@Mergifyio backport main |
✅ Backports have been created
|
* commit WIP for migration tests * commit WIP for creating zero token delegations * finish mainnet state replication for tests * add safety checks to migrations logic for bond denom and zero unbonding amount * remove unnecessary pre-migration delegations entry * fix amount of by using NewCoins to create coins structs * log errors instead of aborting migration runs * adjust changelog * address linters (cherry picked from commit 695d91a) # Conflicts: # CHANGELOG.md # app/upgrades/v14/migrations.go # app/upgrades/v14/migrations_test.go
…1834) (#1855) * chore(upgrade): improve v14 migration tests and utilities (#1834) * commit WIP for migration tests * commit WIP for creating zero token delegations * finish mainnet state replication for tests * add safety checks to migrations logic for bond denom and zero unbonding amount * remove unnecessary pre-migration delegations entry * fix amount of by using NewCoins to create coins structs * log errors instead of aborting migration runs * adjust changelog * address linters (cherry picked from commit 695d91a) # Conflicts: # CHANGELOG.md # app/upgrades/v14/migrations.go # app/upgrades/v14/migrations_test.go * fix merge conflicts --------- Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com> Co-authored-by: MalteHerrmann <malte@evmos.org>
Description
This PR extends the migration unit tests for the v14 upgrade by replicating the mainnet state as close as possible. Even though the v14.0.0 upgrade has already been concluded, these tests will help prepare the v14.1.0 release and have led to improvements in the migration functions.
Closes ENG-2132 and ENG-2128