Skip to content

Commit

Permalink
remove unused upgrade code for bombay-11 (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
yys authored Oct 3, 2021
1 parent 889723a commit f3a1b82
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import (
customauth "github.com/terra-money/core/custom/auth"
customante "github.com/terra-money/core/custom/auth/ante"
customauthrest "github.com/terra-money/core/custom/auth/client/rest"
customlegacyauthv040 "github.com/terra-money/core/custom/auth/legacy/v040"
customauthsim "github.com/terra-money/core/custom/auth/simulation"
customauthtx "github.com/terra-money/core/custom/auth/tx"
customauthz "github.com/terra-money/core/custom/authz"
Expand Down Expand Up @@ -582,37 +581,8 @@ func NewTerraApp(
// Name returns the name of the App
func (app *TerraApp) Name() string { return app.BaseApp.Name() }

// MultiSigPubKeyMigrationPlanName upgrade plan name to fix multisig pubkey migration problem
const MultiSigPubKeyMigrationPlanName = "multisig-pubkey-migration"

// MultiSigPubKeyMigrationChainID target chain-id to apply multisig pubkey migration fix
const MultiSigPubKeyMigrationChainID = "bombay-11"

// BeginBlocker application updates every begin block
func (app *TerraApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {

// NOTE: this handler is only for bombay-11, due to pubkey migration had problem
if ctx.ChainID() == MultiSigPubKeyMigrationChainID {
if plan, found := app.UpgradeKeeper.GetUpgradePlan(ctx); found {
if plan.Name == MultiSigPubKeyMigrationPlanName && plan.Height == ctx.BlockHeight() {
app.UpgradeKeeper.SetUpgradeHandler(MultiSigPubKeyMigrationPlanName, func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
var err error
app.AccountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) bool {
if account, err = customlegacyauthv040.MigrateAccount(account); err != nil {
return true
} else if account != nil {
app.AccountKeeper.SetAccount(ctx, account)
}

return false
})

return vm, err
})
}
}
}

return app.mm.BeginBlock(ctx, req)
}

Expand Down

0 comments on commit f3a1b82

Please sign in to comment.