-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fork fix burning module permissions
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app | ||
|
||
import ( | ||
v4 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_1" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// BeginBlockForks executes any necessary fork logic based upon the current block height. | ||
func BeginBlockForks(ctx sdk.Context, app *MigalooApp) { | ||
if ctx.BlockHeight() == v4.UpgradeHeight { | ||
v4.UpdateAccountPermissionAndFeeBurnPercent(ctx, app.FeeBurnKeeper, app.AccountKeeper) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package v4 | ||
|
||
const ( | ||
UpgradeHeight = 226753 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v4 | ||
|
||
import ( | ||
feeburnkeeper "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/x/feeburn/keeper" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" | ||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
) | ||
|
||
func UpdateAccountPermissionAndFeeBurnPercent(ctx sdk.Context, fk feeburnkeeper.Keeper, ak authkeeper.AccountKeeper) { | ||
// Burning module permissions | ||
moduleAccI := ak.GetModuleAccount(ctx, authtypes.FeeCollectorName) | ||
moduleAcc := moduleAccI.(*authtypes.ModuleAccount) | ||
moduleAcc.Permissions = []string{authtypes.Burner} | ||
ak.SetModuleAccount(ctx, moduleAcc) | ||
|
||
// set default fee_burn_percent to 10 | ||
feeBurnParams := fk.GetParams(ctx) | ||
feeBurnParams.TxFeeBurnPercent = "10" | ||
|
||
_ = fk.SetParams(ctx, feeBurnParams) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters