-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: Add group module proto definitions and basic types #9631
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3464d4e
Add group proto definitions and basic types
blushi ab360a4
Add files
blushi 72d1adb
Merge branch 'master' into marie/7633-group-types
blushi 4af36ff
Lint
blushi dd432c0
Merge branch 'master' into marie/7633-group-types
blushi c1b90e2
Update errors codes
blushi 80756a5
Merge branch 'master' into marie/7633-group-types
blushi a2998c7
Merge branch 'master' into marie/7633-group-types
aaronc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
syntax = "proto3"; | ||
|
||
package cosmos.group.v1beta1; | ||
|
||
import "cosmos/group/v1beta1/types.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/group"; | ||
|
||
// Query is the cosmos.group.v1beta1 Query service. | ||
service Query { | ||
|
||
// GroupInfo queries group info based on group id. | ||
rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse); | ||
|
||
// GroupAccountInfo queries group account info based on group account address. | ||
rpc GroupAccountInfo(QueryGroupAccountInfoRequest) returns (QueryGroupAccountInfoResponse); | ||
|
||
// GroupMembers queries members of a group | ||
rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse); | ||
|
||
// GroupsByAdmin queries groups by admin address. | ||
rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse); | ||
|
||
// GroupAccountsByGroup queries group accounts by group id. | ||
rpc GroupAccountsByGroup(QueryGroupAccountsByGroupRequest) returns (QueryGroupAccountsByGroupResponse); | ||
|
||
// GroupsByAdmin queries group accounts by admin address. | ||
rpc GroupAccountsByAdmin(QueryGroupAccountsByAdminRequest) returns (QueryGroupAccountsByAdminResponse); | ||
|
||
// Proposal queries a proposal based on proposal id. | ||
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse); | ||
|
||
// ProposalsByGroupAccount queries proposals based on group account address. | ||
rpc ProposalsByGroupAccount(QueryProposalsByGroupAccountRequest) returns (QueryProposalsByGroupAccountResponse); | ||
|
||
// VoteByProposalVoter queries a vote by proposal id and voter. | ||
rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse); | ||
|
||
// VotesByProposal queries a vote by proposal. | ||
rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse); | ||
|
||
// VotesByVoter queries a vote by voter. | ||
rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse); | ||
} | ||
|
||
// QueryGroupInfoRequest is the Query/GroupInfo request type. | ||
message QueryGroupInfoRequest { | ||
|
||
// group_id is the unique ID of the group. | ||
uint64 group_id = 1; | ||
} | ||
|
||
// QueryGroupInfoResponse is the Query/GroupInfo response type. | ||
message QueryGroupInfoResponse { | ||
|
||
// info is the GroupInfo for the group. | ||
GroupInfo info = 1; | ||
} | ||
|
||
// QueryGroupAccountInfoRequest is the Query/GroupAccountInfo request type. | ||
message QueryGroupAccountInfoRequest { | ||
|
||
// address is the account address of the group account. | ||
string address = 1; | ||
} | ||
|
||
// QueryGroupAccountInfoResponse is the Query/GroupAccountInfo response type. | ||
message QueryGroupAccountInfoResponse { | ||
|
||
// info is the GroupAccountInfo for the group account. | ||
GroupAccountInfo info = 1; | ||
} | ||
|
||
// QueryGroupMembersRequest is the Query/GroupMembersRequest request type. | ||
message QueryGroupMembersRequest { | ||
|
||
// group_id is the unique ID of the group. | ||
uint64 group_id = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. | ||
message QueryGroupMembersResponse { | ||
|
||
// members are the members of the group with given group_id. | ||
repeated GroupMember members = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryGroupsByAdminRequest is the Query/GroupsByAdminRequest request type. | ||
message QueryGroupsByAdminRequest { | ||
|
||
// admin is the account address of a group's admin. | ||
string admin = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. | ||
message QueryGroupsByAdminResponse { | ||
|
||
// groups are the groups info with the provided admin. | ||
repeated GroupInfo groups = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryGroupAccountsByGroupRequest is the Query/GroupAccountsByGroup request type. | ||
message QueryGroupAccountsByGroupRequest { | ||
|
||
// group_id is the unique ID of the group account's group. | ||
uint64 group_id = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryGroupAccountsByGroupResponse is the Query/GroupAccountsByGroup response type. | ||
message QueryGroupAccountsByGroupResponse { | ||
|
||
// group_accounts are the group accounts info associated with the provided group. | ||
repeated GroupAccountInfo group_accounts = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryGroupAccountsByAdminRequest is the Query/GroupAccountsByAdmin request type. | ||
message QueryGroupAccountsByAdminRequest { | ||
|
||
// admin is the admin address of the group account. | ||
string admin = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryGroupAccountsByAdminResponse is the Query/GroupAccountsByAdmin response type. | ||
message QueryGroupAccountsByAdminResponse { | ||
|
||
// group_accounts are the group accounts info with provided admin. | ||
repeated GroupAccountInfo group_accounts = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryProposalRequest is the Query/Proposal request type. | ||
message QueryProposalRequest { | ||
|
||
// proposal_id is the unique ID of a proposal. | ||
uint64 proposal_id = 1; | ||
} | ||
|
||
// QueryProposalResponse is the Query/Proposal response type. | ||
message QueryProposalResponse { | ||
|
||
// proposal is the proposal info. | ||
Proposal proposal = 1; | ||
} | ||
|
||
// QueryProposalsByGroupAccountRequest is the Query/ProposalByGroupAccount request type. | ||
message QueryProposalsByGroupAccountRequest { | ||
|
||
// address is the group account address related to proposals. | ||
string address = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryProposalsByGroupAccountResponse is the Query/ProposalByGroupAccount response type. | ||
message QueryProposalsByGroupAccountResponse { | ||
|
||
// proposals are the proposals with given group account. | ||
repeated Proposal proposals = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter request type. | ||
message QueryVoteByProposalVoterRequest { | ||
|
||
// proposal_id is the unique ID of a proposal. | ||
uint64 proposal_id = 1; | ||
|
||
// voter is a proposal voter account address. | ||
string voter = 2; | ||
} | ||
|
||
// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. | ||
message QueryVoteByProposalVoterResponse { | ||
|
||
// vote is the vote with given proposal_id and voter. | ||
Vote vote = 1; | ||
} | ||
|
||
// QueryVotesByProposalResponse is the Query/VotesByProposal request type. | ||
message QueryVotesByProposalRequest { | ||
|
||
// proposal_id is the unique ID of a proposal. | ||
uint64 proposal_id = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryVotesByProposalResponse is the Query/VotesByProposal response type. | ||
message QueryVotesByProposalResponse { | ||
|
||
// votes are the list of votes for given proposal_id. | ||
repeated Vote votes = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// QueryVotesByVoterResponse is the Query/VotesByVoter request type. | ||
message QueryVotesByVoterRequest { | ||
// voter is a proposal voter account address. | ||
string voter = 1; | ||
|
||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 2; | ||
} | ||
|
||
// QueryVotesByVoterResponse is the Query/VotesByVoter response type. | ||
message QueryVotesByVoterResponse { | ||
|
||
// votes are the list of votes by given voter. | ||
repeated Vote votes = 1; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not release any more beta protos to production. We can keep this as is for now as long as we make sure to change to v1 after beta QA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good