Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani authored and Pantani committed Oct 8, 2023
1 parent 564da66 commit b5096e9
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ignite/pkg/cosmosanalysis/module/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func TestDiscover(t *testing.T) {
}
}

func TestDiscoverWithVersionedApp(t *testing.T) {
func TestDiscoverWithAppV2(t *testing.T) {
ctx := context.Background()
sourcePath := "testdata/planet_v2"
testModule := newModule(sourcePath, "github.com/tendermint/planet/v2")
sourcePath := "testdata/earth"
testModule := newModule(sourcePath, "github.com/tendermint/planet")

tests := []struct {
name, protoDir string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/gogo/protobuf/codec"
fookeeper "github.com/tendermint/planet/x/foo/keeper"
marskeeper "github.com/tendermint/planet/x/mars/keeper"
abci "github.com/tendermint/tendermint/abci/types"

app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"
Expand All @@ -23,7 +23,7 @@ type Foo struct {
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
GovKeeper govkeeper.Keeper
FooKeeper fookeeper.Keeper
MarsKeeper marskeeper.Keeper
}

var ModuleBasics = module.NewBasicManager(foo.AppModuleBasic{})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,19 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
_ "github.com/cosmos/ibc-go/modules/capability" // import for side-effects
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
_ "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" // import for side-effects
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
_ "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" // import for side-effects
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"google.golang.org/protobuf/types/known/durationpb"

marsmodulev1 "github.com/ignite/mars/api/mars/mars/module"
_ "github.com/ignite/mars/x/mars" // import for side-effects
marsmoduletypes "github.com/ignite/mars/x/mars/types"
marsmodulev1 "github.com/tendermint/mars/api/mars/mars/module"
_ "github.com/tendermint/mars/x/mars" // import for side-effects
marsmoduletypes "github.com/tendermint/mars/x/mars/types"
// this line is used by starport scaffolding # stargate/app/moduleImport
)

Expand Down Expand Up @@ -120,7 +123,6 @@ var (
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
beginBlockers = []string{
// cosmos sdk modules
upgradetypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
Expand Down Expand Up @@ -156,6 +158,11 @@ var (
// this line is used by starport scaffolding # stargate/app/endBlockers
}

preBlockers = []string{
upgradetypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/preBlockers
}

// module account permissions
moduleAccPerms = []*authmodulev1.ModuleAccountPermission{
{Account: authtypes.FeeCollectorName},
Expand Down Expand Up @@ -188,6 +195,7 @@ var (
Name: runtime.ModuleName,
Config: appconfig.WrapAny(&runtimev1alpha1.Module{
AppName: Name,
PreBlockers: preBlockers,
BeginBlockers: beginBlockers,
EndBlockers: endBlockers,
InitGenesis: genesisModuleOrder,
Expand Down
3 changes: 3 additions & 0 deletions ignite/pkg/cosmosanalysis/module/testdata/earth/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/tendermint/planet

go 1.18
4 changes: 2 additions & 2 deletions ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/gogo/protobuf/codec"
fookeeper "github.com/tendermint/planet/x/foo/keeper"
marskeeper "github.com/tendermint/planet/x/mars/keeper"
abci "github.com/tendermint/tendermint/abci/types"

app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go"
Expand All @@ -23,7 +23,7 @@ type Foo struct {
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
GovKeeper govkeeper.Keeper
FooKeeper fookeeper.Keeper
MarsKeeper marskeeper.Keeper
}

var ModuleBasics = module.NewBasicManager(mars.AppModuleBasic{})
Expand Down
3 changes: 0 additions & 3 deletions ignite/pkg/cosmosanalysis/module/testdata/planet_v2/go.mod

This file was deleted.

0 comments on commit b5096e9

Please sign in to comment.