Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Jan 19, 2024
1 parent c042795 commit 32caa34
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ func (app *App) registerNagquUpgradeHandler() {
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Nagqu,
func() error {
app.Logger().Info("Init Nagqu upgrade")
app.setPaymentConsensusV2()
app.setPaymentConsensusVersion(2)
return nil
})
}

func (app *App) setPaymentConsensusV2() {
func (app *App) setPaymentConsensusVersion(version uint64) {
mm, ok := app.mm.Modules[paymenttypes.ModuleName].(*paymentmodule.AppModule)
if !ok {
panic("*paymentmodule.AppModule not found")
}
mm.SetConsensusVersion(2)
mm.SetConsensusVersion(version)
}

func (app *App) registerPampasUpgradeHandler() {
Expand Down Expand Up @@ -109,7 +109,7 @@ func (app *App) registerPampasUpgradeHandler() {
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Pampas,
func() error {
app.Logger().Info("Init Pampas upgrade")
app.setPaymentConsensusV2()
app.setPaymentConsensusVersion(2)
// enable chain id for opbnb
app.CrossChainKeeper.SetDestOpChainID(sdk.ChainID(app.appConfig.CrossChain.DestOpChainId))
return nil
Expand All @@ -133,7 +133,7 @@ func (app *App) registerManchurianUpgradeHandler() {
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Manchurian,
func() error {
app.Logger().Info("Init Manchurian upgrade")
app.setPaymentConsensusV2()
app.setPaymentConsensusVersion(2)
return nil
})
}
Expand All @@ -159,18 +159,18 @@ func (app *App) registerHulunbeierUpgradeHandler() {
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Hulunbeier,
func() error {
app.Logger().Info("Init Hulunbeier upgrade")
app.setPaymentConsensusV2()
app.setVirtualGroupConsensusV2()
app.setPaymentConsensusVersion(2)
app.setVirtualGroupConsensusVersion(2)
return nil
})
}

func (app *App) setVirtualGroupConsensusV2() {
func (app *App) setVirtualGroupConsensusVersion(version uint64) {
mm, ok := app.mm.Modules[virtualgrouptypes.ModuleName].(*virtualgroupmodule.AppModule)
if !ok {
panic("*virtualgroupmodule.AppModule not found")
}
mm.SetConsensusVersion(2)
mm.SetConsensusVersion(version)
}

func (app *App) registerHulunbeierPatchUpgradeHandler() {
Expand All @@ -187,8 +187,8 @@ func (app *App) registerHulunbeierPatchUpgradeHandler() {
app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.HulunbeierPatch,
func() error {
app.Logger().Info("Init Hulunbeier patch upgrade")
app.setPaymentConsensusV2()
app.setVirtualGroupConsensusV2()
app.setPaymentConsensusVersion(2)
app.setVirtualGroupConsensusVersion(2)
return nil
})
}

0 comments on commit 32caa34

Please sign in to comment.