Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 23, 2023
1 parent c127ea4 commit 6758a38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.20
require (
cosmossdk.io/api v0.4.3-0.20230620040119-e078f1a49e8b
cosmossdk.io/core v0.8.0
cosmossdk.io/log v1.1.0
github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230623113103-02a0f59000a6
github.com/cosmosregistry/example v1.0.0
github.com/stretchr/testify v1.8.4
Expand All @@ -14,7 +15,6 @@ require (
cosmossdk.io/collections v0.2.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect
cosmossdk.io/log v1.1.0 // indirect
cosmossdk.io/math v1.0.1 // indirect
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect
cosmossdk.io/x/tx v0.8.0 // indirect
Expand Down
20 changes: 14 additions & 6 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package integration
import (
"testing"

"github.com/stretchr/testify/require"

// blank import for app wiring registration
_ "github.com/cosmos/cosmos-sdk/x/auth"
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
Expand All @@ -14,30 +16,31 @@ import (

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
"cosmossdk.io/core/appconfig"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/stretchr/testify/require"

"github.com/cosmosregistry/example"
modulev1 "github.com/cosmosregistry/example/api/module/v1"
examplemodulev1 "github.com/cosmosregistry/example/api/module/v1"
"github.com/cosmosregistry/example/keeper"
_ "github.com/cosmosregistry/example/module"
)

// ExampleModule is a configurator.ModuleOption that adds the example module to the app config.
func ExampleModule() configurator.ModuleOption {
return func(config *configurator.Config) {
config.ModuleConfigs[example.ModuleName] = &appv1alpha1.ModuleConfig{
Name: example.ModuleName,
Config: appconfig.WrapAny(&modulev1.Module{}),
Config: appconfig.WrapAny(&examplemodulev1.Module{}),
}
}
}

func TestIntegration(t *testing.T) {
t.Parallel()

var keeper keeper.Keeper
AppConfig := configurator.NewAppConfig(
appConfig := configurator.NewAppConfig(
configurator.AuthModule(),
configurator.BankModule(),
configurator.StakingModule(),
Expand All @@ -47,7 +50,12 @@ func TestIntegration(t *testing.T) {
configurator.MintModule(),
ExampleModule(),
)
logger := log.NewTestLogger(t)

_, err := simtestutil.Setup(AppConfig, &keeper)
var keeper keeper.Keeper
_, err := simtestutil.Setup(
depinject.Supply(appConfig, logger),
&keeper,
)
require.NoError(t, err)
}

0 comments on commit 6758a38

Please sign in to comment.