Skip to content

Commit

Permalink
feat(gov): disable validator vote inheritance (#5)
Browse files Browse the repository at this point in the history
* feat(gov): disable validator vote inheritance

* Update x/gov/keeper/tally_test.go

Co-authored-by: Giuseppe Natale <[email protected]>

---------

Co-authored-by: Giuseppe Natale <[email protected]>
  • Loading branch information
tbruyelle and giunatale authored Sep 11, 2024
1 parent cf0b5c7 commit 57cef19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
return false
})

/* DISABLED on AtomOne - Voting can only be done with your own stake
// iterate over the validators again to tally their voting power
for _, val := range currValidators {
if len(val.Vote) == 0 {
Expand All @@ -89,6 +90,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
}
totalVotingPower = totalVotingPower.Add(votingPower)
}
*/

params := keeper.GetParams(ctx)
tallyResults = v1.NewTallyResultFromMap(results)
Expand Down
6 changes: 3 additions & 3 deletions x/gov/keeper/tally_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ func TestTally(t *testing.T) {
},
},
{
name: "validator votes yes, inherit delegations",
name: "validator votes yes, doesn't inherit delegations",
setup: func(s *tallyFixture) {
s.delegate(s.delAddrs[0], s.valAddrs[0], 2)
s.delegate(s.delAddrs[1], s.valAddrs[0], 2)
s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO)
},
expectedPass: false,
expectedBurn: false,
expectedBurn: true, // burn because quorum not reached
expectedTally: v1.TallyResult{
YesCount: "0",
AbstainCount: "0",
NoCount: "5",
NoCount: "1",
NoWithVetoCount: "0",
},
},
Expand Down

0 comments on commit 57cef19

Please sign in to comment.