diff --git a/testutil/network/network.go b/testutil/network/network.go index 258d5bc1..42714599 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -16,6 +16,8 @@ import ( "testing" "time" + tmcfg "github.com/tendermint/tendermint/config" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/rs/zerolog" @@ -253,6 +255,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { ctx := server.NewDefaultContext() tmCfg := ctx.Config tmCfg.Consensus.TimeoutCommit = cfg.TimeoutCommit + tmCfg.Mode = tmcfg.ModeValidator // Only allow the first validator to expose an RPC, API and gRPC // server/client due to Tendermint in-process constraints. @@ -559,7 +562,7 @@ func (n *Network) LatestHeight() (int64, error) { // committed after a given block. If that height is not reached within a timeout, // an error is returned. Regardless, the latest height queried is returned. func (n *Network) WaitForHeight(h int64) (int64, error) { - return n.WaitForHeightWithTimeout(h, 100*time.Second) + return n.WaitForHeightWithTimeout(h, time.Duration(10*time.Second)) } // WaitForHeightWithTimeout is the same as WaitForHeight except the caller can diff --git a/testutil/network/util.go b/testutil/network/util.go index 56c0f0d7..39c47f94 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/ethclient" abciclient "github.com/tendermint/tendermint/abci/client" tmos "github.com/tendermint/tendermint/libs/os" + tmtime "github.com/tendermint/tendermint/libs/time" "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/rpc/client/local" "github.com/tendermint/tendermint/types" @@ -144,8 +145,7 @@ func startInProcess(cfg Config, val *Validator) error { } func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { - // genTime := tmtime.Now() - genTime := time.Now() + genTime := tmtime.Now() for i := 0; i < cfg.NumValidators; i++ { tmCfg := vals[i].Ctx.Config diff --git a/x/auction/client/testutil/cli_test.go b/x/auction/client/testutil/cli_test.go index 6b027215..51ff27df 100644 --- a/x/auction/client/testutil/cli_test.go +++ b/x/auction/client/testutil/cli_test.go @@ -10,7 +10,7 @@ import ( func TestIntegrationTestSuite(t *testing.T) { cfg := network.DefaultConfig() - cfg.NumValidators = 1 + cfg.NumValidators = 2 suite.Run(t, NewIntegrationTestSuite(cfg)) } diff --git a/x/auction/client/testutil/common.go b/x/auction/client/testutil/common.go index e6181a64..062467b0 100644 --- a/x/auction/client/testutil/common.go +++ b/x/auction/client/testutil/common.go @@ -62,11 +62,6 @@ func (s *IntegrationTestSuite) createAccountWithBalance(accountName string, acco info, _, err := val.ClientCtx.Keyring.NewMnemonic(accountName, keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.EthSecp256k1) sr.NoError(err) - pubKey, err := info.GetPubKey() - sr.NoError(err) - - val.ClientCtx.Keyring.SaveOfflineKey(accountName, pubKey) - newAddr, _ := info.GetAddress() _, err = banktestutil.MsgSendExec( val.ClientCtx, diff --git a/x/bond/client/testutil/cli_test.go b/x/bond/client/testutil/cli_test.go index 26939954..7c53f915 100644 --- a/x/bond/client/testutil/cli_test.go +++ b/x/bond/client/testutil/cli_test.go @@ -9,6 +9,6 @@ import ( func TestIntegrationTestSuite(t *testing.T) { cfg := network.DefaultConfig() - cfg.NumValidators = 1 + cfg.NumValidators = 2 suite.Run(t, NewIntegrationTestSuite(cfg)) } diff --git a/x/bond/client/testutil/query.go b/x/bond/client/testutil/query.go index 7aace2b9..ac965e18 100644 --- a/x/bond/client/testutil/query.go +++ b/x/bond/client/testutil/query.go @@ -175,7 +175,7 @@ func (s *IntegrationTestSuite) TestGetQueryBondById() { { "invalid bond id", []string{ - fmt.Sprint("not_found_bond_id"), + "not_found_bond_id", fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, true, @@ -246,7 +246,7 @@ func (s *IntegrationTestSuite) TestGetQueryBondListsByOwner() { { "invalid owner address", []string{ - fmt.Sprint("not_found_bond_id"), + "not_found_bond_id", fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, true, diff --git a/x/nameservice/client/testutil/cli_test.go b/x/nameservice/client/testutil/cli_test.go index 69069bc5..7c53f915 100644 --- a/x/nameservice/client/testutil/cli_test.go +++ b/x/nameservice/client/testutil/cli_test.go @@ -1,13 +1,14 @@ package testutil import ( + "testing" + "github.com/stretchr/testify/suite" "github.com/tharsis/ethermint/testutil/network" - "testing" ) func TestIntegrationTestSuite(t *testing.T) { cfg := network.DefaultConfig() - cfg.NumValidators = 1 + cfg.NumValidators = 2 suite.Run(t, NewIntegrationTestSuite(cfg)) }