diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-07 17:21:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-07 17:21:08 +0800 |
commit | 21c420db895b1aa48709982cd145a119c74de6fa (patch) | |
tree | a8cd9a9bc5e8c22a21812f0e00939f3fbd92db89 /core/consensus_test.go | |
parent | 8d1069b61d847662d37f504937a346c56d6cb0eb (diff) | |
download | dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.gz dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.bz2 dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.lz dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.xz dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.zst dexon-consensus-21c420db895b1aa48709982cd145a119c74de6fa.zip |
core: BA 3.0 (#408)
* Add v3 enum
* Add BA leader calculation
* Fast BA
* Add unittest for Fast BA
* Add comment
* Select leader in notarySet
Diffstat (limited to 'core/consensus_test.go')
-rw-r--r-- | core/consensus_test.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/consensus_test.go b/core/consensus_test.go index 7748494..938b56d 100644 --- a/core/consensus_test.go +++ b/core/consensus_test.go @@ -644,16 +644,12 @@ func (s *ConsensusTestSuite) TestSyncBA() { s.Equal(ErrIncorrectVoteSignature, con.ProcessAgreementResult(baResult)) s.Require().NoError(signers[0].SignVote(&baResult.Votes[0])) - for _, signer := range signers { - vote := types.NewVote(types.VoteCom, hash, 0) - vote.Position = pos - s.Require().NoError(signer.SignVote(vote)) - baResult.Votes = append(baResult.Votes, *vote) - } - s.Equal(ErrIncorrectVoteProposer, con.ProcessAgreementResult(baResult)) - baResult.Votes = baResult.Votes[:1] s.Equal(ErrNotEnoughVotes, con.ProcessAgreementResult(baResult)) + for range signers { + baResult.Votes = append(baResult.Votes, baResult.Votes[0]) + } + s.Equal(ErrNotEnoughVotes, con.ProcessAgreementResult(baResult)) } func TestConsensus(t *testing.T) { |