Skip to content

Proposal tally not increasing after voting #2859

Closed
@fedekunze

Description

Summary of Bug

The proposal Tally Result is not increasing after submitting a vote.

Ref: luniehq/lunie#1591

Steps to Reproduce

Added a test case on lcd_test.go and failed.

We are not increasing the proposal tally after voting:

cosmos-sdk/x/gov/keeper.go

Lines 288 to 309 in 6e813ab

func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, option VoteOption) sdk.Error {
proposal := keeper.GetProposal(ctx, proposalID)
if proposal == nil {
return ErrUnknownProposal(keeper.codespace, proposalID)
}
if proposal.GetStatus() != StatusVotingPeriod {
return ErrInactiveProposal(keeper.codespace, proposalID)
}
if !validVoteOption(option) {
return ErrInvalidVote(keeper.codespace, option)
}
vote := Vote{
ProposalID: proposalID,
Voter: voterAddr,
Option: option,
}
keeper.setVote(ctx, proposalID, voterAddr, vote)
return nil
}

Actionable Item(s):

  • Rename the field tally_result => final_tally_result

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions