better display

This commit is contained in:
gamarin 2018-06-04 17:34:31 +02:00
parent bd8c481064
commit 6f8a2d562c
1 changed files with 7 additions and 3 deletions

View File

@ -153,17 +153,17 @@ And the pseudocode for the `ProposalProcessingQueue`:
// End of voting period, tally
ProposalProcessingQueue.pop()
validators = stakeKeeper.getAllValidators()
tmpValMap := map(sdk.Address)ValidatorGovInfo
// Initiate mapping at 0. Validators that remain at 0 at the end of tally will be punished
for each validator in validators
tmpValMap(validator).Minus = 0
voterIterator = rangeQuery(Governance, <proposalID|addresses>) //return all the addresses that voted on the proposal
// Tally
voterIterator = rangeQuery(Governance, <proposalID|addresses>) //return all the addresses that voted on the proposal
for each (voterAddress, vote) in voterIterator
delegations = stakeKeeper.getDelegations(voterAddress) // get all delegations for current voter
@ -175,6 +175,8 @@ And the pseudocode for the `ProposalProcessingQueue`:
if (isVal)
tmpValMap(voterAddress).Vote = vote
// Slash validators that did not vote, or update tally if they voted
for each validator in validators
if (!tmpValMap(validator).HasVoted)
@ -182,6 +184,8 @@ And the pseudocode for the `ProposalProcessingQueue`:
else
proposal.updateTally(tmpValMap(validator).Vote, (validator.TotalShares - tmpValMap(validator).Minus))
// Check if proposal is accepted or rejected
totalNonAbstain := proposal.YesVotes + proposal.NoVotes + proposal.NoWithVetoVotes
if (proposal.Votes.YesVotes/totalNonAbstain > proposal.InitProcedure.Threshold AND proposal.Votes.NoWithVetoVotes/totalNonAbstain < proposal.InitProcedure.Veto)