2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
2024-05-01 03:56:00 +00:00
|
|
|
package zgc.committee.v1beta1;
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
|
|
|
import "cosmos_proto/cosmos.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "google/protobuf/any.proto";
|
2022-11-22 23:22:07 +00:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2024-05-01 03:56:00 +00:00
|
|
|
import "zgc/committee/v1beta1/genesis.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
option go_package = "github.com/0glabs/0g-chain/x/committee/types";
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
|
|
|
|
// Query defines the gRPC querier service for committee module
|
|
|
|
service Query {
|
|
|
|
// Committees queries all committess of the committee module.
|
|
|
|
rpc Committees(QueryCommitteesRequest) returns (QueryCommitteesResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/committees";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Committee queries a committee based on committee ID.
|
|
|
|
rpc Committee(QueryCommitteeRequest) returns (QueryCommitteeResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/committees/{committee_id}";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Proposals queries proposals based on committee ID.
|
|
|
|
rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/proposals";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Deposits queries a proposal based on proposal ID.
|
|
|
|
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// NextProposalID queries the next proposal ID of the committee module.
|
|
|
|
rpc NextProposalID(QueryNextProposalIDRequest) returns (QueryNextProposalIDResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/next-proposal-id";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Votes queries all votes for a single proposal ID.
|
|
|
|
rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/votes";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Vote queries the vote of a single voter for a single proposal ID.
|
|
|
|
rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/votes/{voter}";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// Tally queries the tally of a single proposal ID.
|
|
|
|
rpc Tally(QueryTallyRequest) returns (QueryTallyResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/tally";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
// RawParams queries the raw params data of any subspace and key.
|
|
|
|
rpc RawParams(QueryRawParamsRequest) returns (QueryRawParamsResponse) {
|
2024-05-01 17:43:59 +00:00
|
|
|
option (google.api.http).get = "/0g/committee/v1beta1/raw-params";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryCommitteesRequest defines the request type for querying x/committee committees.
|
|
|
|
message QueryCommitteesRequest {}
|
|
|
|
|
|
|
|
// QueryCommitteesResponse defines the response type for querying x/committee committees.
|
|
|
|
message QueryCommitteesResponse {
|
|
|
|
repeated google.protobuf.Any committees = 1 [(cosmos_proto.accepts_interface) = "Committee"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryCommitteeRequest defines the request type for querying x/committee committee.
|
|
|
|
message QueryCommitteeRequest {
|
|
|
|
uint64 committee_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryCommitteeResponse defines the response type for querying x/committee committee.
|
|
|
|
message QueryCommitteeResponse {
|
|
|
|
google.protobuf.Any committee = 1 [(cosmos_proto.accepts_interface) = "Committee"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryProposalsRequest defines the request type for querying x/committee proposals.
|
|
|
|
message QueryProposalsRequest {
|
|
|
|
uint64 committee_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryProposalsResponse defines the response type for querying x/committee proposals.
|
|
|
|
message QueryProposalsResponse {
|
|
|
|
repeated QueryProposalResponse proposals = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryProposalRequest defines the request type for querying x/committee proposal.
|
|
|
|
message QueryProposalRequest {
|
|
|
|
uint64 proposal_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryProposalResponse defines the response type for querying x/committee proposal.
|
|
|
|
message QueryProposalResponse {
|
2022-11-22 23:22:07 +00:00
|
|
|
google.protobuf.Any pub_proposal = 1 [
|
|
|
|
(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content",
|
|
|
|
(gogoproto.customname) = "PubProposal"
|
|
|
|
];
|
|
|
|
uint64 id = 2 [(gogoproto.customname) = "ID"];
|
|
|
|
uint64 committee_id = 3 [(gogoproto.customname) = "CommitteeID"];
|
|
|
|
google.protobuf.Timestamp deadline = 4 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.stdtime) = true
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryNextProposalIDRequest defines the request type for querying x/committee NextProposalID.
|
|
|
|
message QueryNextProposalIDRequest {}
|
|
|
|
|
|
|
|
// QueryNextProposalIDRequest defines the response type for querying x/committee NextProposalID.
|
|
|
|
message QueryNextProposalIDResponse {
|
|
|
|
uint64 next_proposal_id = 1 [(gogoproto.customname) = "NextProposalID"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryVotesRequest defines the request type for querying x/committee votes.
|
|
|
|
message QueryVotesRequest {
|
2022-11-22 23:22:07 +00:00
|
|
|
uint64 proposal_id = 1;
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryVotesResponse defines the response type for querying x/committee votes.
|
|
|
|
message QueryVotesResponse {
|
|
|
|
// votes defined the queried votes.
|
|
|
|
repeated QueryVoteResponse votes = 1 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryVoteRequest defines the request type for querying x/committee vote.
|
|
|
|
message QueryVoteRequest {
|
|
|
|
uint64 proposal_id = 1;
|
2022-11-22 23:22:07 +00:00
|
|
|
string voter = 2;
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryVoteResponse defines the response type for querying x/committee vote.
|
|
|
|
message QueryVoteResponse {
|
2022-11-22 23:22:07 +00:00
|
|
|
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID"];
|
|
|
|
string voter = 2;
|
|
|
|
VoteType vote_type = 3;
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryTallyRequest defines the request type for querying x/committee tally.
|
|
|
|
message QueryTallyRequest {
|
|
|
|
uint64 proposal_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryTallyResponse defines the response type for querying x/committee tally.
|
|
|
|
message QueryTallyResponse {
|
|
|
|
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID"];
|
2022-11-22 23:22:07 +00:00
|
|
|
string yes_votes = 2 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string no_votes = 3 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string current_votes = 4 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string possible_votes = 5 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string vote_threshold = 6 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
|
|
|
string quorum = 7 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryRawParamsRequest defines the request type for querying x/committee raw params.
|
|
|
|
message QueryRawParamsRequest {
|
|
|
|
string subspace = 1;
|
2022-11-22 23:22:07 +00:00
|
|
|
string key = 2;
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryRawParamsResponse defines the response type for querying x/committee raw params.
|
|
|
|
message QueryRawParamsResponse {
|
|
|
|
string raw_data = 1;
|
|
|
|
}
|