diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-11-13 16:28:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-13 16:28:24 +0800 |
commit | 01642721a7768218e7f9a5be8f0829eb8ae7c7b1 (patch) | |
tree | a8ebe89570de317d7be047f32c8c35334e78c919 /integration_test | |
parent | 86838fe70789292de0851f82426e5241c0f0cc96 (diff) | |
download | dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar.gz dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar.bz2 dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar.lz dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar.xz dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.tar.zst dexon-consensus-01642721a7768218e7f9a5be8f0829eb8ae7c7b1.zip |
core: expose implicit round shift (#321)
Diffstat (limited to 'integration_test')
-rw-r--r-- | integration_test/consensus_test.go | 4 | ||||
-rw-r--r-- | integration_test/stats_test.go | 4 | ||||
-rw-r--r-- | integration_test/with_scheduler_test.go | 7 |
3 files changed, 11 insertions, 4 deletions
diff --git a/integration_test/consensus_test.go b/integration_test/consensus_test.go index 52f7f9f..356efb1 100644 --- a/integration_test/consensus_test.go +++ b/integration_test/consensus_test.go @@ -109,10 +109,12 @@ func (s *ConsensusTestSuite) TestSimple() { req.NoError(err) // Setup seed governance instance. Give a short latency to make this test // run faster. - seedGov, err := test.NewGovernance(pubKeys, 30*time.Millisecond) + seedGov, err := test.NewGovernance( + pubKeys, 30*time.Millisecond, core.ConfigRoundShift) 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 { diff --git a/integration_test/stats_test.go b/integration_test/stats_test.go index 4a618bc..1830501 100644 --- a/integration_test/stats_test.go +++ b/integration_test/stats_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/dexon-foundation/dexon-consensus/core" "github.com/dexon-foundation/dexon-consensus/core/test" "github.com/stretchr/testify/suite" ) @@ -22,7 +23,8 @@ func (s *EventStatsTestSuite) TestCalculate() { ) prvKeys, pubKeys, err := test.NewKeys(7) req.NoError(err) - gov, err := test.NewGovernance(pubKeys, 100*time.Millisecond) + gov, err := test.NewGovernance( + pubKeys, 100*time.Millisecond, core.ConfigRoundShift) req.NoError(err) nodes, err := PrepareNodes( gov, prvKeys, 7, networkLatency, proposingLatency) diff --git a/integration_test/with_scheduler_test.go b/integration_test/with_scheduler_test.go index 1105805..a9f229a 100644 --- a/integration_test/with_scheduler_test.go +++ b/integration_test/with_scheduler_test.go @@ -21,6 +21,7 @@ import ( "testing" "time" + "github.com/dexon-foundation/dexon-consensus/core" "github.com/dexon-foundation/dexon-consensus/core/test" "github.com/stretchr/testify/suite" ) @@ -49,7 +50,8 @@ func (s *WithSchedulerTestSuite) TestNonByzantine() { prvKeys, pubKeys, err := test.NewKeys(numNodes) req.NoError(err) // Setup governance. - gov, err := test.NewGovernance(pubKeys, 250*time.Millisecond) + gov, err := test.NewGovernance( + pubKeys, 250*time.Millisecond, core.ConfigRoundShift) req.NoError(err) // Setup nodes. nodes, err := PrepareNodes( @@ -89,7 +91,8 @@ func (s *WithSchedulerTestSuite) TestConfigurationChange() { prvKeys, pubKeys, err := test.NewKeys(numNodes) req.NoError(err) // Setup governance. - gov, err := test.NewGovernance(pubKeys, 250*time.Millisecond) + gov, err := test.NewGovernance( + pubKeys, 250*time.Millisecond, core.ConfigRoundShift) req.NoError(err) // Change default round interval, expect 1 round produce 30 blocks. gov.State().RequestChange(test.StateChangeRoundInterval, 15*time.Second) |