Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
chore(cleanup): Remove authority from evmkeeper (unused) (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear authored Jul 28, 2023
1 parent ed4dcbf commit a1a8159
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 119 deletions.
118 changes: 21 additions & 97 deletions cosmos/api/polaris/evm/module/v1alpha1/module.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions cosmos/proto/polaris/evm/module/v1alpha1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ import "cosmos/app/v1alpha1/module.proto";
// Module is the config object of the evm module.
message Module {
option (cosmos.app.v1alpha1.module) = {go_import: "pkg.berachain.dev/polaris/cosmos/x/evm"};

// authority defines the custom module authority. If not set, defaults to the governance module.
string authority = 1;
}
14 changes: 4 additions & 10 deletions cosmos/x/evm/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
store "cosmossdk.io/store/types"

sdkmempool "github.com/cosmos/cosmos-sdk/types/mempool"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

modulev1alpha1 "pkg.berachain.dev/polaris/cosmos/api/polaris/evm/module/v1alpha1"
"pkg.berachain.dev/polaris/cosmos/x/evm/keeper"
Expand Down Expand Up @@ -66,12 +64,6 @@ type DepInjectOutput struct {

// ProvideModule is a function that provides the module to the application.
func ProvideModule(in DepInjectInput) DepInjectOutput {
// Default to governance authority if not provided
authority := authtypes.NewModuleAddress(govtypes.ModuleName)
if in.Config.Authority != "" {
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
}

// Default to empty precompile injector if not provided.
if in.CustomPrecompiles == nil {
in.CustomPrecompiles = func() *ethprecompile.Injector { return &ethprecompile.Injector{} }
Expand All @@ -81,12 +73,14 @@ func ProvideModule(in DepInjectInput) DepInjectOutput {
in.AccountKeeper,
in.StakingKeeper,
in.Key,
authority.String(),
in.Mempool,
in.CustomPrecompiles,
)

m := NewAppModule(k, in.AccountKeeper)

return DepInjectOutput{Keeper: k, Module: m}
return DepInjectOutput{
Keeper: k,
Module: m,
}
}
1 change: 0 additions & 1 deletion cosmos/x/evm/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ var _ = Describe("", func() {
k = keeper.NewKeeper(
ak, sk,
storetypes.NewKVStoreKey("evm"),
"authority",
evmmempool.NewPolarisEthereumTxPool(),
func() *ethprecompile.Injector {
return ethprecompile.NewPrecompiles([]ethprecompile.Registrable{sc}...)
Expand Down
10 changes: 3 additions & 7 deletions cosmos/x/evm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ type Keeper struct {
polaris *polar.Polaris
// The (unexposed) key used to access the store from the Context.
storeKey storetypes.StoreKey
// authority is the bech32 address that is allowed to execute governance proposals.
authority string
// The host contains various plugins that are are used to implement `core.PolarisHostChain`.
host Host

Expand All @@ -62,16 +60,14 @@ func NewKeeper(
ak state.AccountKeeper,
sk block.StakingKeeper,
storeKey storetypes.StoreKey,
authority string,
ethTxMempool sdkmempool.Mempool,
pcs func() *ethprecompile.Injector,
) *Keeper {
// We setup the keeper with some Cosmos standard sauce.
k := &Keeper{
ak: ak,
authority: authority,
storeKey: storeKey,
lock: true,
ak: ak,
storeKey: storeKey,
lock: true,
}

k.host = NewHost(
Expand Down
1 change: 0 additions & 1 deletion cosmos/x/evm/keeper/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ var _ = Describe("Processor", func() {
k = keeper.NewKeeper(
ak, sk,
storetypes.NewKVStoreKey("evm"),
"authority",
evmmempool.NewPolarisEthereumTxPool(),
func() *ethprecompile.Injector {
return ethprecompile.NewPrecompiles([]ethprecompile.Registrable{sc}...)
Expand Down

0 comments on commit a1a8159

Please sign in to comment.