cosmos-sdk/x/gov/types/types.proto

154 lines
6.7 KiB
Protocol Buffer

syntax = "proto3";
package cosmos_sdk.x.gov.v1;
import "types/types.proto";
import "third_party/proto/gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
// MsgSubmitProposalBase defines an sdk.Msg type that supports submitting arbitrary
// proposal Content.
//
// Note, this message type provides the basis for which a true MsgSubmitProposal
// can be constructed. Since the Content submitted in the message can be arbitrary,
// assuming it fulfills the Content interface, it must be defined at the
// application-level and extend MsgSubmitProposalBase.
message MsgSubmitProposalBase {
option (gogoproto.equal) = true;
repeated cosmos_sdk.v1.Coin initial_deposit = 1 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"initial_deposit\""
];
bytes proposer = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgVote defines a message to cast a vote
message MsgVote {
option (gogoproto.equal) = true;
uint64 proposal_id = 1 [
(gogoproto.customname) = "ProposalID",
(gogoproto.moretags) = "yaml:\"proposal_id\"",
(gogoproto.jsontag) = "proposal_id"
];
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
VoteOption option = 3;
}
// MsgDeposit defines a message to submit a deposit to an existing proposal
message MsgDeposit {
option (gogoproto.equal) = true;
uint64 proposal_id = 1 [
(gogoproto.customname) = "ProposalID",
(gogoproto.moretags) = "yaml:\"proposal_id\"",
(gogoproto.jsontag) = "proposal_id"
];
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
repeated cosmos_sdk.v1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// VoteOption defines a vote option
enum VoteOption {
option (gogoproto.enum_stringer) = false;
option (gogoproto.goproto_enum_stringer) = false;
option (gogoproto.goproto_enum_prefix) = false;
EMPTY = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"];
YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"];
ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"];
NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"];
NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"];
}
// TextProposal defines a standard text proposal whose changes need to be
// manually updated in case of approval
message TextProposal {
option (gogoproto.equal) = true;
string title = 1;
string description = 2;
}
// Deposit defines an amount deposited by an account address to an active proposal
message Deposit {
option (gogoproto.equal) = true;
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
repeated cosmos_sdk.v1.Coin amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// ProposalBase defines the core field members of a governance proposal. It includes
// all static fields (i.e fields excluding the dynamic Content). A full proposal
// extends the ProposalBase with Content.
message ProposalBase {
option (gogoproto.goproto_stringer) = true;
option (gogoproto.face) = true;
uint64 proposal_id = 1
[(gogoproto.customname) = "ProposalID", (gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""];
ProposalStatus status = 2 [(gogoproto.moretags) = "yaml:\"proposal_status\""];
TallyResult final_tally_result = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""];
google.protobuf.Timestamp submit_time = 4
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""];
google.protobuf.Timestamp deposit_end_time = 5
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""];
repeated cosmos_sdk.v1.Coin total_deposit = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"total_deposit\""
];
google.protobuf.Timestamp voting_start_time = 7
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""];
google.protobuf.Timestamp voting_end_time = 8
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""];
}
// ProposalStatus is a type alias that represents a proposal status as a byte
enum ProposalStatus {
option (gogoproto.enum_stringer) = false;
option (gogoproto.goproto_enum_stringer) = false;
option (gogoproto.goproto_enum_prefix) = false;
NIL = 0 [(gogoproto.enumvalue_customname) = "StatusNil"];
DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"];
VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"];
PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"];
REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"];
FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"];
}
// TallyResult defines a standard tally for a proposal
message TallyResult {
option (gogoproto.equal) = true;
string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string no_with_veto = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"no_with_veto\""
];
}
// Vote defines a vote on a governance proposal. A vote corresponds to a proposal
// ID, the voter, and the vote option.
message Vote {
option (gogoproto.equal) = true;
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""];
bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
VoteOption option = 3;
}