Skip to content

Commit

Permalink
Remove GovernancePenalty
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Dec 17, 2018
1 parent 677ea0a commit 86a214f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
5 changes: 3 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

[[override]]
name = "github.com/tendermint/tendermint"
revision = "v0.27.0"
revision = "v0.27.3"

[[constraint]]
name = "github.com/zondax/ledger-cosmos-go"
Expand Down
5 changes: 2 additions & 3 deletions cmd/gaia/app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ func appStateFn(r *rand.Rand, accs []simulation.Account) json.RawMessage {
VotingPeriod: vp,
},
TallyParams: gov.TallyParams{
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
GovernancePenalty: sdk.NewDecWithPrec(1, 2),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
},
}
fmt.Printf("Selected randomly generated governance parameters:\n\t%+v\n", govGenesis)
Expand Down
13 changes: 3 additions & 10 deletions x/gov/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ func DefaultGenesisState() GenesisState {
VotingPeriod: time.Duration(172800) * time.Second,
},
TallyParams: TallyParams{
Quorum: sdk.NewDecWithPrec(334, 3),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
GovernancePenalty: sdk.NewDecWithPrec(1, 2),
Quorum: sdk.NewDecWithPrec(334, 3),
Threshold: sdk.NewDecWithPrec(5, 1),
Veto: sdk.NewDecWithPrec(334, 3),
},
}
}
Expand All @@ -74,12 +73,6 @@ func ValidateGenesis(data GenesisState) error {
veto.String())
}

govPenalty := data.TallyParams.GovernancePenalty
if govPenalty.IsNegative() || govPenalty.GT(sdk.OneDec()) {
return fmt.Errorf("Governance vote veto threshold should be positive and less or equal to one, is %s",
govPenalty.String())
}

if data.DepositParams.MaxDepositPeriod > data.VotingParams.VotingPeriod {
return fmt.Errorf("Governance deposit period should be less than or equal to the voting period (%ds), is %ds",
data.VotingParams.VotingPeriod, data.DepositParams.MaxDepositPeriod)
Expand Down
7 changes: 3 additions & 4 deletions x/gov/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ type DepositParams struct {

// Param around Tallying votes in governance
type TallyParams struct {
Quorum sdk.Dec `json:"quorum"` // Minimum percentage of total stake needed to vote for a result to be considered valid
Threshold sdk.Dec `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5
Veto sdk.Dec `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3
GovernancePenalty sdk.Dec `json:"governance_penalty"` // Penalty if validator does not vote
Quorum sdk.Dec `json:"quorum"` // Minimum percentage of total stake needed to vote for a result to be considered valid
Threshold sdk.Dec `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5
Veto sdk.Dec `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3
}

// Param around Voting in governance
Expand Down

0 comments on commit 86a214f

Please sign in to comment.