Skip to content

Commit

Permalink
remove unused unit tests and fix others
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani authored and Pantani committed Oct 5, 2023
1 parent 591d05c commit 513c86e
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 32 deletions.
26 changes: 3 additions & 23 deletions ignite/pkg/cosmosanalysis/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,27 +487,7 @@ func Test_mergeImports(t *testing.T) {
},
},
{
name: "test three keeper import",
blankImports: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts",
"cosmossdk.io/x/feegrant/module",
},
discovered: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper",
"github.com/cosmos/cosmos-sdk/x/bank/keeper",
"cosmossdk.io/x/feegrant/types",
"cosmossdk.io/x/feegrant",
"cosmossdk.io/x/foo",
},
want: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts",
"github.com/cosmos/cosmos-sdk/x/bank/keeper",
"cosmossdk.io/x/feegrant/module",
"cosmossdk.io/x/foo",
},
},
{
name: "test three keeper import",
name: "test keeper imports",
blankImports: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts",
"cosmossdk.io/x/feegrant/module",
Expand All @@ -533,11 +513,11 @@ func Test_mergeImports(t *testing.T) {
"github.com/cosmos/ibc-go/modules/capability",
},
discovered: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts",
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts",
"github.com/cosmos/ibc-go/modules/capability",
},
want: []string{
"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts",
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts",
"github.com/cosmos/ibc-go/modules/capability",
},
},
Expand Down
18 changes: 14 additions & 4 deletions ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ import (
"cosmossdk.io/client/v2/autocli"
"github.com/cosmos/cosmos-sdk/api/tendermint/abci"
"github.com/cosmos/cosmos-sdk/client"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"

authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/gogo/protobuf/codec"
app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"

"github.com/tendermint/planet/x/mars"
fookeeper "github.com/tendermint/planet/x/foo/keeper"
abci "github.com/tendermint/tendermint/abci/types"
)

type Foo struct {
FooKeeper foo.keeper
AuthKeeper authkeeper.Keeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
GovKeeper govkeeper.Keeper
FooKeeper fookeeper.Keeper
}

var ModuleBasics = module.NewBasicManager(mars.AppModuleBasic{})
Expand All @@ -25,6 +34,7 @@ func (Foo) RegisterTxService() {}
func (Foo) RegisterTendermintService() {}
func (Foo) InterfaceRegistry() codectypes.InterfaceRegistry { return nil }
func (Foo) TxConfig() client.TxConfig { return nil }
func (Foo) AppCodec() codec.Codec { return app.appCodec }
func (Foo) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{} }
func (Foo) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
Expand Down
20 changes: 15 additions & 5 deletions ignite/pkg/cosmosanalysis/module/testdata/planet_v2/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,28 @@ import (
"cosmossdk.io/client/v2/autocli"
"github.com/cosmos/cosmos-sdk/api/tendermint/abci"
"github.com/cosmos/cosmos-sdk/client"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"

authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/gogo/protobuf/codec"
app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"

"github.com/tendermint/planet/x/mars"
fookeeper "github.com/tendermint/planet/x/foo/keeper"
abci "github.com/tendermint/tendermint/abci/types"
)

type Foo struct {
FooKeeper foo.keeper
AuthKeeper authkeeper.Keeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
GovKeeper govkeeper.Keeper
FooKeeper fookeeper.Keeper
}

var ModuleBasics = module.NewBasicManager(mars.AppModuleBasic{})
var ModuleBasics = module.NewBasicManager(foo.AppModuleBasic{})

func (Foo) Name() string { return app.BaseApp.Name() }
func (Foo) GetKey(storeKey string) *storetypes.KVStoreKey { return nil }
Expand All @@ -25,6 +34,7 @@ func (Foo) TxConfig() client.TxConfig { return nil }
func (Foo) RegisterTxService() {}
func (Foo) RegisterTendermintService() {}
func (Foo) InterfaceRegistry() codectypes.InterfaceRegistry { return nil }
func (Foo) AppCodec() codec.Codec { return app.appCodec }
func (Foo) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{} }
func (Foo) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
Expand Down
Loading

0 comments on commit 513c86e

Please sign in to comment.