mirror of
https://github.com/status-im/status-go.git
synced 2025-02-22 11:48:31 +00:00
Fix test to ensure consistency with checks
This commit is contained in:
parent
a1668add06
commit
a2cabd9d68
@ -262,12 +262,20 @@ func (s *APIBackendTestSuite) TestRestartNode() {
|
|||||||
require := s.Require()
|
require := s.Require()
|
||||||
require.NotNil(s.Backend)
|
require.NotNil(s.Backend)
|
||||||
|
|
||||||
s.StartTestBackend()
|
// get Ropsten config
|
||||||
defer s.StopTestBackend()
|
nodeConfig, err := e2e.MakeTestNodeConfig(params.RopstenNetworkID)
|
||||||
|
s.NoError(err)
|
||||||
|
|
||||||
|
s.False(s.Backend.IsNodeRunning())
|
||||||
|
nodeStarted, err := s.Backend.StartNode(nodeConfig)
|
||||||
|
s.NoError(err)
|
||||||
|
|
||||||
|
<-nodeStarted // wait till node is started
|
||||||
|
s.True(s.Backend.IsNodeRunning())
|
||||||
|
|
||||||
firstHash, err := e2e.FirstBlockHash(s.Backend.NodeManager())
|
firstHash, err := e2e.FirstBlockHash(s.Backend.NodeManager())
|
||||||
s.NoError(err)
|
s.NoError(err)
|
||||||
s.Equal("0x28c4da1cca48d0107ea5ea29a40ac15fca86899c52d02309fa12ea39b86d219c", firstHash)
|
s.Equal("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d", firstHash)
|
||||||
|
|
||||||
s.True(s.Backend.IsNodeRunning())
|
s.True(s.Backend.IsNodeRunning())
|
||||||
nodeRestarted, err := s.Backend.RestartNode()
|
nodeRestarted, err := s.Backend.RestartNode()
|
||||||
@ -278,5 +286,5 @@ func (s *APIBackendTestSuite) TestRestartNode() {
|
|||||||
// make sure we can read the first byte, and it is valid (for Rinkeby)
|
// make sure we can read the first byte, and it is valid (for Rinkeby)
|
||||||
firstHash, err = e2e.FirstBlockHash(s.Backend.NodeManager())
|
firstHash, err = e2e.FirstBlockHash(s.Backend.NodeManager())
|
||||||
s.NoError(err)
|
s.NoError(err)
|
||||||
s.Equal("0x28c4da1cca48d0107ea5ea29a40ac15fca86899c52d02309fa12ea39b86d219c", firstHash)
|
s.Equal("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d", firstHash)
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/status-im/status-go/geth/api"
|
"github.com/status-im/status-go/geth/api"
|
||||||
"github.com/status-im/status-go/geth/common"
|
"github.com/status-im/status-go/geth/common"
|
||||||
"github.com/status-im/status-go/geth/signal"
|
"github.com/status-im/status-go/geth/signal"
|
||||||
|
. "github.com/status-im/status-go/testing" //nolint: golint
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
networkSelected = flag.Int("network", "statuschain", "-network=NETWORKID to select network used for tests")
|
networkSelected = flag.Int("network", 777, "-network=NETWORKID to select network used for tests")
|
||||||
|
|
||||||
// TestConfig defines the default config usable at package-level.
|
// TestConfig defines the default config usable at package-level.
|
||||||
TestConfig *common.TestConfig
|
TestConfig *common.TestConfig
|
||||||
@ -119,7 +119,7 @@ func EnsureNodeSync(nodeManager common.NodeManager) error {
|
|||||||
// GetNetworkID returns appropriate network id for test based on
|
// GetNetworkID returns appropriate network id for test based on
|
||||||
// default or provided -network flag.
|
// default or provided -network flag.
|
||||||
func GetNetworkID() int {
|
func GetNetworkID() int {
|
||||||
switch strings.ToLower(*networkSelected) {
|
switch *networkSelected {
|
||||||
case params.MainNetworkID:
|
case params.MainNetworkID:
|
||||||
return params.MainNetworkID
|
return params.MainNetworkID
|
||||||
case params.RinkebyNetworkID:
|
case params.RinkebyNetworkID:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user