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

Remove expired vesting periods from accounts in migrations #1113

Merged
merged 14 commits into from
Jan 6, 2022

Conversation

drklee3
Copy link
Member

@drklee3 drklee3 commented Dec 21, 2021

ResetPeriodicVestingAccount function copied from v15 migration.

Testing

Updates the tests to use a fixed test genesis time to allow for the actual migration genesis time to be changed without breaking tests.

Test data json file changes:

  • The existing periodic vesting account with expired periods is migrated to a base account in v16.
  • Adds another periodic vesting account with 2 vesting periods, one which is expired and one pending. The resulting migrated account only has 1 period and the start time updated.

@@ -13,8 +13,8 @@ import (
)

var (
GenesisTime = time.Date(2021, 11, 30, 15, 0, 0, 0, time.UTC)
ChainID = "kava-8"
GenesisTime = time.Date(2022, 1, 19, 16, 0, 0, 0, time.UTC)
Copy link
Member

Choose a reason for hiding this comment

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

Genesis time is updated to launch date

GenesisTime = time.Date(2021, 11, 30, 15, 0, 0, 0, time.UTC)
ChainID = "kava-8"
GenesisTime = time.Date(2022, 1, 19, 16, 0, 0, 0, time.UTC)
ChainID = "kava-9"
Copy link
Member

Choose a reason for hiding this comment

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

Chain id is updated to kava-9

@@ -43,3 +56,115 @@ func TestMigrateFull(t *testing.T) {
tApp.InitializeFromGenesisStatesWithTimeAndChainID(newGenDoc.GenesisTime, newGenDoc.ChainID, app.GenesisState(appMap))
})
}

func TestAccountBalances(t *testing.T) {
t.Skip() // avoid committing test data
Copy link
Member

Choose a reason for hiding this comment

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

Skipped in integration, passing locally against exported state of block 1627000

@@ -0,0 +1,485 @@
package legacyaccounts
Copy link
Member

Choose a reason for hiding this comment

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

This is used in the migrate test instead of the legacy types from the cosmos-sdk. The cosmos-sdk types do not implement Spendable, etc methods.

@nddeluca
Copy link
Member

nddeluca commented Jan 6, 2022

Added an e2e test and account migration looks good

@nddeluca nddeluca merged commit ca6318d into upgrade-v44 Jan 6, 2022
@nddeluca nddeluca deleted the dl-migrate-accounts-cleanup-vesting branch January 6, 2022 02:07
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