diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-01-29 12:07:37 +0800 |
---|---|---|
committer | Mission Liao <mission.liao@dexon.org> | 2019-01-29 12:07:37 +0800 |
commit | 6b8d0a5875b23f9d521d31da3d0d47dc72ccacd9 (patch) | |
tree | 214f8d816c2727a5c3e0b5eb1fcfc86699780ee1 | |
parent | 4a11711b8acf750a5283f9b223319dffa91797d1 (diff) | |
download | dexon-consensus-6b8d0a5875b23f9d521d31da3d0d47dc72ccacd9.tar.gz dexon-consensus-6b8d0a5875b23f9d521d31da3d0d47dc72ccacd9.tar.zst dexon-consensus-6b8d0a5875b23f9d521d31da3d0d47dc72ccacd9.zip |
Fixup: make sure those flow of votes should works
-rw-r--r-- | core/agreement/vote-cache_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/agreement/vote-cache_test.go b/core/agreement/vote-cache_test.go index d9b58f7..209b57a 100644 --- a/core/agreement/vote-cache_test.go +++ b/core/agreement/vote-cache_test.go @@ -475,6 +475,21 @@ func (s *VoteCacheTestSuite) TestDecideAfterForward() { s.Require().Equal(signals[0].Type, SignalDecide) } +func (s *VoteCacheTestSuite) TestFastBA() { + var ( + hash = common.NewRandomHash() + position = types.Position{Round: 1, ChainID: 1, Height: 1} + ) + // Fast -> FastCom, successfuly confirmed by Fast mode. + s.testVotes(s.newVotes(types.VoteFast, hash, position, 1), SignalLock) + s.testVotes(s.newVotes(types.VoteFastCom, hash, position, 1), SignalDecide) + // Fast -> PreCom -> Com, confirmed by RBA. + position.Height++ + s.testVotes(s.newVotes(types.VoteFast, hash, position, 1), SignalLock) + s.testVotes(s.newVotes(types.VotePreCom, hash, position, 2), SignalLock) + s.testVotes(s.newVotes(types.VoteCom, hash, position, 2), SignalDecide) +} + func TestVoteCache(t *testing.T) { suite.Run(t, new(VoteCacheTestSuite)) } |