Skip to content

Commit

Permalink
(mod/capability) Use AppModule directly in favour of AppModuleBasic i…
Browse files Browse the repository at this point in the history
…n mod/capability (cosmos#4982)

* removing appmodulebasic and all nil/unneeded functions

* lint

* test file changes

* lint

---------

Co-authored-by: Damian Nolan <[email protected]>
  • Loading branch information
muku314115 and damiannolan authored Oct 30, 2023
1 parent aef6a3f commit 7cf30ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion modules/capability/capability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type CapabilityTestSuite struct {
}

func (suite *CapabilityTestSuite) SetupTest() {
encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{})
encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{})
suite.cdc = encodingCfg.Codec

suite.storeKey = storetypes.NewKVStoreKey(types.StoreKey)
Expand Down
2 changes: 1 addition & 1 deletion modules/capability/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (suite *KeeperTestSuite) SetupTest() {
key := storetypes.NewKVStoreKey(types.StoreKey)
testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test"))
suite.ctx = testCtx.Ctx
encCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{})
encCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{})
suite.keeper = keeper.NewKeeper(encCfg.Codec, key, key)
}

Expand Down
15 changes: 1 addition & 14 deletions modules/capability/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

"cosmossdk.io/core/appmodule"

Expand All @@ -26,7 +25,6 @@ import (

var (
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ module.HasName = (*AppModule)(nil)
_ module.HasConsensusVersion = (*AppModule)(nil)
Expand All @@ -48,11 +46,6 @@ func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic {
return AppModuleBasic{cdc: cdc}
}

// Name returns the capability module's name.
func (AppModuleBasic) Name() string {
return types.ModuleName
}

// RegisterLegacyAminoCodec does nothing. Capability does not support amino.
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

Expand All @@ -77,12 +70,6 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod
func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *gwruntime.ServeMux) {
}

// GetTxCmd returns the capability module's root tx command.
func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil }

// GetQueryCmd returns the capability module's root query command.
func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil }

// ----------------------------------------------------------------------------
// AppModule
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -112,7 +99,7 @@ func (AppModule) IsAppModule() {}

// Name returns the capability module's name.
func (am AppModule) Name() string {
return am.AppModuleBasic.Name()
return types.ModuleName
}

// InitGenesis performs the capability module's genesis initialization It returns
Expand Down
2 changes: 1 addition & 1 deletion modules/capability/simulation/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func TestDecodeStore(t *testing.T) {
encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModuleBasic{})
encodingCfg := moduletestutil.MakeTestEncodingConfig(capability.AppModule{})
dec := simulation.NewDecodeStore(encodingCfg.Codec)

capOwners := types.CapabilityOwners{
Expand Down

0 comments on commit 7cf30ef

Please sign in to comment.