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: init builder module account during upgrade #177

Merged
merged 2 commits into from
Oct 9, 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
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
Loading