Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove burning of deposits in gov #11011

Merged
merged 5 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) {
// delete dead proposals from store and burn theirs deposits. A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update the comment here as well

keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta2.Proposal) bool {
keeper.DeleteProposal(ctx, proposal.ProposalId)
keeper.DeleteAndBurnDeposits(ctx, proposal.ProposalId)
keeper.RefundAndDeleteDeposits(ctx, proposal.ProposalId) // refund deposit if proposal got removed without getting 100% of the proposal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a state-machine breaking changelog


// called when proposal become inactive
keeper.AfterProposalFailedMinDeposit(ctx, proposal.ProposalId)
Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta2.Proposal) (passes b
percentVoting := totalVotingPower.Quo(keeper.sk.TotalBondedTokens(ctx).ToDec())
quorum, _ := sdk.NewDecFromStr(tallyParams.Quorum)
if percentVoting.LT(quorum) {
return false, true, tallyResults
return false, false, tallyResults
}

// If no one votes (everyone abstains), proposal fails
Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/tally_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestTallyNoOneVotes(t *testing.T) {
passes, burnDeposits, tallyResults := app.GovKeeper.Tally(ctx, proposal)

require.False(t, passes)
require.True(t, burnDeposits)
require.False(t, burnDeposits)
require.True(t, tallyResults.Equals(v1beta2.EmptyTallyResult()))
}

Expand Down