better display
This commit is contained in:
parent
bd8c481064
commit
6f8a2d562c
|
@ -153,7 +153,6 @@ And the pseudocode for the `ProposalProcessingQueue`:
|
||||||
// End of voting period, tally
|
// End of voting period, tally
|
||||||
|
|
||||||
ProposalProcessingQueue.pop()
|
ProposalProcessingQueue.pop()
|
||||||
|
|
||||||
validators = stakeKeeper.getAllValidators()
|
validators = stakeKeeper.getAllValidators()
|
||||||
tmpValMap := map(sdk.Address)ValidatorGovInfo
|
tmpValMap := map(sdk.Address)ValidatorGovInfo
|
||||||
|
|
||||||
|
@ -161,9 +160,10 @@ And the pseudocode for the `ProposalProcessingQueue`:
|
||||||
for each validator in validators
|
for each validator in validators
|
||||||
tmpValMap(validator).Minus = 0
|
tmpValMap(validator).Minus = 0
|
||||||
|
|
||||||
voterIterator = rangeQuery(Governance, <proposalID|addresses>) //return all the addresses that voted on the proposal
|
|
||||||
|
|
||||||
// Tally
|
// Tally
|
||||||
|
voterIterator = rangeQuery(Governance, <proposalID|addresses>) //return all the addresses that voted on the proposal
|
||||||
for each (voterAddress, vote) in voterIterator
|
for each (voterAddress, vote) in voterIterator
|
||||||
delegations = stakeKeeper.getDelegations(voterAddress) // get all delegations for current voter
|
delegations = stakeKeeper.getDelegations(voterAddress) // get all delegations for current voter
|
||||||
|
|
||||||
|
@ -175,6 +175,8 @@ And the pseudocode for the `ProposalProcessingQueue`:
|
||||||
if (isVal)
|
if (isVal)
|
||||||
tmpValMap(voterAddress).Vote = vote
|
tmpValMap(voterAddress).Vote = vote
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Slash validators that did not vote, or update tally if they voted
|
// Slash validators that did not vote, or update tally if they voted
|
||||||
for each validator in validators
|
for each validator in validators
|
||||||
if (!tmpValMap(validator).HasVoted)
|
if (!tmpValMap(validator).HasVoted)
|
||||||
|
@ -182,6 +184,8 @@ And the pseudocode for the `ProposalProcessingQueue`:
|
||||||
else
|
else
|
||||||
proposal.updateTally(tmpValMap(validator).Vote, (validator.TotalShares - tmpValMap(validator).Minus))
|
proposal.updateTally(tmpValMap(validator).Vote, (validator.TotalShares - tmpValMap(validator).Minus))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check if proposal is accepted or rejected
|
// Check if proposal is accepted or rejected
|
||||||
totalNonAbstain := proposal.YesVotes + proposal.NoVotes + proposal.NoWithVetoVotes
|
totalNonAbstain := proposal.YesVotes + proposal.NoVotes + proposal.NoWithVetoVotes
|
||||||
if (proposal.Votes.YesVotes/totalNonAbstain > proposal.InitProcedure.Threshold AND proposal.Votes.NoWithVetoVotes/totalNonAbstain < proposal.InitProcedure.Veto)
|
if (proposal.Votes.YesVotes/totalNonAbstain > proposal.InitProcedure.Threshold AND proposal.Votes.NoWithVetoVotes/totalNonAbstain < proposal.InitProcedure.Veto)
|
||||||
|
|
Loading…
Reference in New Issue