Documentation
¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper Keeper) (tags sdk.Tags, nonVotingVals []sdk.AccAddress)
- func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
- func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
- func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
- func ErrInvalidDescription(codespace sdk.CodespaceType, description string) sdk.Error
- func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidProposalType(codespace sdk.CodespaceType, strProposalType string) sdk.Error
- func ErrInvalidTitle(codespace sdk.CodespaceType, title string) sdk.Error
- func ErrInvalidVote(codespace sdk.CodespaceType, strOption string) sdk.Error
- func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func KeyDeposit(proposalID int64, depositerAddr sdk.AccAddress) []byte
- func KeyDepositsSubspace(proposalID int64) []byte
- func KeyProposal(proposalID int64) []byte
- func KeyVote(proposalID int64, voterAddr sdk.AccAddress) []byte
- func KeyVotesSubspace(proposalID int64) []byte
- func NewHandler(keeper Keeper) sdk.Handler
- func ProposalEqual(proposalA Proposal, proposalB Proposal) bool
- func ProposalTypeToString(proposalType ProposalKind) string
- func RegisterWire(cdc *wire.Codec)
- func SortAddresses(addrs []sdk.AccAddress)
- func SortByteArrays(src [][]byte) [][]byte
- func StatusToString(status VoteStatus) string
- func VoteOptionToString(option VoteOption) string
- type Deposit
- type DepositProcedure
- type DepositRest
- type GenesisState
- type Keeper
- func (keeper Keeper) ActiveProposalQueuePeek(ctx sdk.Context) Proposal
- func (keeper Keeper) ActiveProposalQueuePop(ctx sdk.Context) Proposal
- func (keeper Keeper) ActiveProposalQueuePush(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress, ...) (sdk.Error, bool)
- func (keeper Keeper) AddVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress, option VoteOption) sdk.Error
- func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID int64)
- func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress) (Deposit, bool)
- func (keeper Keeper) GetDepositProcedure() DepositProcedure
- func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID int64) sdk.Iterator
- func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID int64) Proposal
- func (keeper Keeper) GetTallyingProcedure() TallyingProcedure
- func (keeper Keeper) GetVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress) (Vote, bool)
- func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID int64) sdk.Iterator
- func (keeper Keeper) GetVotingProcedure() VotingProcedure
- func (keeper Keeper) InactiveProposalQueuePeek(ctx sdk.Context) Proposal
- func (keeper Keeper) InactiveProposalQueuePop(ctx sdk.Context) Proposal
- func (keeper Keeper) InactiveProposalQueuePush(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) NewTextProposal(ctx sdk.Context, title string, description string, proposalType byte) Proposal
- func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID int64)
- func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) WireCodec() *wire.Codec
- type MsgDeposit
- type MsgSubmitProposal
- func (msg MsgSubmitProposal) Get(key interface{}) (value interface{})
- func (msg MsgSubmitProposal) GetSignBytes() []byte
- func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress
- func (msg MsgSubmitProposal) String() string
- func (msg MsgSubmitProposal) Type() string
- func (msg MsgSubmitProposal) ValidateBasic() sdk.Error
- type MsgVote
- type Proposal
- type ProposalKind
- type ProposalQueue
- type ProposalRest
- type TallyingProcedure
- type TextProposal
- func (tp TextProposal) GetDescription() string
- func (tp TextProposal) GetProposalID() int64
- func (tp TextProposal) GetProposalType() ProposalKind
- func (tp TextProposal) GetStatus() VoteStatus
- func (tp TextProposal) GetSubmitBlock() int64
- func (tp TextProposal) GetTitle() string
- func (tp TextProposal) GetTotalDeposit() sdk.Coins
- func (tp TextProposal) GetVotingStartBlock() int64
- func (tp *TextProposal) SetDescription(description string)
- func (tp *TextProposal) SetProposalID(proposalID int64)
- func (tp *TextProposal) SetProposalType(proposalType ProposalKind)
- func (tp *TextProposal) SetStatus(status VoteStatus)
- func (tp *TextProposal) SetSubmitBlock(submitBlock int64)
- func (tp *TextProposal) SetTitle(title string)
- func (tp *TextProposal) SetTotalDeposit(totalDeposit sdk.Coins)
- func (tp *TextProposal) SetVotingStartBlock(votingStartBlock int64)
- type Vote
- type VoteOption
- type VoteRest
- type VoteStatus
- type VotingProcedure
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = 5 CodeUnknownProposal sdk.CodeType = 1 CodeInactiveProposal sdk.CodeType = 2 CodeAlreadyActiveProposal sdk.CodeType = 3 CodeAlreadyFinishedProposal sdk.CodeType = 4 CodeAddressNotStaked sdk.CodeType = 5 CodeInvalidTitle sdk.CodeType = 6 CodeInvalidDescription sdk.CodeType = 7 CodeInvalidProposalType sdk.CodeType = 8 CodeInvalidVote sdk.CodeType = 9 CodeInvalidGenesis sdk.CodeType = 10 )
const ( StatusDepositPeriod VoteStatus = 0x01 StatusVotingPeriod VoteStatus = 0x02 StatusPassed VoteStatus = 0x03 StatusRejected VoteStatus = 0x04 ProposalTypeText ProposalKind = 0x01 ProposalTypeParameterChange ProposalKind = 0x02 ProposalTypeSoftwareUpgrade ProposalKind = 0x03 )
nolint
const MsgType = "gov"
name to idetify transaction types
Variables ¶
var ( KeyNextProposalID = []byte("newProposalID") KeyActiveProposalQueue = []byte("activeProposalQueue") KeyInactiveProposalQueue = []byte("inactiveProposalQueue") )
Key for getting a the next available proposalID from the store
Functions ¶
func EndBlocker ¶
Called every block, process inflation, update validator set
func ErrAddressNotStaked ¶ added in v0.20.0
func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
func ErrAlreadyActiveProposal ¶
func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
func ErrAlreadyFinishedProposal ¶ added in v0.20.0
func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
func ErrInactiveProposal ¶
func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
func ErrInvalidDescription ¶ added in v0.20.0
func ErrInvalidDescription(codespace sdk.CodespaceType, description string) sdk.Error
func ErrInvalidGenesis ¶
func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidProposalType ¶
func ErrInvalidProposalType(codespace sdk.CodespaceType, strProposalType string) sdk.Error
func ErrInvalidTitle ¶ added in v0.20.0
func ErrInvalidTitle(codespace sdk.CodespaceType, title string) sdk.Error
func ErrInvalidVote ¶
func ErrInvalidVote(codespace sdk.CodespaceType, strOption string) sdk.Error
func ErrUnknownProposal ¶
func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID int64) sdk.Error
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis - store genesis parameters
func KeyDeposit ¶ added in v0.20.0
func KeyDeposit(proposalID int64, depositerAddr sdk.AccAddress) []byte
Key for getting a specific deposit from the store
func KeyDepositsSubspace ¶ added in v0.20.0
Key for getting all deposits on a proposal from the store
func KeyProposal ¶ added in v0.20.0
Key for getting a specific proposal from the store
func KeyVote ¶ added in v0.20.0
func KeyVote(proposalID int64, voterAddr sdk.AccAddress) []byte
Key for getting a specific vote from the store
func KeyVotesSubspace ¶ added in v0.20.0
Key for getting all votes on a proposal from the store
func ProposalEqual ¶ added in v0.20.0
checks if two proposals are equal
func ProposalTypeToString ¶ added in v0.20.0
func ProposalTypeToString(proposalType ProposalKind) string
ProposalTypeToString for pretty prints of ProposalType
func RegisterWire ¶ added in v0.20.0
Register concrete types on wire codec
func StatusToString ¶ added in v0.20.0
func StatusToString(status VoteStatus) string
StatusToString for pretty prints of Status
func VoteOptionToString ¶ added in v0.20.0
func VoteOptionToString(option VoteOption) string
ProposalTypeToString for pretty prints of ProposalType
Types ¶
type Deposit ¶
type Deposit struct { Depositer sdk.AccAddress `json:"depositer"` // Address of the depositer ProposalID int64 `json:"proposal_id"` // proposalID of the proposal Amount sdk.Coins `json:"amount"` // Deposit amount }
Deposit
type DepositProcedure ¶ added in v0.20.0
type DepositProcedure struct { MinDeposit sdk.Coins `json:"min_deposit"` // Minimum deposit for a proposal to enter voting period. MaxDepositPeriod int64 `json:"max_deposit_period"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months }
Procedure around Deposits for governance
type DepositRest ¶ added in v0.20.0
type DepositRest struct { Depositer sdk.AccAddress `json:"depositer"` // address of the depositer ProposalID int64 `json:"proposal_id"` // proposalID of the proposal Amount sdk.Coins `json:"option"` }
Rest Deposits
func DepositToRest ¶ added in v0.20.0
func DepositToRest(deposit Deposit) DepositRest
Turn any Deposit to a DepositRest
type GenesisState ¶
type GenesisState struct {
StartingProposalID int64 `json:"starting_proposalID"`
}
GenesisState - all staking state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func NewGenesisState ¶
func NewGenesisState(startingProposalID int64) GenesisState
func WriteGenesis ¶ added in v0.20.0
func WriteGenesis(ctx sdk.Context, k Keeper) GenesisState
WriteGenesis - output genesis parameters
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Governance Keeper
func NewKeeper ¶
func NewKeeper(cdc *wire.Codec, key sdk.StoreKey, ck bank.Keeper, ds sdk.DelegationSet, codespace sdk.CodespaceType) Keeper
NewGovernanceMapper returns a mapper that uses go-wire to (binary) encode and decode gov types.
func (Keeper) ActiveProposalQueuePeek ¶ added in v0.20.0
Return the Proposal at the front of the ProposalQueue
func (Keeper) ActiveProposalQueuePop ¶ added in v0.20.0
Remove and return a Proposal from the front of the ProposalQueue
func (Keeper) ActiveProposalQueuePush ¶ added in v0.20.0
Add a proposalID to the back of the ProposalQueue
func (Keeper) AddDeposit ¶ added in v0.20.0
func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress, depositAmount sdk.Coins) (sdk.Error, bool)
Adds or updates a deposit of a specific depositer on a specific proposal Activates voting period when appropriate
func (Keeper) AddVote ¶ added in v0.20.0
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress, option VoteOption) sdk.Error
Adds a vote on a specific proposal
func (Keeper) DeleteDeposits ¶ added in v0.20.0
Deletes all the deposits on a specific proposal without refunding them
func (Keeper) DeleteProposal ¶ added in v0.20.0
Implements sdk.AccountMapper.
func (Keeper) GetDeposit ¶ added in v0.20.0
func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID int64, depositerAddr sdk.AccAddress) (Deposit, bool)
Gets the deposit of a specific depositer on a specific proposal
func (Keeper) GetDepositProcedure ¶ added in v0.20.0
func (keeper Keeper) GetDepositProcedure() DepositProcedure
Gets procedure from store. TODO: move to global param store and allow for updating of this
func (Keeper) GetDeposits ¶ added in v0.20.0
Gets all the deposits on a specific proposal
func (Keeper) GetProposal ¶ added in v0.20.0
Get Proposal from store by ProposalID
func (Keeper) GetTallyingProcedure ¶ added in v0.20.0
func (keeper Keeper) GetTallyingProcedure() TallyingProcedure
Gets procedure from store. TODO: move to global param store and allow for updating of this
func (Keeper) GetVote ¶ added in v0.20.0
func (keeper Keeper) GetVote(ctx sdk.Context, proposalID int64, voterAddr sdk.AccAddress) (Vote, bool)
Gets the vote of a specific voter on a specific proposal
func (Keeper) GetVotingProcedure ¶ added in v0.20.0
func (keeper Keeper) GetVotingProcedure() VotingProcedure
Gets procedure from store. TODO: move to global param store and allow for updating of this
func (Keeper) InactiveProposalQueuePeek ¶ added in v0.20.0
Return the Proposal at the front of the ProposalQueue
func (Keeper) InactiveProposalQueuePop ¶ added in v0.20.0
Remove and return a Proposal from the front of the ProposalQueue
func (Keeper) InactiveProposalQueuePush ¶ added in v0.20.0
Add a proposalID to the back of the ProposalQueue
func (Keeper) NewTextProposal ¶ added in v0.20.0
func (keeper Keeper) NewTextProposal(ctx sdk.Context, title string, description string, proposalType byte) Proposal
Creates a NewProposal
func (Keeper) RefundDeposits ¶ added in v0.20.0
Returns and deletes all the deposits on a specific proposal
func (Keeper) SetProposal ¶ added in v0.20.0
Implements sdk.AccountMapper.
type MsgDeposit ¶
type MsgDeposit struct { ProposalID int64 `json:"proposalID"` // ID of the proposal Depositer sdk.AccAddress `json:"depositer"` // Address of the depositer Amount sdk.Coins `json:"amount"` // Coins to add to the proposal's deposit }
----------------------------------------------------------- MsgDeposit
func NewMsgDeposit ¶
func NewMsgDeposit(depositer sdk.AccAddress, proposalID int64, amount sdk.Coins) MsgDeposit
func (MsgDeposit) Get ¶ added in v0.20.0
func (msg MsgDeposit) Get(key interface{}) (value interface{})
Implements Msg.
func (MsgDeposit) GetSignBytes ¶ added in v0.20.0
func (msg MsgDeposit) GetSignBytes() []byte
Implements Msg.
func (MsgDeposit) GetSigners ¶ added in v0.20.0
func (msg MsgDeposit) GetSigners() []sdk.AccAddress
Implements Msg.
func (MsgDeposit) String ¶ added in v0.20.0
func (msg MsgDeposit) String() string
func (MsgDeposit) ValidateBasic ¶ added in v0.20.0
func (msg MsgDeposit) ValidateBasic() sdk.Error
Implements Msg.
type MsgSubmitProposal ¶
type MsgSubmitProposal struct { Title string // Title of the proposal Description string // Description of the proposal ProposalType ProposalKind // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} Proposer sdk.AccAddress // Address of the proposer InitialDeposit sdk.Coins // Initial deposit paid by sender. Must be strictly positive. }
----------------------------------------------------------- MsgSubmitProposal
func NewMsgSubmitProposal ¶
func NewMsgSubmitProposal(title string, description string, proposalType ProposalKind, proposer sdk.AccAddress, initialDeposit sdk.Coins) MsgSubmitProposal
func (MsgSubmitProposal) Get ¶ added in v0.20.0
func (msg MsgSubmitProposal) Get(key interface{}) (value interface{})
Implements Msg.
func (MsgSubmitProposal) GetSignBytes ¶ added in v0.20.0
func (msg MsgSubmitProposal) GetSignBytes() []byte
Implements Msg.
func (MsgSubmitProposal) GetSigners ¶ added in v0.20.0
func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress
Implements Msg.
func (MsgSubmitProposal) String ¶ added in v0.20.0
func (msg MsgSubmitProposal) String() string
func (MsgSubmitProposal) Type ¶ added in v0.20.0
func (msg MsgSubmitProposal) Type() string
Implements Msg.
func (MsgSubmitProposal) ValidateBasic ¶ added in v0.20.0
func (msg MsgSubmitProposal) ValidateBasic() sdk.Error
Implements Msg.
type MsgVote ¶
type MsgVote struct { ProposalID int64 // proposalID of the proposal Voter sdk.AccAddress // address of the voter Option VoteOption // option from OptionSet chosen by the voter }
----------------------------------------------------------- MsgVote
func NewMsgVote ¶
func NewMsgVote(voter sdk.AccAddress, proposalID int64, option VoteOption) MsgVote
func (MsgVote) Get ¶ added in v0.20.0
func (msg MsgVote) Get(key interface{}) (value interface{})
Implements Msg.
func (MsgVote) GetSignBytes ¶ added in v0.20.0
Implements Msg.
func (MsgVote) GetSigners ¶ added in v0.20.0
func (msg MsgVote) GetSigners() []sdk.AccAddress
Implements Msg.
func (MsgVote) ValidateBasic ¶ added in v0.20.0
Implements Msg.
type Proposal ¶
type Proposal interface { GetProposalID() int64 SetProposalID(int64) GetTitle() string SetTitle(string) GetDescription() string SetDescription(string) GetProposalType() ProposalKind SetProposalType(ProposalKind) GetStatus() VoteStatus SetStatus(VoteStatus) GetSubmitBlock() int64 SetSubmitBlock(int64) GetTotalDeposit() sdk.Coins SetTotalDeposit(sdk.Coins) GetVotingStartBlock() int64 SetVotingStartBlock(int64) }
----------------------------------------------------------- Proposal interface
type ProposalKind ¶ added in v0.20.0
type ProposalKind = byte
Type that represents Proposal Type as a byte
func StringToProposalType ¶ added in v0.20.0
func StringToProposalType(str string) (ProposalKind, sdk.Error)
String to proposalType byte. Returns ff if invalid.
type ProposalRest ¶ added in v0.20.0
type ProposalRest struct { ProposalID int64 `json:"proposal_id"` // ID of the proposal Title string `json:"title"` // Title of the proposal Description string `json:"description"` // Description of the proposal ProposalType string `json:"proposal_type"` // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} Status string `json:"string"` // Status of the Proposal {Pending, Active, Passed, Rejected} SubmitBlock int64 `json:"submit_block"` // Height of the block where TxGovSubmitProposal was included TotalDeposit sdk.Coins `json:"total_deposit"` // Current deposit on this proposal. Initial value is set at InitialDeposit VotingStartBlock int64 `json:"voting_start_block"` // Height of the block where MinDeposit was reached. -1 if MinDeposit is not reached }
----------------------------------------------------------- Rest Proposals
func ProposalToRest ¶ added in v0.20.0
func ProposalToRest(proposal Proposal) ProposalRest
Turn any Proposal to a ProposalRest
type TallyingProcedure ¶ added in v0.20.0
type TallyingProcedure struct { Threshold sdk.Rat `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5 Veto sdk.Rat `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 GovernancePenalty sdk.Rat `json:"governance_penalty"` // Penalty if validator does not vote }
Procedure around Tallying votes in governance
type TextProposal ¶
type TextProposal struct { ProposalID int64 `json:"proposal_id"` // ID of the proposal Title string `json:"title"` // Title of the proposal Description string `json:"description"` // Description of the proposal ProposalType ProposalKind `json:"proposal_type"` // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} Status VoteStatus `json:"string"` // Status of the Proposal {Pending, Active, Passed, Rejected} SubmitBlock int64 `json:"submit_block"` // Height of the block where TxGovSubmitProposal was included TotalDeposit sdk.Coins `json:"total_deposit"` // Current deposit on this proposal. Initial value is set at InitialDeposit VotingStartBlock int64 `json:"voting_start_block"` // Height of the block where MinDeposit was reached. -1 if MinDeposit is not reached }
----------------------------------------------------------- Text Proposals
func (TextProposal) GetDescription ¶ added in v0.20.0
func (tp TextProposal) GetDescription() string
func (TextProposal) GetProposalID ¶ added in v0.20.0
func (tp TextProposal) GetProposalID() int64
nolint
func (TextProposal) GetProposalType ¶ added in v0.20.0
func (tp TextProposal) GetProposalType() ProposalKind
func (TextProposal) GetStatus ¶ added in v0.20.0
func (tp TextProposal) GetStatus() VoteStatus
func (TextProposal) GetSubmitBlock ¶ added in v0.20.0
func (tp TextProposal) GetSubmitBlock() int64
func (TextProposal) GetTitle ¶ added in v0.20.0
func (tp TextProposal) GetTitle() string
func (TextProposal) GetTotalDeposit ¶ added in v0.20.0
func (tp TextProposal) GetTotalDeposit() sdk.Coins
func (TextProposal) GetVotingStartBlock ¶ added in v0.20.0
func (tp TextProposal) GetVotingStartBlock() int64
func (*TextProposal) SetDescription ¶ added in v0.20.0
func (tp *TextProposal) SetDescription(description string)
func (*TextProposal) SetProposalID ¶ added in v0.20.0
func (tp *TextProposal) SetProposalID(proposalID int64)
func (*TextProposal) SetProposalType ¶ added in v0.20.0
func (tp *TextProposal) SetProposalType(proposalType ProposalKind)
func (*TextProposal) SetStatus ¶ added in v0.20.0
func (tp *TextProposal) SetStatus(status VoteStatus)
func (*TextProposal) SetSubmitBlock ¶ added in v0.20.0
func (tp *TextProposal) SetSubmitBlock(submitBlock int64)
func (*TextProposal) SetTitle ¶ added in v0.20.0
func (tp *TextProposal) SetTitle(title string)
func (*TextProposal) SetTotalDeposit ¶ added in v0.20.0
func (tp *TextProposal) SetTotalDeposit(totalDeposit sdk.Coins)
func (*TextProposal) SetVotingStartBlock ¶ added in v0.20.0
func (tp *TextProposal) SetVotingStartBlock(votingStartBlock int64)
type Vote ¶
type Vote struct { Voter sdk.AccAddress `json:"voter"` // address of the voter ProposalID int64 `json:"proposal_id"` // proposalID of the proposal Option VoteOption `json:"option"` // option from OptionSet chosen by the voter }
Vote
type VoteOption ¶
type VoteOption = byte
Type that represents VoteOption as a byte
const ( OptionEmpty VoteOption = 0x00 OptionYes VoteOption = 0x01 OptionAbstain VoteOption = 0x02 OptionNo VoteOption = 0x03 OptionNoWithVeto VoteOption = 0x04 )
nolint
func StringToVoteOption ¶ added in v0.20.0
func StringToVoteOption(str string) (VoteOption, sdk.Error)
String to proposalType byte. Returns ff if invalid.
type VoteRest ¶ added in v0.20.0
type VoteRest struct { Voter sdk.AccAddress `json:"voter"` // address of the voter ProposalID int64 `json:"proposal_id"` // proposalID of the proposal Option string `json:"option"` }
Rest Votes
type VoteStatus ¶ added in v0.20.0
type VoteStatus = byte
Type that represents Status as a byte
func StringToStatus ¶ added in v0.20.0
func StringToStatus(status string) VoteStatus
StatusToString for pretty prints of Status
type VotingProcedure ¶ added in v0.20.0
type VotingProcedure struct {
VotingPeriod int64 `json:"voting_period"` // Length of the voting period.
}
Procedure around Voting in governance