Add raw stake and median to super committee (#2880)
* [rpc][votepower] Add hack * [consensus] Use hack, change from one addr to bls key * update super committee rpc to add rawstake and median to output * only retrieve total delegation once * better name * nil pointer check Co-authored-by: Ganesha Upadhyaya <ganeshrvce@gmail.com>pull/2884/head
parent
451d16c14d
commit
d4b8c11a8c
@ -0,0 +1,20 @@ |
||||
package common |
||||
|
||||
import ( |
||||
"github.com/harmony-one/harmony/consensus/quorum" |
||||
"github.com/harmony-one/harmony/numeric" |
||||
"github.com/harmony-one/harmony/shard" |
||||
) |
||||
|
||||
type setRawStakeHack interface { |
||||
SetRawStake(key shard.BLSPublicKey, d numeric.Dec) |
||||
} |
||||
|
||||
// SetRawStake is a hack, return value is if was successful or not at setting
|
||||
func SetRawStake(q quorum.Decider, key shard.BLSPublicKey, d numeric.Dec) bool { |
||||
if setter, ok := q.(setRawStakeHack); ok { |
||||
setter.SetRawStake(key, d) |
||||
return true |
||||
} |
||||
return false |
||||
} |
Loading…
Reference in new issue