Alvaro/follow up rolls per key
Add total voting power and other minor issues discussed in #162 (closed)
The opcode VOTING_POWER
from the merged !82 (merged) takes a key hash of a delegate and retrieves the number of rolls in the staking balance of that delegated, as it appears in the voting listings. The voting listings should not be confused with a roll snapshot. The voting listings are calculated at the beginning of each voting period, and only then.
The opcode TOTAL_VOTING_POWER
retrieves the total number of rolls in the staking balance of every delegate in the voting listings, this is, the listings size.
These two opcodes can be used to calculate the relative voting power of a delegate programmatically. This feature enables to perform early polling for preferences on protocol features, thus making governance more dynamic and flexible.