Skip to content

Commit

Permalink
add evmutil permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
DracoLi committed Sep 30, 2022
1 parent 1a15bba commit 06a5fd3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@ package app
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
evmutiltypes "github.com/kava-labs/kava/x/evmutil/types"
)

const UpgradeName = "v0.19.1-testnet"
const UpgradeName = "v0.19.2-testnet"

func (app App) RegisterUpgradeHandlers() {
app.upgradeKeeper.SetUpgradeHandler(UpgradeName,
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

// add minter and burner permissions to evmutil
evmutilAcc := app.accountKeeper.GetModuleAccount(ctx, evmutiltypes.ModuleName).(*authtypes.ModuleAccount)
evmutilAcc.Permissions = []string{
authtypes.Minter, authtypes.Burner,
}
app.accountKeeper.SetModuleAccount(ctx, evmutilAcc)

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
Expand Down

0 comments on commit 06a5fd3

Please sign in to comment.