From e664b693a98b99c753cdec381e8864c9e4983123 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Mon, 29 Jan 2024 16:33:24 +0700 Subject: [PATCH] fix: miss burning module permissions --- app/app.go | 2 ++ app/upgrades/v4_1_0/upgrades.go | 10 ++++++++++ cmd/migalood/__debug_bin4214072066 | 0 scripts/run-node.sh | 3 +++ 4 files changed, 15 insertions(+) delete mode 100644 cmd/migalood/__debug_bin4214072066 diff --git a/app/app.go b/app/app.go index 64e013f7..21a36269 100644 --- a/app/app.go +++ b/app/app.go @@ -1148,6 +1148,7 @@ func (app *MigalooApp) setupUpgradeHandlers() { app.ParamsKeeper, app.ConsensusParamsKeeper, app.ICAControllerKeeper, + app.AccountKeeper, ), ) @@ -1173,6 +1174,7 @@ func (app *MigalooApp) setupUpgradeHandlers() { crisistypes.StoreKey, icqtypes.StoreKey, feeburnmoduletypes.StoreKey, + authtypes.FeeCollectorName, }, Deleted: []string{ "intertx", diff --git a/app/upgrades/v4_1_0/upgrades.go b/app/upgrades/v4_1_0/upgrades.go index ea8585ba..9dfc72a6 100644 --- a/app/upgrades/v4_1_0/upgrades.go +++ b/app/upgrades/v4_1_0/upgrades.go @@ -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" @@ -22,6 +24,8 @@ func CreateUpgradeHandler( paramsKeeper paramskeeper.Keeper, consensusParamsKeeper consensuskeeper.Keeper, icacontrollerKeeper icacontrollerkeeper.Keeper, + accountKeeper authkeeper.AccountKeeper, + ) 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 @@ -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) } } diff --git a/cmd/migalood/__debug_bin4214072066 b/cmd/migalood/__debug_bin4214072066 deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/run-node.sh b/scripts/run-node.sh index 484c5d58..227395cf 100755 --- a/scripts/run-node.sh +++ b/scripts/run-node.sh @@ -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 @@ -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 +