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(x/group): extend group config and make it configurable #18448

Merged
merged 16 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (x/group) [#18448](https://github.com/cosmos/cosmos-sdk/pull/18448) Extend group config
Copy link
Member

Choose a reason for hiding this comment

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

Can we get this one and the gov one entry in respectively group/CHANGELOG.md and gov changelog instead of the main one?

* (types) [#18440](https://github.com/cosmos/cosmos-sdk/pull/18440) Add `AmountOfNoValidation` to `sdk.DecCoins`.
* (x/gov) [#18428](https://github.com/cosmos/cosmos-sdk/pull/18428) Extend governance config
* (x/gov) [#18189](https://github.com/cosmos/cosmos-sdk/pull/18189) Limit the accepted deposit coins for a proposal to the minimum proposal deposit denoms.
Expand Down
175 changes: 152 additions & 23 deletions api/cosmos/group/module/v1/module.pulsar.go

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

18 changes: 16 additions & 2 deletions proto/cosmos/group/module/v1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,21 @@ message Module {
google.protobuf.Duration max_execution_period = 1
[(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// max_metadata_len defines the max length of the metadata bytes field for various entities within the group module.
// Defaults to 255 if not explicitly set.
// MaxMetadataLen defines the max chars allowed in all
// messages that allows creating or updating a group
// with a metadata field
// Defaults to 140 if not explicitly set.
Copy link
Member

Choose a reason for hiding this comment

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

This isn't true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out, consequences of copy paste

uint64 max_metadata_len = 2;

// MaxProposalTitleLen defines the max chars allowed
// in string for the MsgSubmitProposal and Proposal
// summary field
// Defaults to 140 if not explicitly set.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out, consequences of copy paste

uint64 max_proposal_title_len = 3;

// MaxProposalSummaryLen defines the max chars allowed
// in string for the MsgSubmitProposal and Proposal
// summary field
// Defaults to 10200 if not explicitly set.
uint64 max_proposal_summary_len = 4;
}
3 changes: 2 additions & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path/filepath"

grouptypes "cosmossdk.io/x/group"
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
abci "github.com/cometbft/cometbft/abci/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
Expand Down Expand Up @@ -346,7 +347,7 @@ func NewSimApp(

app.AuthzKeeper = authzkeeper.NewKeeper(runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.MsgServiceRouter(), app.AuthKeeper)

groupConfig := group.DefaultConfig()
groupConfig := grouptypes.DefaultConfig()
/*
Example of setting group params:
groupConfig.MaxMetadataLen = 1000
Expand Down
20 changes: 0 additions & 20 deletions x/group/config.go

This file was deleted.

19 changes: 11 additions & 8 deletions x/group/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ import "cosmossdk.io/errors"
const groupCodespace = "group"

var (
ErrEmpty = errors.Register(groupCodespace, 2, "value is empty")
ErrDuplicate = errors.Register(groupCodespace, 3, "duplicate value")
ErrMaxLimit = errors.Register(groupCodespace, 4, "limit exceeded")
ErrType = errors.Register(groupCodespace, 5, "invalid type")
ErrInvalid = errors.Register(groupCodespace, 6, "invalid value")
ErrUnauthorized = errors.Register(groupCodespace, 7, "unauthorized")
ErrModified = errors.Register(groupCodespace, 8, "modified")
ErrExpired = errors.Register(groupCodespace, 9, "expired")
ErrEmpty = errors.Register(groupCodespace, 2, "value is empty")
ErrDuplicate = errors.Register(groupCodespace, 3, "duplicate value")
ErrMaxLimit = errors.Register(groupCodespace, 4, "limit exceeded")
ErrType = errors.Register(groupCodespace, 5, "invalid type")
ErrInvalid = errors.Register(groupCodespace, 6, "invalid value")
ErrUnauthorized = errors.Register(groupCodespace, 7, "unauthorized")
ErrModified = errors.Register(groupCodespace, 8, "modified")
ErrExpired = errors.Register(groupCodespace, 9, "expired")
ErrMetadataTooLong = errors.Register(groupCodespace, 10, "metadata too long")
ErrSummaryTooLong = errors.Register(groupCodespace, 11, "summary too long")
ErrTitleTooLong = errors.Register(groupCodespace, 12, "title too long")
)
1 change: 1 addition & 0 deletions x/group/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ require (
replace github.com/cosmos/cosmos-sdk => ../../

replace (
cosmossdk.io/api => ../../api
cosmossdk.io/x/auth => ../auth
cosmossdk.io/x/authz => ../authz
cosmossdk.io/x/bank => ../bank
Expand Down
Loading
Loading