Skip to content

Commit

Permalink
Merge pull request #177 from terra-money/fix/uninit-builder-module-acc
Browse files Browse the repository at this point in the history
fix: init builder module account during upgrade
  • Loading branch information
tuky191 committed Oct 9, 2023
2 parents 2f53867 + 4217102 commit 64783d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ ignore:
- "**/*.pb.gw.go"
- "**/test_utils.go"
- "**/module.go"
- "**/test_helpers.go"
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ func (app *TerraApp) RegisterUpgradeHandlers(cfg module.Configurator) {
app.ConsensusParamsKeeper,
app.ICAControllerKeeper,
app.BuilderKeeper,
app.AccountKeeper,
),
)
}
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades/v2.5/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package v2_5

import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
pobkeeper "github.com/skip-mev/pob/x/builder/keeper"
pobtypes "github.com/skip-mev/pob/x/builder/types"
"time"
Expand Down Expand Up @@ -31,6 +32,7 @@ func CreateUpgradeHandler(
consensusParamsKeeper consensuskeeper.Keeper,
icacontrollerKeeper icacontrollerkeeper.Keeper,
pobKeeper pobkeeper.Keeper,
authKeeper authkeeper.AccountKeeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// READ: https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/UPGRADING.md#xconsensus
Expand Down Expand Up @@ -60,6 +62,9 @@ func CreateUpgradeHandler(
return nil, err
}

// Create POB module account
_ = authKeeper.GetModuleAccount(ctx, pobtypes.ModuleName)

// Setting pob params to disable by default until a proposal is passed to enable it
err = pobKeeper.SetParams(ctx, pobtypes.Params{
MaxBundleSize: 0,
Expand Down

0 comments on commit 64783d3

Please sign in to comment.