|
|
@ -195,6 +195,7 @@ func (v *stakedVoteWeight) MarshalJSON() ([]byte, error) { |
|
|
|
type t struct { |
|
|
|
type t struct { |
|
|
|
Policy string `json:"policy"` |
|
|
|
Policy string `json:"policy"` |
|
|
|
Count int `json:"count"` |
|
|
|
Count int `json:"count"` |
|
|
|
|
|
|
|
Externals int `json:"external-validator-slot-count"` |
|
|
|
Participants []u `json:"committee-members"` |
|
|
|
Participants []u `json:"committee-members"` |
|
|
|
HmyVotingPower string `json:"hmy-voting-power"` |
|
|
|
HmyVotingPower string `json:"hmy-voting-power"` |
|
|
|
StakedVotingPower string `json:"staked-voting-power"` |
|
|
|
StakedVotingPower string `json:"staked-voting-power"` |
|
|
@ -202,7 +203,7 @@ func (v *stakedVoteWeight) MarshalJSON() ([]byte, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
parts := make([]u, voterCount) |
|
|
|
parts := make([]u, voterCount) |
|
|
|
i := 0 |
|
|
|
i, externalCount := 0, 0 |
|
|
|
|
|
|
|
|
|
|
|
for identity, voter := range v.roster.Voters { |
|
|
|
for identity, voter := range v.roster.Voters { |
|
|
|
member := u{ |
|
|
|
member := u{ |
|
|
@ -214,6 +215,7 @@ func (v *stakedVoteWeight) MarshalJSON() ([]byte, error) { |
|
|
|
"", |
|
|
|
"", |
|
|
|
} |
|
|
|
} |
|
|
|
if !voter.IsHarmonyNode { |
|
|
|
if !voter.IsHarmonyNode { |
|
|
|
|
|
|
|
externalCount++ |
|
|
|
member.EffectiveStake = voter.EffectiveStake.String() |
|
|
|
member.EffectiveStake = voter.EffectiveStake.String() |
|
|
|
} |
|
|
|
} |
|
|
|
parts[i] = member |
|
|
|
parts[i] = member |
|
|
@ -223,6 +225,7 @@ func (v *stakedVoteWeight) MarshalJSON() ([]byte, error) { |
|
|
|
return json.Marshal(t{ |
|
|
|
return json.Marshal(t{ |
|
|
|
v.Policy().String(), |
|
|
|
v.Policy().String(), |
|
|
|
voterCount, |
|
|
|
voterCount, |
|
|
|
|
|
|
|
externalCount, |
|
|
|
parts, |
|
|
|
parts, |
|
|
|
v.roster.OurVotingPowerTotalPercentage.String(), |
|
|
|
v.roster.OurVotingPowerTotalPercentage.String(), |
|
|
|
v.roster.TheirVotingPowerTotalPercentage.String(), |
|
|
|
v.roster.TheirVotingPowerTotalPercentage.String(), |
|
|
|