make submitVote private

pull/3419/head
Rongjian Lan 4 years ago
parent ff9a85ac48
commit d3eeb15ce7
  1. 4
      consensus/construct_test.go
  2. 2
      consensus/quorum/one-node-one-vote.go
  3. 2
      consensus/quorum/one-node-staked-vote.go
  4. 14
      consensus/quorum/quorom_test.go
  5. 2
      consensus/quorum/quorum.go

@ -73,7 +73,7 @@ func TestConstructPreparedMessage(test *testing.T) {
leaderKey.FromLibBLSPublicKey(leaderPubKey)
validatorKey := bls.SerializedPublicKey{}
validatorKey.FromLibBLSPublicKey(validatorPubKey)
consensus.Decider.SubmitVote(
consensus.Decider.submitVote(
quorum.Prepare,
[]bls.SerializedPublicKey{leaderKey},
leaderPriKey.Sign(message),
@ -81,7 +81,7 @@ func TestConstructPreparedMessage(test *testing.T) {
consensus.blockNum,
consensus.GetCurBlockViewID(),
)
if _, err := consensus.Decider.SubmitVote(
if _, err := consensus.Decider.submitVote(
quorum.Prepare,
[]bls.SerializedPublicKey{validatorKey},
validatorPriKey.Sign(message),

@ -36,7 +36,7 @@ func (v *uniformVoteWeight) AddNewVote(
for i, pubKey := range pubKeys {
pubKeysBytes[i] = pubKey.Bytes
}
return v.SubmitVote(p, pubKeysBytes, sig, headerHash, height, viewID)
return v.submitVote(p, pubKeysBytes, sig, headerHash, height, viewID)
}
// IsQuorumAchieved ..

@ -82,7 +82,7 @@ func (v *stakedVoteWeight) AddNewVote(
pubKeysBytes[i] = pubKey.Bytes
}
ballet, err := v.SubmitVote(p, pubKeysBytes, sig, headerHash, height, viewID)
ballet, err := v.submitVote(p, pubKeysBytes, sig, headerHash, height, viewID)
if err != nil {
return ballet, err

@ -88,7 +88,7 @@ func TestSubmitVote(test *testing.T) {
decider.UpdateParticipants([]bls.PublicKeyWrapper{pubKeyWrapper1, pubKeyWrapper2})
if _, err := decider.SubmitVote(
if _, err := decider.submitVote(
Prepare,
[]bls.SerializedPublicKey{pubKeyWrapper1.Bytes},
blsPriKey1.Sign(message),
@ -99,7 +99,7 @@ func TestSubmitVote(test *testing.T) {
test.Log(err)
}
if _, err := decider.SubmitVote(
if _, err := decider.submitVote(
Prepare,
[]bls.SerializedPublicKey{pubKeyWrapper2.Bytes},
blsPriKey2.Sign(message),
@ -110,7 +110,7 @@ func TestSubmitVote(test *testing.T) {
test.Log(err)
}
if decider.SignersCount(Prepare) != 2 {
test.Fatal("SubmitVote failed")
test.Fatal("submitVote failed")
}
aggSig := &bls_core.Sign{}
@ -145,7 +145,7 @@ func TestSubmitVoteAggregateSig(test *testing.T) {
decider.UpdateParticipants([]bls.PublicKeyWrapper{pubKeyWrapper1, pubKeyWrapper2})
decider.SubmitVote(
decider.submitVote(
Prepare,
[]bls.SerializedPublicKey{pubKeyWrapper1.Bytes},
blsPriKey1.SignHash(blockHash[:]),
@ -160,7 +160,7 @@ func TestSubmitVoteAggregateSig(test *testing.T) {
aggSig.Add(s)
}
}
if _, err := decider.SubmitVote(
if _, err := decider.submitVote(
Prepare,
[]bls.SerializedPublicKey{pubKeyWrapper2.Bytes, pubKeyWrapper3.Bytes},
aggSig,
@ -172,7 +172,7 @@ func TestSubmitVoteAggregateSig(test *testing.T) {
}
if decider.SignersCount(Prepare) != 3 {
test.Fatal("SubmitVote failed")
test.Fatal("submitVote failed")
}
aggSig.Add(blsPriKey1.SignHash(blockHash[:]))
@ -180,7 +180,7 @@ func TestSubmitVoteAggregateSig(test *testing.T) {
test.Fatal("AggregateVotes failed")
}
if _, err := decider.SubmitVote(
if _, err := decider.submitVote(
Prepare,
[]bls.SerializedPublicKey{pubKeyWrapper2.Bytes},
aggSig,

@ -81,7 +81,7 @@ type ParticipantTracker interface {
// SignatoryTracker ..
type SignatoryTracker interface {
ParticipantTracker
SubmitVote(
submitVote(
p Phase, pubkeys []bls.SerializedPublicKey,
sig *bls_core.Sign, headerHash common.Hash,
height, viewID uint64,

Loading…
Cancel
Save