Skip to content

Commit

Permalink
fix: upgrade handler (#352)
Browse files Browse the repository at this point in the history
* refactor upgrade handler

* add changelog
  • Loading branch information
ajansari95 authored Mar 15, 2023
1 parent dbba118 commit ce53635
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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

0 comments on commit ce53635

Please sign in to comment.