diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-24 11:49:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 11:49:25 +0800 |
commit | b6ca251bcb6e1a19a7276afe68bf37a4372670fa (patch) | |
tree | b1aac8e9759f150d58009020cd92b579e766895c /core/agreement_test.go | |
parent | 779f63a9f6fc3f4c628f0b97c822546ac51d0eb6 (diff) | |
download | dexon-consensus-b6ca251bcb6e1a19a7276afe68bf37a4372670fa.tar.gz dexon-consensus-b6ca251bcb6e1a19a7276afe68bf37a4372670fa.tar.zst dexon-consensus-b6ca251bcb6e1a19a7276afe68bf37a4372670fa.zip |
core: Add vote filter (#430)
* core: ignore usless vote
* core: export SkipBlockHash and NullBlockHash
* core: add VoteFilter
* Add test
* New VoteFilter for each round
Diffstat (limited to 'core/agreement_test.go')
-rw-r--r-- | core/agreement_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/agreement_test.go b/core/agreement_test.go index 6b74255..4dbbe6e 100644 --- a/core/agreement_test.go +++ b/core/agreement_test.go @@ -370,9 +370,9 @@ func (s *AgreementTestSuite) TestFastForwardCond1() { // No fast forward if vote.BlockHash == SKIP a.data.lockIter = 6 a.data.period = 8 - a.data.lockValue = nullBlockHash + a.data.lockValue = types.NullBlockHash for nID := range a.notarySet { - vote := s.prepareVote(nID, types.VotePreCom, skipBlockHash, uint64(7)) + vote := s.prepareVote(nID, types.VotePreCom, types.SkipBlockHash, uint64(7)) s.Require().NoError(a.processVote(vote)) } @@ -425,7 +425,7 @@ func (s *AgreementTestSuite) TestFastForwardCond2() { // No fast forward if vote.BlockHash == SKIP a.data.period = 6 for nID := range a.notarySet { - vote := s.prepareVote(nID, types.VotePreCom, skipBlockHash, uint64(7)) + vote := s.prepareVote(nID, types.VotePreCom, types.SkipBlockHash, uint64(7)) s.Require().NoError(a.processVote(vote)) } @@ -475,7 +475,7 @@ func (s *AgreementTestSuite) TestDecide() { // No decide if com-vote on SKIP. for nID := range a.notarySet { - vote := s.prepareVote(nID, types.VoteCom, skipBlockHash, uint64(2)) + vote := s.prepareVote(nID, types.VoteCom, types.SkipBlockHash, uint64(2)) s.Require().NoError(a.processVote(vote)) if votes++; votes == 3 { break |