diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-11-02 16:05:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-02 16:05:25 +0800 |
commit | 513bfa84c18c53d1d9d7a02b68945a758d825362 (patch) | |
tree | c616b379a975724ffdab6984c0a13cb4d173abf7 /core/leader-selector_test.go | |
parent | 5170bff5f5332fd7782f300cb4a1d63f3cd3664c (diff) | |
download | dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar.gz dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar.bz2 dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar.lz dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar.xz dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.tar.zst dexon-consensus-513bfa84c18c53d1d9d7a02b68945a758d825362.zip |
core: reset CRS in leader selector by round (#286)
Diffstat (limited to 'core/leader-selector_test.go')
-rw-r--r-- | core/leader-selector_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/leader-selector_test.go b/core/leader-selector_test.go index 07e561a..975fd13 100644 --- a/core/leader-selector_test.go +++ b/core/leader-selector_test.go @@ -46,7 +46,9 @@ func (s *LeaderSelectorTestSuite) SetupTest() { } func (s *LeaderSelectorTestSuite) newLeader() *leaderSelector { - return newLeaderSelector(common.NewRandomHash(), s.mockValidLeader) + l := newLeaderSelector(s.mockValidLeader) + l.restart(common.NewRandomHash()) + return l } func (s *LeaderSelectorTestSuite) TestDistance() { @@ -138,7 +140,7 @@ func (s *LeaderSelectorTestSuite) TestValidLeaderFn() { blockHash := leader.leaderBlockHash() s.mockValidLeaderDB[blockHash] = false - leader.restart() + leader.restart(leader.hashCRS) for _, b := range blocks { s.Require().NoError(leader.processBlock(b)) } |