cosmos-sdk: github.com/cosmos/cosmos-sdk/x/gov/legacy/v0_34 Index | Files

package v0_34

import "github.com/cosmos/cosmos-sdk/x/gov/legacy/v0_34"

DONTCOVER nolint

Index

Package Files

types.go

Constants

const (
    ModuleName = "gov"

    StatusNil           ProposalStatus = 0x00
    StatusDepositPeriod ProposalStatus = 0x01
    StatusVotingPeriod  ProposalStatus = 0x02
    StatusPassed        ProposalStatus = 0x03
    StatusRejected      ProposalStatus = 0x04
    StatusFailed        ProposalStatus = 0x05

    OptionEmpty      VoteOption = 0x00
    OptionYes        VoteOption = 0x01
    OptionAbstain    VoteOption = 0x02
    OptionNo         VoteOption = 0x03
    OptionNoWithVeto VoteOption = 0x04

    ProposalTypeNil             ProposalKind = 0x00
    ProposalTypeText            ProposalKind = 0x01
    ProposalTypeParameterChange ProposalKind = 0x02
)

func RegisterCodec Uses

func RegisterCodec(cdc *codec.Codec)

type Deposit Uses

type Deposit struct {
    ProposalID uint64         `json:"proposal_id"`
    Depositor  sdk.AccAddress `json:"depositor"`
    Amount     sdk.Coins      `json:"amount"`
}

type DepositParams Uses

type DepositParams struct {
    MinDeposit       sdk.Coins     `json:"min_deposit,omitempty"`
    MaxDepositPeriod time.Duration `json:"max_deposit_period,omitempty"`
}

type DepositWithMetadata Uses

type DepositWithMetadata struct {
    ProposalID uint64  `json:"proposal_id"`
    Deposit    Deposit `json:"deposit"`
}

type Deposits Uses

type Deposits []Deposit

type GenesisState Uses

type GenesisState struct {
    StartingProposalID uint64                `json:"starting_proposal_id"`
    Deposits           []DepositWithMetadata `json:"deposits"`
    Votes              []VoteWithMetadata    `json:"votes"`
    Proposals          []Proposal            `json:"proposals"`
    DepositParams      DepositParams         `json:"deposit_params"`
    VotingParams       VotingParams          `json:"voting_params"`
    TallyParams        TallyParams           `json:"tally_params"`
}

type Proposal Uses

type Proposal struct {
    ProposalContent `json:"proposal_content"`

    ProposalID uint64 `json:"proposal_id"`

    Status           ProposalStatus `json:"proposal_status"`
    FinalTallyResult TallyResult    `json:"final_tally_result"`

    SubmitTime     time.Time `json:"submit_time"`
    DepositEndTime time.Time `json:"deposit_end_time"`
    TotalDeposit   sdk.Coins `json:"total_deposit"`

    VotingStartTime time.Time `json:"voting_start_time"`
    VotingEndTime   time.Time `json:"voting_end_time"`
}

type ProposalContent Uses

type ProposalContent interface {
    GetTitle() string
    GetDescription() string
    ProposalType() ProposalKind
}

type ProposalKind Uses

type ProposalKind byte

func ProposalTypeFromString Uses

func ProposalTypeFromString(str string) (ProposalKind, error)

func (ProposalKind) Marshal Uses

func (pt ProposalKind) Marshal() ([]byte, error)

func (ProposalKind) MarshalJSON Uses

func (pt ProposalKind) MarshalJSON() ([]byte, error)

func (ProposalKind) String Uses

func (pt ProposalKind) String() string

func (*ProposalKind) Unmarshal Uses

func (pt *ProposalKind) Unmarshal(data []byte) error

func (*ProposalKind) UnmarshalJSON Uses

func (pt *ProposalKind) UnmarshalJSON(data []byte) error

type ProposalQueue Uses

type ProposalQueue []uint64

type ProposalStatus Uses

type ProposalStatus byte

func ProposalStatusFromString Uses

func ProposalStatusFromString(str string) (ProposalStatus, error)

ProposalStatusToString turns a string into a ProposalStatus

func (ProposalStatus) Marshal Uses

func (status ProposalStatus) Marshal() ([]byte, error)

func (ProposalStatus) MarshalJSON Uses

func (status ProposalStatus) MarshalJSON() ([]byte, error)

func (ProposalStatus) String Uses

func (status ProposalStatus) String() string

func (*ProposalStatus) Unmarshal Uses

func (status *ProposalStatus) Unmarshal(data []byte) error

func (*ProposalStatus) UnmarshalJSON Uses

func (status *ProposalStatus) UnmarshalJSON(data []byte) error

type Proposals Uses

type Proposals []Proposal

type TallyParams Uses

type TallyParams struct {
    Quorum    sdk.Dec `json:"quorum,omitempty"`
    Threshold sdk.Dec `json:"threshold,omitempty"`
    Veto      sdk.Dec `json:"veto,omitempty"`
}

type TallyResult Uses

type TallyResult struct {
    Yes        sdk.Int `json:"yes"`
    Abstain    sdk.Int `json:"abstain"`
    No         sdk.Int `json:"no"`
    NoWithVeto sdk.Int `json:"no_with_veto"`
}

type TextProposal Uses

type TextProposal struct {
    Title       string `json:"title"`
    Description string `json:"description"`
}

func (TextProposal) GetDescription Uses

func (tp TextProposal) GetDescription() string

func (TextProposal) GetTitle Uses

func (tp TextProposal) GetTitle() string

func (TextProposal) ProposalType Uses

func (tp TextProposal) ProposalType() ProposalKind

type Vote Uses

type Vote struct {
    ProposalID uint64         `json:"proposal_id"`
    Voter      sdk.AccAddress `json:"voter"`
    Option     VoteOption     `json:"option"`
}

type VoteOption Uses

type VoteOption byte

func VoteOptionFromString Uses

func VoteOptionFromString(str string) (VoteOption, error)

func (VoteOption) Marshal Uses

func (vo VoteOption) Marshal() ([]byte, error)

func (VoteOption) MarshalJSON Uses

func (vo VoteOption) MarshalJSON() ([]byte, error)

func (VoteOption) String Uses

func (vo VoteOption) String() string

func (*VoteOption) Unmarshal Uses

func (vo *VoteOption) Unmarshal(data []byte) error

func (*VoteOption) UnmarshalJSON Uses

func (vo *VoteOption) UnmarshalJSON(data []byte) error

type VoteWithMetadata Uses

type VoteWithMetadata struct {
    ProposalID uint64 `json:"proposal_id"`
    Vote       Vote   `json:"vote"`
}

type Votes Uses

type Votes []Vote

type VotingParams Uses

type VotingParams struct {
    VotingPeriod time.Duration `json:"voting_period,omitempty"`
}

Package v0_34 imports 5 packages (graph) and is imported by 3 packages. Updated 2019-12-11. Refresh now. Tools for package owners.