Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 23, 2023
1 parent 6758a38 commit 0c072f8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 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/depinject v1.0.0-alpha.3
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
Expand All @@ -13,7 +14,6 @@ require (

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/math v1.0.1 // indirect
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect
Expand Down
31 changes: 15 additions & 16 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package integration
package integration_test

import (
"testing"
Expand All @@ -19,7 +19,6 @@ import (
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"

"github.com/cosmosregistry/example"
examplemodulev1 "github.com/cosmosregistry/example/api/module/v1"
Expand All @@ -40,22 +39,22 @@ func ExampleModule() configurator.ModuleOption {
func TestIntegration(t *testing.T) {
t.Parallel()

appConfig := configurator.NewAppConfig(
configurator.AuthModule(),
configurator.BankModule(),
configurator.StakingModule(),
configurator.TxModule(),
configurator.ConsensusModule(),
configurator.GenutilModule(),
configurator.MintModule(),
ExampleModule(),
)
logger := log.NewTestLogger(t)
appConfig := depinject.Supply(
configurator.NewAppConfig(
configurator.AuthModule(),
configurator.BankModule(),
configurator.StakingModule(),
configurator.TxModule(),
configurator.ConsensusModule(),
configurator.GenutilModule(),
configurator.MintModule(),
ExampleModule(),
),
logger)

var keeper keeper.Keeper
_, err := simtestutil.Setup(
depinject.Supply(appConfig, logger),
&keeper,
)
// _, err := simtestutil.Setup(appConfig, &keeper)
err := depinject.Inject(appConfig, &keeper)
require.NoError(t, err)
}
4 changes: 2 additions & 2 deletions module/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ModuleOutputs struct {
}

func ProvideModule(in ModuleInputs) ModuleOutputs {
// default to governance authority if not provided
// default to governance as authority if not provided
authority := authtypes.NewModuleAddress("gov")
if in.Config.Authority != "" {
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
Expand All @@ -55,5 +55,5 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
k := keeper.NewKeeper(in.Cdc, in.AddressCodec, in.StoreService, authority.String())
m := NewAppModule(in.Cdc, k)

return ModuleOutputs{Keeper: k, Module: m}
return ModuleOutputs{Module: m, Keeper: k}
}

0 comments on commit 0c072f8

Please sign in to comment.