aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus_test.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-01-07 17:21:08 +0800
committerGitHub <noreply@github.com>2019-01-07 17:21:08 +0800
commit21c420db895b1aa48709982cd145a119c74de6fa (patch)
treea8cd9a9bc5e8c22a21812f0e00939f3fbd92db89 /core/consensus_test.go
parent8d1069b61d847662d37f504937a346c56d6cb0eb (diff)
downloadtangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar
tangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.gz
tangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.bz2
tangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.lz
tangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.xz
tangerine-consensus-21c420db895b1aa48709982cd145a119c74de6fa.tar.zst
tangerine-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.go12
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) {