Skip to content

Commit

Permalink
refactor(tests/integration): Migrate mint and protocolpool integratio…
Browse files Browse the repository at this point in the history
…n tests to server v2 (#22859)
  • Loading branch information
sontrinh16 authored Dec 15, 2024
1 parent 256ec4f commit 6152260
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 223 deletions.
26 changes: 0 additions & 26 deletions tests/integration/mint/app_config.go

This file was deleted.

30 changes: 0 additions & 30 deletions tests/integration/mint/module_test.go

This file was deleted.

30 changes: 0 additions & 30 deletions tests/integration/protocolpool/app_config.go

This file was deleted.

137 changes: 0 additions & 137 deletions tests/integration/protocolpool/module_test.go

This file was deleted.

50 changes: 50 additions & 0 deletions tests/integration/v2/mint/module_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package mint

import (
"testing"

"github.com/stretchr/testify/require"

"cosmossdk.io/depinject"
"cosmossdk.io/log"
_ "cosmossdk.io/x/accounts" // import as blank for app wiring
_ "cosmossdk.io/x/bank" // import as blank for app wiring
_ "cosmossdk.io/x/consensus" // import as blank for app wiring
_ "cosmossdk.io/x/mint" // import as blank for app wiring
"cosmossdk.io/x/mint/types"
_ "cosmossdk.io/x/staking" // import as blank for app wiring

"github.com/cosmos/cosmos-sdk/tests/integration/v2"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
_ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
_ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
var accountKeeper authkeeper.AccountKeeper

moduleConfigs := []configurator.ModuleOption{
configurator.AccountsModule(),
configurator.AuthModule(),
configurator.BankModule(),
configurator.StakingModule(),
configurator.TxModule(),
configurator.ValidateModule(),
configurator.ConsensusModule(),
configurator.GenutilModule(),
configurator.MintModule(),
}

startupCfg := integration.DefaultStartUpConfig(t)
app, err := integration.NewApp(
depinject.Configs(configurator.NewAppV2Config(moduleConfigs...), depinject.Supply(log.NewNopLogger())),
startupCfg, &accountKeeper)
require.NoError(t, err)

ctx := app.StateLatestContext(t)
acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
require.NotNil(t, acc)
}
Loading

0 comments on commit 6152260

Please sign in to comment.