Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tests/integration): Migrate mint and protocolpool integration tests to server v2 #22859

Merged
merged 9 commits into from
Dec 15, 2024
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
Loading