Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Jun 10, 2024
1 parent 736d39a commit d4997af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions x/gov/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#18762](https://github.com/cosmos/cosmos-sdk/pull/18762) Add multiple choice proposals.
* [#18856](https://github.com/cosmos/cosmos-sdk/pull/18856) Add `ProposalCancelMaxPeriod` parameters.
* [#19167](https://github.com/cosmos/cosmos-sdk/pull/19167) Add `YesQuorum` parameter.
* [#20348](https://github.com/cosmos/cosmos-sdk/pull/20348) Limit gov exectution of proposals to a max gas limit. The limit was added to parameters and can be modified

### Client Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion x/gov/proto/cosmos/gov/v1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ message Params {
// considered valid for an expedited proposal.
string expedited_quorum = 21 [(cosmos_proto.scalar) = "cosmos.Dec", (cosmos_proto.field_added_in) = "x/gov v1.0.0"];

uint64 proposal_execution_gas = 22 [(cosmos_proto.field_added_in) = "x/gov v1.0.0"];
uint64 proposal_execution_gas = 22 [(cosmos_proto.field_added_in) = "x/gov v0.2.0"];
}

// MessageBasedParams defines the parameters of specific messages in a proposal.
Expand Down
4 changes: 4 additions & 0 deletions x/gov/types/v1/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error {
}
}

if p.ProposalExecutionGas == 0 {
return fmt.Errorf("proposal execution gas must be positive: %d", p.ProposalExecutionGas)
}

return nil
}

Expand Down

0 comments on commit d4997af

Please sign in to comment.