refactor(testutil): remove dependency on simapp (#12624)
## Description Closes: #12546 Removes `simapp` as a dependency from `testutil/network` by abstracting `simapp` construction behind a factory fn (now in `simapp`), then requiring callers of `network.DefaultConfig` to pass in the factory fn directly. This patch is an intermediate step to removing all dependencies on `simapp`. Follow up work may include moving all of the tests using `network.DefaultConfig` updated here up to `simapp`, or possibly just the runners. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
parent
3523c2669f
commit
d4a9d4d321
@ -17,6 +17,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||
)
|
||||
@ -145,7 +146,7 @@ x: "10"
|
||||
}
|
||||
|
||||
func TestCLIQueryConn(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
|
||||
n, err := network.New(t, t.TempDir(), cfg)
|
||||
@ -159,7 +160,7 @@ func TestCLIQueryConn(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetFromFields(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
path := hd.CreateHDPath(118, 0, 0).String()
|
||||
|
||||
testCases := []struct {
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/rest"
|
||||
"github.com/cosmos/cosmos-sdk/types"
|
||||
@ -34,7 +35,7 @@ func TestIntegrationTestSuite(t *testing.T) {
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
|
||||
s.cfg = cfg
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@ -29,7 +30,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
var err error
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig())
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig(simapp.NewTestNetworkFixture))
|
||||
s.Require().NoError(err)
|
||||
|
||||
_, err = s.network.WaitForHeight(2)
|
||||
|
||||
@ -7,6 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/rpc"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
@ -21,7 +22,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
var err error
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig())
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig(simapp.NewTestNetworkFixture))
|
||||
s.Require().NoError(err)
|
||||
|
||||
s.Require().NoError(s.network.WaitForNextBlock())
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
)
|
||||
@ -41,7 +42,7 @@ type GRPCWebTestSuite struct {
|
||||
func (s *GRPCWebTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
s.cfg = cfg
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ type IntegrationTestSuite struct {
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
s.app = simapp.Setup(s.T(), false)
|
||||
s.cfg = network.DefaultConfig()
|
||||
s.cfg = network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
s.cfg.NumValidators = 1
|
||||
|
||||
var err error
|
||||
|
||||
@ -26,6 +26,7 @@ import (
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@ -484,7 +485,7 @@ func writeFile(name string, dir string, contents []byte) error {
|
||||
|
||||
// startTestnet starts an in-process testnet
|
||||
func startTestnet(cmd *cobra.Command, args startArgs) error {
|
||||
networkConfig := network.DefaultConfig()
|
||||
networkConfig := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
|
||||
// Default networkConfig.ChainID is random, and we should only override it if chainID provided
|
||||
// is non-empty
|
||||
|
||||
@ -22,12 +22,16 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/server/types"
|
||||
"github.com/cosmos/cosmos-sdk/simapp/params"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/mock"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
@ -38,7 +42,7 @@ import (
|
||||
type SetupOptions struct {
|
||||
Logger log.Logger
|
||||
DB *dbm.MemDB
|
||||
EncConfig params.EncodingConfig
|
||||
EncConfig simappparams.EncodingConfig
|
||||
AppOpts types.AppOptions
|
||||
}
|
||||
|
||||
@ -352,3 +356,29 @@ func ModuleAccountAddrs() map[string]bool {
|
||||
}
|
||||
return bk.GetBlockedAddresses()
|
||||
}
|
||||
|
||||
// NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests
|
||||
func NewTestNetworkFixture() network.TestFixture {
|
||||
encodingCfg := MakeTestEncodingConfig()
|
||||
cfg := testutil.TestEncodingConfig{
|
||||
TxConfig: encodingCfg.TxConfig,
|
||||
Codec: encodingCfg.Codec,
|
||||
Amino: encodingCfg.Amino,
|
||||
InterfaceRegistry: encodingCfg.InterfaceRegistry,
|
||||
}
|
||||
appCtr := func(val testutil.Validator) servertypes.Application {
|
||||
return NewSimApp(
|
||||
val.GetCtx().Logger, dbm.NewMemDB(), nil, true,
|
||||
encodingCfg,
|
||||
simtestutil.NewAppOptionsWithFlagHome(val.GetCtx().Config.RootDir),
|
||||
bam.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),
|
||||
bam.SetMinGasPrices(val.GetAppConfig().MinGasPrices),
|
||||
)
|
||||
}
|
||||
|
||||
return network.TestFixture{
|
||||
AppConstructor: appCtr,
|
||||
GenesisState: ModuleBasics.DefaultGenesis(cfg.Codec),
|
||||
EncodingConfig: cfg,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//go:build norace
|
||||
// +build norace
|
||||
|
||||
package network_test
|
||||
package simapp_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
|
||||
@ -22,7 +23,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
var err error
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig())
|
||||
s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig(simapp.NewTestNetworkFixture))
|
||||
s.Require().NoError(err)
|
||||
|
||||
h, err := s.network.WaitForHeight(1)
|
||||
@ -7,13 +7,13 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
)
|
||||
|
||||
func TestGenerateCoinKey(t *testing.T) {
|
||||
t.Parallel()
|
||||
cdc := simapp.MakeTestEncodingConfig().Codec
|
||||
cdc := testutil.MakeTestEncodingConfig().Codec
|
||||
addr, mnemonic, err := GenerateCoinKey(hd.Secp256k1, cdc)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -28,7 +28,7 @@ func TestGenerateCoinKey(t *testing.T) {
|
||||
func TestGenerateSaveCoinKey(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
encCfg := simapp.MakeTestEncodingConfig()
|
||||
encCfg := testutil.MakeTestEncodingConfig()
|
||||
kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, encCfg.Codec)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -53,7 +53,7 @@ func TestGenerateSaveCoinKey(t *testing.T) {
|
||||
func TestGenerateSaveCoinKeyOverwriteFlag(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
encCfg := simapp.MakeTestEncodingConfig()
|
||||
encCfg := testutil.MakeTestEncodingConfig()
|
||||
kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, encCfg.Codec)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
@ -41,10 +42,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/server/api"
|
||||
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/simapp/params"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
@ -57,19 +55,13 @@ var lock = new(sync.Mutex)
|
||||
|
||||
// AppConstructor defines a function which accepts a network configuration and
|
||||
// creates an ABCI Application to provide to Tendermint.
|
||||
type AppConstructor = func(val Validator) servertypes.Application
|
||||
type AppConstructor = func(val moduletestutil.Validator) servertypes.Application
|
||||
type TestFixtureFactory = func() TestFixture
|
||||
|
||||
// NewAppConstructor returns a new simapp AppConstructor
|
||||
func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor {
|
||||
return func(val Validator) servertypes.Application {
|
||||
return simapp.NewSimApp(
|
||||
val.Ctx.Logger, dbm.NewMemDB(), nil, true,
|
||||
encodingCfg,
|
||||
simtestutil.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir),
|
||||
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
|
||||
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
|
||||
)
|
||||
}
|
||||
type TestFixture struct {
|
||||
AppConstructor AppConstructor
|
||||
GenesisState map[string]json.RawMessage
|
||||
EncodingConfig moduletestutil.TestEncodingConfig
|
||||
}
|
||||
|
||||
// Config defines the necessary configuration used to bootstrap and start an
|
||||
@ -105,17 +97,17 @@ type Config struct {
|
||||
|
||||
// DefaultConfig returns a sane default configuration suitable for nearly all
|
||||
// testing requirements.
|
||||
func DefaultConfig() Config {
|
||||
encCfg := simapp.MakeTestEncodingConfig()
|
||||
func DefaultConfig(factory TestFixtureFactory) Config {
|
||||
fixture := factory()
|
||||
|
||||
return Config{
|
||||
Codec: encCfg.Codec,
|
||||
TxConfig: encCfg.TxConfig,
|
||||
LegacyAmino: encCfg.Amino,
|
||||
InterfaceRegistry: encCfg.InterfaceRegistry,
|
||||
Codec: fixture.EncodingConfig.Codec,
|
||||
TxConfig: fixture.EncodingConfig.TxConfig,
|
||||
LegacyAmino: fixture.EncodingConfig.Amino,
|
||||
InterfaceRegistry: fixture.EncodingConfig.InterfaceRegistry,
|
||||
AccountRetriever: authtypes.AccountRetriever{},
|
||||
AppConstructor: NewAppConstructor(encCfg),
|
||||
GenesisState: simapp.ModuleBasics.DefaultGenesis(encCfg.Codec),
|
||||
AppConstructor: fixture.AppConstructor,
|
||||
GenesisState: fixture.GenesisState,
|
||||
TimeoutCommit: 2 * time.Second,
|
||||
ChainID: "chain-" + tmrand.Str(6),
|
||||
NumValidators: 4,
|
||||
@ -133,8 +125,6 @@ func DefaultConfig() Config {
|
||||
}
|
||||
|
||||
func DefaultConfigWithAppConfig(appConfig depinject.Config) (Config, error) {
|
||||
cfg := DefaultConfig()
|
||||
|
||||
var (
|
||||
appBuilder *runtime.AppBuilder
|
||||
txConfig client.TxConfig
|
||||
@ -153,23 +143,26 @@ func DefaultConfigWithAppConfig(appConfig depinject.Config) (Config, error) {
|
||||
return Config{}, err
|
||||
}
|
||||
|
||||
cfg := DefaultConfig(func() TestFixture {
|
||||
return TestFixture{}
|
||||
})
|
||||
cfg.Codec = cdc
|
||||
cfg.TxConfig = txConfig
|
||||
cfg.LegacyAmino = legacyAmino
|
||||
cfg.InterfaceRegistry = interfaceRegistry
|
||||
cfg.GenesisState = appBuilder.DefaultGenesis()
|
||||
cfg.AppConstructor = func(val Validator) servertypes.Application {
|
||||
cfg.AppConstructor = func(val moduletestutil.Validator) servertypes.Application {
|
||||
// we build a unique app instance for every validator here
|
||||
var appBuilder *runtime.AppBuilder
|
||||
if err := depinject.Inject(appConfig, &appBuilder); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
app := appBuilder.Build(
|
||||
val.Ctx.Logger,
|
||||
val.GetCtx().Logger,
|
||||
dbm.NewMemDB(),
|
||||
nil,
|
||||
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
|
||||
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
|
||||
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),
|
||||
baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices),
|
||||
)
|
||||
|
||||
if err := app.Load(true); err != nil {
|
||||
@ -234,10 +227,19 @@ type Logger interface {
|
||||
}
|
||||
|
||||
var (
|
||||
_ Logger = (*testing.T)(nil)
|
||||
_ Logger = (*CLILogger)(nil)
|
||||
_ Logger = (*testing.T)(nil)
|
||||
_ Logger = (*CLILogger)(nil)
|
||||
_ moduletestutil.Validator = Validator{}
|
||||
)
|
||||
|
||||
func (v Validator) GetCtx() *server.Context {
|
||||
return v.Ctx
|
||||
}
|
||||
|
||||
func (v Validator) GetAppConfig() *srvconfig.Config {
|
||||
return v.AppConfig
|
||||
}
|
||||
|
||||
// CLILogger wraps a cobra.Command and provides command logging methods.
|
||||
type CLILogger struct {
|
||||
cmd *cobra.Command
|
||||
|
||||
12
types/module/testutil/network.go
Normal file
12
types/module/testutil/network.go
Normal file
@ -0,0 +1,12 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||
)
|
||||
|
||||
// TODO rename
|
||||
type Validator interface {
|
||||
GetCtx() *server.Context
|
||||
GetAppConfig() *srvconfig.Config
|
||||
}
|
||||
@ -19,6 +19,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/rest"
|
||||
@ -51,7 +52,7 @@ type IntegrationTestSuite struct {
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
s.cfg = cfg
|
||||
|
||||
|
||||
@ -8,11 +8,12 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
@ -6,13 +6,14 @@ package testutil
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
@ -8,11 +8,12 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
@ -6,13 +6,14 @@ package testutil
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
|
||||
@ -13,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/module"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/bank"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/params"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking"
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/x/bank"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/mint"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/nft/module"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/params"
|
||||
_ "github.com/cosmos/cosmos-sdk/x/staking"
|
||||
|
||||
|
||||
@ -6,13 +6,14 @@ package testutil
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 2
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
@ -5,11 +5,12 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
)
|
||||
|
||||
func TestIntegrationTestSuite(t *testing.T) {
|
||||
cfg := network.DefaultConfig()
|
||||
cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
|
||||
cfg.NumValidators = 1
|
||||
suite.Run(t, NewIntegrationTestSuite(cfg))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user