Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Aug 30, 2024
1 parent 60db1a1 commit 829aa8b
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keeper

import (
"fmt"

"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -66,7 +64,6 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
results[option.Option] = results[option.Option].Add(subPower)
}
totalVotingPower = totalVotingPower.Add(votingPower)
fmt.Println("ADD VOTE", votingPower)
}

return false
Expand All @@ -81,7 +78,6 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
if len(val.Vote) == 0 {
continue
}
fmt.Println("VAL DEL SHARES", val.DelegatorShares, val.DelegatorDeductions)

sharesAfterDeductions := val.DelegatorShares.Sub(val.DelegatorDeductions)
votingPower := sharesAfterDeductions.MulInt(val.BondedTokens).Quo(val.DelegatorShares)
Expand All @@ -92,7 +88,6 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
results[option.Option] = results[option.Option].Add(subPower)
}
totalVotingPower = totalVotingPower.Add(votingPower)
fmt.Println("ADD VAL VOTE", votingPower)
}

params := keeper.GetParams(ctx)
Expand All @@ -101,15 +96,13 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool,
// TODO: Upgrade the spec to cover all of these cases & remove pseudocode.
// If there is no staked coins, the proposal fails
totalBondedTokens := keeper.sk.TotalBondedTokens(ctx)
fmt.Println("total bonded", totalBondedTokens, "total voting power", totalVotingPower)
if totalBondedTokens.IsZero() {
return false, false, tallyResults
}

// If there is not enough quorum of votes, the proposal fails
percentVoting := totalVotingPower.Quo(sdk.NewDecFromInt(totalBondedTokens))
quorum, _ := sdk.NewDecFromStr(params.Quorum)
fmt.Println("quorum", quorum, "percentVoting", percentVoting)
if percentVoting.LT(quorum) {
return false, params.BurnVoteQuorum, tallyResults
}
Expand Down

0 comments on commit 829aa8b

Please sign in to comment.