aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test/consensus_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-15 13:05:50 +0800
committerGitHub <noreply@github.com>2018-11-15 13:05:50 +0800
commitce9da6912a16f064160781bbff8a9762e305bae9 (patch)
treef4de88f0488687e4480cc8461b8a3cbf03a1c85b /integration_test/consensus_test.go
parent7b68cc8fa60d91a7c6ed2f78dc851da48d1fc258 (diff)
downloaddexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar.gz
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar.bz2
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar.lz
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar.xz
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.tar.zst
dexon-consensus-ce9da6912a16f064160781bbff8a9762e305bae9.zip
test: fix network (#328)
* Broadcast to set of node instead of broadcasting when attaching cache. * Fix pull blocks
Diffstat (limited to 'integration_test/consensus_test.go')
-rw-r--r--integration_test/consensus_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/integration_test/consensus_test.go b/integration_test/consensus_test.go
index 356efb1..6bc6c4b 100644
--- a/integration_test/consensus_test.go
+++ b/integration_test/consensus_test.go
@@ -28,6 +28,7 @@ import (
"github.com/dexon-foundation/dexon-consensus/core/crypto"
"github.com/dexon-foundation/dexon-consensus/core/test"
"github.com/dexon-foundation/dexon-consensus/core/types"
+ "github.com/dexon-foundation/dexon-consensus/core/utils"
"github.com/stretchr/testify/suite"
)
@@ -69,6 +70,8 @@ func (s *ConsensusTestSuite) setupNodes(
test.NetworkConfig{Type: test.NetworkTypeFake})
gov := seedGov.Clone()
gov.SwitchToRemoteMode(networkModule)
+ gov.NotifyRoundHeight(0, 0)
+ networkModule.AddNodeSetCache(utils.NewNodeSetCache(gov))
app := test.NewApp(gov.State())
// Now is the consensus module.
con := core.NewConsensus(
@@ -114,7 +117,6 @@ func (s *ConsensusTestSuite) TestSimple() {
req.NoError(err)
req.NoError(seedGov.State().RequestChange(
test.StateChangeRoundInterval, 25*time.Second))
- seedGov.NotifyRoundHeight(0, 0)
// A short round interval.
nodes := s.setupNodes(dMoment, prvKeys, seedGov)
for _, n := range nodes {