Skip to content

Commit

Permalink
fix: miss burning module permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Jan 29, 2024
1 parent 3b27ad1 commit e664b69
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ func (app *MigalooApp) setupUpgradeHandlers() {
app.ParamsKeeper,
app.ConsensusParamsKeeper,
app.ICAControllerKeeper,
app.AccountKeeper,
),
)

Expand All @@ -1173,6 +1174,7 @@ func (app *MigalooApp) setupUpgradeHandlers() {
crisistypes.StoreKey,
icqtypes.StoreKey,
feeburnmoduletypes.StoreKey,
authtypes.FeeCollectorName,
},
Deleted: []string{
"intertx",
Expand Down
10 changes: 10 additions & 0 deletions app/upgrades/v4_1_0/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand All @@ -22,6 +24,8 @@ func CreateUpgradeHandler(
paramsKeeper paramskeeper.Keeper,
consensusParamsKeeper consensuskeeper.Keeper,
icacontrollerKeeper icacontrollerkeeper.Keeper,
accountKeeper authkeeper.AccountKeeper,

Check failure on line 28 in app/upgrades/v4_1_0/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// READ: https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/UPGRADING.md#xconsensus
Expand All @@ -37,6 +41,12 @@ func CreateUpgradeHandler(
// READ: https://github.com/terra-money/core/issues/166
icacontrollerKeeper.SetParams(ctx, icacontrollertypes.DefaultParams())

// Burning module permissions
moduleAccI := accountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName)
moduleAcc := moduleAccI.(*authtypes.ModuleAccount)
moduleAcc.Permissions = []string{authtypes.Burner}
accountKeeper.SetModuleAccount(ctx, moduleAcc)

return mm.RunMigrations(ctx, configurator, fromVM)
}
}
Empty file removed cmd/migalood/__debug_bin4214072066
Empty file.
3 changes: 3 additions & 0 deletions scripts/run-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"'
$SED_BINARY -i '0,/enable = false/s//enable = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/swagger = false/swagger = true/' $HOME_DIR/config/app.toml
$SED_BINARY -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' $HOME_DIR/config/app.toml
$SED_BINARY -i 's/minimum-gas-prices = "0.25uwhale"/minimum-gas-prices = "0.0uwhale"/' $HOME_DIR/config/app.toml


# Sign genesis transaction
Expand All @@ -81,3 +82,5 @@ $BINARY collect-gentxs --home $HOME_DIR

# Run this to ensure everything worked and that the genesis file is setup correctly
$BINARY validate-genesis --home $HOME_DIR
# $BINARY start --home $HOME_DIR

0 comments on commit e664b69

Please sign in to comment.