[PR] Address PR comments #1

pull/1850/head
Edgar Aroutiounian 5 years ago
parent a1f637f990
commit 0114330744
  1. 6
      consensus/quorum/one-node-staked-vote.go
  2. 2
      consensus/quorum/quorum.go

@ -28,7 +28,7 @@ type stakedVoteWeight struct {
DependencyInjectionWriter DependencyInjectionWriter
DependencyInjectionReader DependencyInjectionReader
slash.ThresholdDecider slash.ThresholdDecider
validatorStakes map[[shard.PublicKeySizeInBytes]byte]stakedVoter validatorStakes map[shard.BlsPublicKey]stakedVoter
total numeric.Dec total numeric.Dec
} }
@ -48,7 +48,7 @@ func (v *stakedVoteWeight) IsQuorumAchieved(p Phase) bool {
w.FromLibBLSPublicKey(members[i]) w.FromLibBLSPublicKey(members[i])
// isHMY := v.validatorStakes[w].isHarmonyNode // isHMY := v.validatorStakes[w].isHarmonyNode
if v.ReadSignature(p, members[i]) == nil { if v.ReadSignature(p, members[i]) == nil {
// // TODO TODO finish this logic
} }
} }
@ -104,7 +104,7 @@ func (v *stakedVoteWeight) Award(
func (v *stakedVoteWeight) UpdateVotingPower(staked shard.SlotList) { func (v *stakedVoteWeight) UpdateVotingPower(staked shard.SlotList) {
s, _ := v.ShardIDProvider()() s, _ := v.ShardIDProvider()()
v.validatorStakes = map[[shard.PublicKeySizeInBytes]byte]stakedVoter{} v.validatorStakes = map[shard.BlsPublicKey]stakedVoter{}
v.Reset([]Phase{Prepare, Commit, ViewChange}) v.Reset([]Phase{Prepare, Commit, ViewChange})
for i := range staked { for i := range staked {

@ -297,7 +297,7 @@ func NewDecider(p Policy) Decider {
c.DependencyInjectionWriter, c.DependencyInjectionWriter,
c.DependencyInjectionWriter.(DependencyInjectionReader), c.DependencyInjectionWriter.(DependencyInjectionReader),
c.SignatureReader.(slash.ThresholdDecider), c.SignatureReader.(slash.ThresholdDecider),
map[[shard.PublicKeySizeInBytes]byte]stakedVoter{}, map[shard.BlsPublicKey]stakedVoter{},
numeric.ZeroDec(), numeric.ZeroDec(),
} }
default: default:

Loading…
Cancel
Save