Documentation ¶
Index ¶
- Variables
- func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error
- func ParamKeyTable() params.KeyTable
- func ProposalHandler(_ sdk.Context, c govtypes.Content) error
- func ValidProposalStatus(status ProposalStatus) bool
- type Deposit
- func (*Deposit) Descriptor() ([]byte, []int)
- func (m *Deposit) Marshal() (dAtA []byte, err error)
- func (m *Deposit) MarshalTo(dAtA []byte) (int, error)
- func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Deposit) ProtoMessage()
- func (m *Deposit) Reset()
- func (m *Deposit) Size() (n int)
- func (m *Deposit) Unmarshal(dAtA []byte) error
- func (m *Deposit) XXX_DiscardUnknown()
- func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Deposit) XXX_Merge(src proto.Message)
- func (m *Deposit) XXX_Size() int
- func (m *Deposit) XXX_Unmarshal(b []byte) error
- type DepositParams
- func (*DepositParams) Descriptor() ([]byte, []int)
- func (dp DepositParams) Equal(dp2 DepositParams) bool
- func (m *DepositParams) Marshal() (dAtA []byte, err error)
- func (m *DepositParams) MarshalTo(dAtA []byte) (int, error)
- func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DepositParams) ProtoMessage()
- func (m *DepositParams) Reset()
- func (m *DepositParams) Size() (n int)
- func (dp DepositParams) String() string
- func (m *DepositParams) Unmarshal(dAtA []byte) error
- func (m *DepositParams) XXX_DiscardUnknown()
- func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DepositParams) XXX_Merge(src proto.Message)
- func (m *DepositParams) XXX_Size() int
- func (m *DepositParams) XXX_Unmarshal(b []byte) error
- type Deposits
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Params
- type Proposal
- func (*Proposal) Descriptor() ([]byte, []int)
- func (this *Proposal) Equal(that interface{}) bool
- func (p Proposal) GetContent() govtypes.Content
- func (p Proposal) GetTitle() string
- func (p Proposal) HasSecurityVoting() bool
- func (m *Proposal) Marshal() (dAtA []byte, err error)
- func (m *Proposal) MarshalTo(dAtA []byte) (int, error)
- func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p Proposal) ProposalRoute() string
- func (p Proposal) ProposalType() string
- func (*Proposal) ProtoMessage()
- func (m *Proposal) Reset()
- func (m *Proposal) Size() (n int)
- func (p Proposal) String() string
- func (m *Proposal) Unmarshal(dAtA []byte) error
- func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error
- func (m *Proposal) XXX_DiscardUnknown()
- func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Proposal) XXX_Merge(src proto.Message)
- func (m *Proposal) XXX_Size() int
- func (m *Proposal) XXX_Unmarshal(b []byte) error
- type ProposalQueue
- type ProposalStatus
- func (ProposalStatus) EnumDescriptor() ([]byte, []int)
- func (status ProposalStatus) Format(s fmt.State, verb rune)
- func (status ProposalStatus) Marshal() ([]byte, error)
- func (status ProposalStatus) MarshalJSON() ([]byte, error)
- func (x ProposalStatus) String() string
- func (status *ProposalStatus) Unmarshal(data []byte) error
- func (status *ProposalStatus) UnmarshalJSON(data []byte) error
- type Proposals
- type TallyParams
- func (*TallyParams) Descriptor() ([]byte, []int)
- func (m *TallyParams) Marshal() (dAtA []byte, err error)
- func (m *TallyParams) MarshalTo(dAtA []byte) (int, error)
- func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TallyParams) ProtoMessage()
- func (m *TallyParams) Reset()
- func (m *TallyParams) Size() (n int)
- func (tp TallyParams) String() string
- func (m *TallyParams) Unmarshal(dAtA []byte) error
- func (m *TallyParams) XXX_DiscardUnknown()
- func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TallyParams) XXX_Merge(src proto.Message)
- func (m *TallyParams) XXX_Size() int
- func (m *TallyParams) XXX_Unmarshal(b []byte) error
- type Vote
- func (*Vote) Descriptor() ([]byte, []int)
- func (m *Vote) Marshal() (dAtA []byte, err error)
- func (m *Vote) MarshalTo(dAtA []byte) (int, error)
- func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Vote) ProtoMessage()
- func (m *Vote) Reset()
- func (m *Vote) Size() (n int)
- func (m *Vote) Unmarshal(dAtA []byte) error
- func (m *Vote) XXX_DiscardUnknown()
- func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Vote) XXX_Merge(src proto.Message)
- func (m *Vote) XXX_Size() int
- func (m *Vote) XXX_Unmarshal(b []byte) error
- type Votes
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") )
var ( ParamStoreKeyDepositParams = []byte("depositparams") ParamStoreKeyVotingParams = []byte("votingparams") ParamStoreKeyTallyParams = []byte("tallyparams") )
parameter store keys
var ProposalStatus_name = map[int32]string{
0: "PROPOSAL_STATUS_UNSPECIFIED",
1: "PROPOSAL_STATUS_DEPOSIT_PERIOD",
2: "PROPOSAL_STATUS_CERTIFIER_VOTING_PERIOD",
3: "PROPOSAL_STATUS_VALIDATOR_VOTING_PERIOD",
4: "PROPOSAL_STATUS_PASSED",
5: "PROPOSAL_STATUS_REJECTED",
6: "PROPOSAL_STATUS_FAILED",
}
var ProposalStatus_value = map[string]int32{
"PROPOSAL_STATUS_UNSPECIFIED": 0,
"PROPOSAL_STATUS_DEPOSIT_PERIOD": 1,
"PROPOSAL_STATUS_CERTIFIER_VOTING_PERIOD": 2,
"PROPOSAL_STATUS_VALIDATOR_VOTING_PERIOD": 3,
"PROPOSAL_STATUS_PASSED": 4,
"PROPOSAL_STATUS_REJECTED": 5,
"PROPOSAL_STATUS_FAILED": 6,
}
Functions ¶
func MigrateStore ¶
MigrateStore performs migration of votes. Specifically, it performs: - Conversion of votes from custom type to Cosmos SDK type
func ParamKeyTable ¶
ParamKeyTable is the key declaration for parameters.
func ProposalHandler ¶
ProposalHandler implements the Handler interface for governance module-based proposals (ie. TextProposal and SoftwareUpgradeProposal). Since these are merely signaling mechanisms at the moment and do not affect state, it performs a no-op.
func ValidProposalStatus ¶
func ValidProposalStatus(status ProposalStatus) bool
ValidProposalStatus returns true if the proposal status is valid and false otherwise.
Types ¶
type Deposit ¶
type Deposit struct { *types.Deposit `protobuf:"bytes,1,opt,name=deposit,proto3,embedded=deposit" json:"deposit,omitempty"` TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty" yaml:"txhash"` }
Deposit defines an amount deposited by an account address to an active proposal.
func (*Deposit) Descriptor ¶
func (*Deposit) MarshalToSizedBuffer ¶
func (*Deposit) ProtoMessage ¶
func (*Deposit) ProtoMessage()
func (*Deposit) XXX_DiscardUnknown ¶
func (m *Deposit) XXX_DiscardUnknown()
func (*Deposit) XXX_Marshal ¶
func (*Deposit) XXX_Unmarshal ¶
type DepositParams ¶
type DepositParams struct { // Minimum deposit for a proposal to enter voting period. MinInitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `` /* 195-byte string literal not displayed */ // Minimum deposit for a proposal to enter voting period. MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `` /* 164-byte string literal not displayed */ // Maximum period for CTK holders to deposit on a proposal. Initial value: 2 // months. MaxDepositPeriod time.Duration `` /* 149-byte string literal not displayed */ }
DepositParams defines the params for deposits on governance proposals.
func NewDepositParams ¶
func NewDepositParams(minInitialDeposit, minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams
NewDepositParams creates a new DepositParams object
func (*DepositParams) Descriptor ¶
func (*DepositParams) Descriptor() ([]byte, []int)
func (DepositParams) Equal ¶
func (dp DepositParams) Equal(dp2 DepositParams) bool
Equal checks equality of DepositParams
func (*DepositParams) Marshal ¶
func (m *DepositParams) Marshal() (dAtA []byte, err error)
func (*DepositParams) MarshalToSizedBuffer ¶
func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*DepositParams) ProtoMessage ¶
func (*DepositParams) ProtoMessage()
func (*DepositParams) Reset ¶
func (m *DepositParams) Reset()
func (*DepositParams) Size ¶
func (m *DepositParams) Size() (n int)
func (DepositParams) String ¶
func (dp DepositParams) String() string
func (*DepositParams) Unmarshal ¶
func (m *DepositParams) Unmarshal(dAtA []byte) error
func (*DepositParams) XXX_DiscardUnknown ¶
func (m *DepositParams) XXX_DiscardUnknown()
func (*DepositParams) XXX_Marshal ¶
func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DepositParams) XXX_Merge ¶
func (m *DepositParams) XXX_Merge(src proto.Message)
func (*DepositParams) XXX_Size ¶
func (m *DepositParams) XXX_Size() int
func (*DepositParams) XXX_Unmarshal ¶
func (m *DepositParams) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct { // starting_proposal_id is the ID of the starting proposal. StartingProposalId uint64 `` /* 146-byte string literal not displayed */ // deposits defines all the deposits present at genesis. Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` // votes defines all the votes present at genesis. Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` // params defines all the parameters of related to deposit. DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"` // params defines all the parameters of related to voting. VotingParams types.VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"` // params defines all the parameters of related to tally. TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"` }
GenesisState defines the gov module's genesis state.
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type Params ¶
type Params struct { VotingParams govtypes.VotingParams `json:"voting_params" yaml:"voting_params"` TallyParams TallyParams `json:"tally_params" yaml:"tally_params"` DepositParams DepositParams `json:"deposit_params" yaml:"deposit_parmas"` }
Params returns all of the governance params
func NewParams ¶
func NewParams(vp govtypes.VotingParams, tp TallyParams, dp DepositParams) Params
NewParams returns a Params structs including voting, deposit and tally params
type Proposal ¶
type Proposal struct { Content *types2.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` ProposalId uint64 `protobuf:"varint,2,opt,name=proposal_id,json=proposalId,proto3" json:"id" yaml:"id"` Status ProposalStatus `` /* 129-byte string literal not displayed */ IsProposerCouncilMember bool `` /* 169-byte string literal not displayed */ ProposerAddress string `` /* 130-byte string literal not displayed */ FinalTallyResult types.TallyResult `` /* 127-byte string literal not displayed */ SubmitTime time.Time `protobuf:"bytes,7,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time" yaml:"submit_time"` DepositEndTime time.Time `` /* 127-byte string literal not displayed */ TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `` /* 162-byte string literal not displayed */ VotingStartTime time.Time `` /* 132-byte string literal not displayed */ VotingEndTime time.Time `protobuf:"bytes,11,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time" yaml:"voting_end_time"` }
func NewProposal ¶
func NewProposal(content govtypes.Content, id uint64, proposerAddress sdk.AccAddress, isProposerCouncilMember bool, submitTime time.Time, depositEndTime time.Time) (Proposal, error)
NewProposal creates a new Proposal instance
func (*Proposal) Descriptor ¶
func (Proposal) GetContent ¶
GetContent returns the proposal Content
func (Proposal) HasSecurityVoting ¶
HasSecurityVoting returns true if the proposal needs to go through security (certifier) voting before stake (validator) voting.
func (*Proposal) MarshalToSizedBuffer ¶
func (Proposal) ProposalRoute ¶
func (Proposal) ProposalType ¶
func (*Proposal) ProtoMessage ¶
func (*Proposal) ProtoMessage()
func (Proposal) UnpackInterfaces ¶
func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
func (*Proposal) XXX_DiscardUnknown ¶
func (m *Proposal) XXX_DiscardUnknown()
func (*Proposal) XXX_Marshal ¶
func (*Proposal) XXX_Unmarshal ¶
type ProposalQueue ¶
type ProposalQueue []uint64
ProposalQueue is a type alias that represents a list of proposal IDs.
type ProposalStatus ¶
type ProposalStatus int32
ProposalStatus enumerates the valid statuses of a proposal.
const ( // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. StatusNil ProposalStatus = 0 // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit // period. StatusDepositPeriod ProposalStatus = 1 // PROPOSAL_STATUS_VOTING_PERIOD defines a certifier voting period status. StatusCertifierVotingPeriod ProposalStatus = 2 // PROPOSAL_STATUS_VOTING_PERIOD defines a validator voting period status. StatusValidatorVotingPeriod ProposalStatus = 3 // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has // passed. StatusPassed ProposalStatus = 4 // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has // been rejected. StatusRejected ProposalStatus = 5 // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. StatusFailed ProposalStatus = 6 )
func ProposalStatusFromString ¶
func ProposalStatusFromString(str string) (ProposalStatus, error)
ProposalStatusFromString turns a string into a ProposalStatus.
func (ProposalStatus) EnumDescriptor ¶
func (ProposalStatus) EnumDescriptor() ([]byte, []int)
func (ProposalStatus) Format ¶
func (status ProposalStatus) Format(s fmt.State, verb rune)
Format implements the fmt.Formatter interface.
func (ProposalStatus) Marshal ¶
func (status ProposalStatus) Marshal() ([]byte, error)
Marshal implements the Marshal method for protobuf compatibility.
func (ProposalStatus) MarshalJSON ¶
func (status ProposalStatus) MarshalJSON() ([]byte, error)
MarshalJSON marshals to JSON using string.
func (ProposalStatus) String ¶
func (x ProposalStatus) String() string
func (*ProposalStatus) Unmarshal ¶
func (status *ProposalStatus) Unmarshal(data []byte) error
Unmarshal implements the Unmarshal method for protobuf compatibility.
func (*ProposalStatus) UnmarshalJSON ¶
func (status *ProposalStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals from JSON assuming Bech32 encoding.
type Proposals ¶
type Proposals []Proposal
Proposals is an array of proposals.
func (Proposals) UnpackInterfaces ¶
func (p Proposals) UnpackInterfaces(unpacker types.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
type TallyParams ¶
type TallyParams struct { DefaultTally *types.TallyParams `protobuf:"bytes,1,opt,name=default_tally,json=defaultTally,proto3" json:"default_tally,omitempty"` CertifierUpdateSecurityVoteTally *types.TallyParams `` /* 163-byte string literal not displayed */ CertifierUpdateStakeVoteTally *types.TallyParams `` /* 154-byte string literal not displayed */ }
TallyParams defines the params for tallying votes on governance proposals.
func (*TallyParams) Descriptor ¶
func (*TallyParams) Descriptor() ([]byte, []int)
func (*TallyParams) Marshal ¶
func (m *TallyParams) Marshal() (dAtA []byte, err error)
func (*TallyParams) MarshalToSizedBuffer ¶
func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TallyParams) ProtoMessage ¶
func (*TallyParams) ProtoMessage()
func (*TallyParams) Reset ¶
func (m *TallyParams) Reset()
func (*TallyParams) Size ¶
func (m *TallyParams) Size() (n int)
func (TallyParams) String ¶
func (tp TallyParams) String() string
func (*TallyParams) Unmarshal ¶
func (m *TallyParams) Unmarshal(dAtA []byte) error
func (*TallyParams) XXX_DiscardUnknown ¶
func (m *TallyParams) XXX_DiscardUnknown()
func (*TallyParams) XXX_Marshal ¶
func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TallyParams) XXX_Merge ¶
func (m *TallyParams) XXX_Merge(src proto.Message)
func (*TallyParams) XXX_Size ¶
func (m *TallyParams) XXX_Size() int
func (*TallyParams) XXX_Unmarshal ¶
func (m *TallyParams) XXX_Unmarshal(b []byte) error
type Vote ¶
type Vote struct { *types.Vote `protobuf:"bytes,1,opt,name=deposit,proto3,embedded=deposit" json:"deposit,omitempty"` TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty" yaml:"txhash"` }
Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option.
func (*Vote) Descriptor ¶
func (*Vote) ProtoMessage ¶
func (*Vote) ProtoMessage()
func (*Vote) XXX_DiscardUnknown ¶
func (m *Vote) XXX_DiscardUnknown()