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

chore(cleanup): Remove authority from evmkeeper (unused) #925

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading