|
|
@ -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 { |
|
|
|