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

fix: upgrade handler #352

Merged
merged 2 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Released

### v1.2.7
- fix upgrade handler

### v1.2.6
- fix release height

Expand Down
6 changes: 3 additions & 3 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const (
DevnetChainID = "quicktest-1"

v010204UpgradeName = "v1.2.4"
v010205UpgradeName = "v1.2.5"
v010207UpgradeName = "v1.2.7"
v010300UpgradeName = "v1.3.0" // retained for testy
)

func setUpgradeHandlers(app *Quicksilver) {
app.UpgradeKeeper.SetUpgradeHandler(v010300UpgradeName, noOpUpgradeHandler(app)) // retained for testy
app.UpgradeKeeper.SetUpgradeHandler(v010204UpgradeName, v010204UpgradeHandler(app))
app.UpgradeKeeper.SetUpgradeHandler(v010205UpgradeName, v010205UpgradeHandler(app))
app.UpgradeKeeper.SetUpgradeHandler(v010207UpgradeName, v010207UpgradeHandler(app))

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
Expand Down Expand Up @@ -83,7 +83,7 @@ func v010204UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler {
}
}

func v010205UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler {
func v010207UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// update minter epoch-provisions
minter := app.MintKeeper.GetMinter(ctx)
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ func (suite *AppTestSuite) initTestZone() {
}
}

func (s *AppTestSuite) TestV010205UpgradeHandler() {
func (s *AppTestSuite) TestV010207UpgradeHandler() {
app := s.GetQuicksilverApp(s.chainA)
handler := v010205UpgradeHandler(app)
handler := v010207UpgradeHandler(app)
ctx := s.chainA.GetContext()

expectedVal := sdk.NewDec(50_000_000_000_000).Quo(sdk.NewDec(365))
Expand Down