Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func AllInvariants() sdk.Invariant
- func EndBlocker(ctx sdk.Context, keeper Keeper) (resTags sdk.Tags)
- func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func ErrAlreadyVote(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
- func ErrCodeDepositDeleted(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func ErrCodeDepositNotExisted(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
- func ErrCodeInvalidSwitchHeight(codespace sdk.CodespaceType, blockHeight uint64, switchHeight uint64) sdk.Error
- func ErrCodeInvalidVersion(codespace sdk.CodespaceType, version uint64) sdk.Error
- func ErrCodeVoteNotExisted(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
- func ErrEmptyParam(codespace sdk.CodespaceType) sdk.Error
- func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func ErrInvalidDescription(codespace sdk.CodespaceType, description string) sdk.Error
- func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidParam(codespace sdk.CodespaceType, str string) sdk.Error
- func ErrInvalidParamNum(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidParamOp(codespace sdk.CodespaceType, opStr string) sdk.Error
- func ErrInvalidPercent(codespace sdk.CodespaceType, percent sdk.Dec) sdk.Error
- func ErrInvalidProposalType(codespace sdk.CodespaceType, proposalType ProposalKind) sdk.Error
- func ErrInvalidTitle(codespace sdk.CodespaceType, title string) sdk.Error
- func ErrInvalidUpgradeThreshold(codespace sdk.CodespaceType, Threshold sdk.Dec) sdk.Error
- func ErrInvalidUsageType(codespace sdk.CodespaceType, usageType UsageType) sdk.Error
- func ErrInvalidVote(codespace sdk.CodespaceType, voteOption VoteOption) sdk.Error
- func ErrMoreThanMaxProposal(codespace sdk.CodespaceType, num uint64, proposalLevel string) sdk.Error
- func ErrNotEnoughInitialDeposit(codespace sdk.CodespaceType, initialDeposit sdk.Coins, minDeposit sdk.Coins) sdk.Error
- func ErrNotInDepositPeriod(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func ErrNotProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
- func ErrNotTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
- func ErrOnlyValidatorOrDelegatorVote(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func ErrSwitchPeriodInProcess(codespace sdk.CodespaceType) sdk.Error
- func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func KeyActiveProposalQueueProposal(endTime time.Time, proposalID uint64) []byte
- func KeyDeposit(proposalID uint64, depositorAddr sdk.AccAddress) []byte
- func KeyDepositsSubspace(proposalID uint64) []byte
- func KeyInactiveProposalQueueProposal(endTime time.Time, proposalID uint64) []byte
- func KeyProposal(proposalID uint64) []byte
- func KeyValidatorSet(proposalID uint64) []byte
- func KeyVote(proposalID uint64, voterAddr sdk.AccAddress) []byte
- func KeyVotesSubspace(proposalID uint64) []byte
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func ParamTypeTable() params.TypeTable
- func PrefixActiveProposalQueueTime(endTime time.Time) []byte
- func PrefixInactiveProposalQueueTime(endTime time.Time) []byte
- func PrepForZeroHeightGenesis(ctx sdk.Context, k Keeper)
- func RegisterCodec(cdc *codec.Codec)
- func SortAddresses(addrs []sdk.AccAddress)
- func SortByteArrays(src [][]byte) [][]byte
- func ValidProposalStatus(status ProposalStatus) bool
- func ValidProposalType(pt ProposalKind) bool
- func ValidUsageType(ut UsageType) bool
- func ValidVoteOption(option VoteOption) bool
- func ValidateGenesis(data GenesisState) error
- type AssetKeeper
- type BasicProposal
- func (bp *BasicProposal) Execute(ctx sdk.Context, gk Keeper) sdk.Error
- func (bp BasicProposal) GetDepositEndTime() time.Time
- func (bp BasicProposal) GetDescription() string
- func (bp BasicProposal) GetProposalID() uint64
- func (bp *BasicProposal) GetProposalLevel() ProposalLevel
- func (bp BasicProposal) GetProposalType() ProposalKind
- func (bp *BasicProposal) GetProposer() sdk.AccAddress
- func (bp BasicProposal) GetProtocolDefinition() sdk.ProtocolDefinition
- func (bp BasicProposal) GetStatus() ProposalStatus
- func (bp BasicProposal) GetSubmitTime() time.Time
- func (bp BasicProposal) GetTallyResult() TallyResult
- func (bp BasicProposal) GetTaxUsage() TaxUsage
- func (bp BasicProposal) GetTitle() string
- func (bp BasicProposal) GetTotalDeposit() sdk.Coins
- func (bp BasicProposal) GetVotingEndTime() time.Time
- func (bp BasicProposal) GetVotingStartTime() time.Time
- func (bp BasicProposal) HumanString(converter sdk.CoinsConverter) string
- func (bp *BasicProposal) SetDepositEndTime(depositEndTime time.Time)
- func (bp *BasicProposal) SetDescription(description string)
- func (bp *BasicProposal) SetProposalID(proposalID uint64)
- func (bp *BasicProposal) SetProposalType(proposalType ProposalKind)
- func (bp *BasicProposal) SetProtocolDefinition(sdk.ProtocolDefinition)
- func (bp *BasicProposal) SetStatus(status ProposalStatus)
- func (bp *BasicProposal) SetSubmitTime(submitTime time.Time)
- func (bp *BasicProposal) SetTallyResult(tallyResult TallyResult)
- func (bp *BasicProposal) SetTaxUsage(taxUsage TaxUsage)
- func (bp *BasicProposal) SetTitle(title string)
- func (bp *BasicProposal) SetTotalDeposit(totalDeposit sdk.Coins)
- func (bp *BasicProposal) SetVotingEndTime(votingEndTime time.Time)
- func (bp *BasicProposal) SetVotingStartTime(votingStartTime time.Time)
- func (bp BasicProposal) String() string
- func (bp *BasicProposal) Validate(ctx sdk.Context, k Keeper, verify bool) sdk.Error
- type CommunityTaxUsageProposal
- func (tp *CommunityTaxUsageProposal) Execute(ctx sdk.Context, gk Keeper) sdk.Error
- func (tp CommunityTaxUsageProposal) GetTaxUsage() TaxUsage
- func (tp *CommunityTaxUsageProposal) SetTaxUsage(taxUsage TaxUsage)
- func (tp *CommunityTaxUsageProposal) Validate(ctx sdk.Context, k Keeper, verify bool) sdk.Error
- type Content
- type Deposit
- type DepositProcedure
- type Deposits
- type GenesisState
- type GovParams
- func (p *GovParams) GetParamSpace() string
- func (p *GovParams) KeyValuePairs() params.KeyValuePairs
- func (p *GovParams) ReadOnly() bool
- func (p GovParams) String() string
- func (p *GovParams) StringFromBytes(cdc *codec.Codec, key string, bytes []byte) (string, error)
- func (p *GovParams) Validate(key string, value string) (interface{}, sdk.Error)
- type Keeper
- func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (keeper Keeper) AddCriticalProposalNum(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, ...) (sdk.Error, bool)
- func (keeper Keeper) AddImportantProposalNum(ctx sdk.Context)
- func (keeper Keeper) AddNormalProposalNum(ctx sdk.Context)
- func (keeper Keeper) AddProposalNum(ctx sdk.Context, p ProposalLevel, args ...interface{})
- func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, ...) sdk.Error
- func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) DeleteValidatorSet(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) GetCriticalProposalID(ctx sdk.Context) (uint64, bool)
- func (keeper Keeper) GetCriticalProposalNum(ctx sdk.Context) uint64
- func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (Deposit, bool)
- func (keeper Keeper) GetDepositProcedure(ctx sdk.Context, p ProposalLevel) DepositProcedure
- func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) sdk.Iterator
- func (keeper Keeper) GetImportantProposalNum(ctx sdk.Context) uint64
- func (keeper Keeper) GetLastProposalID(ctx sdk.Context) (proposalID uint64)
- func (keeper Keeper) GetMaxNumByProposalLevel(ctx sdk.Context, p ProposalLevel) uint64
- func (keeper Keeper) GetNormalProposalNum(ctx sdk.Context) uint64
- func (keeper Keeper) GetParamSet(ctx sdk.Context) GovParams
- func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) Proposal
- func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, voterAddr sdk.AccAddress, depositorAddr sdk.AccAddress, ...) []Proposal
- func (keeper Keeper) GetSystemHaltHeight(ctx sdk.Context) int64
- func (keeper Keeper) GetSystemHaltPeriod(ctx sdk.Context) (SystemHaltPeriod int64)
- func (keeper Keeper) GetTallyingProcedure(ctx sdk.Context, p ProposalLevel) TallyingProcedure
- func (keeper Keeper) GetValidatorSet(ctx sdk.Context, proposalID uint64) []sdk.ValAddress
- func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (Vote, bool)
- func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) sdk.Iterator
- func (keeper Keeper) GetVotingProcedure(ctx sdk.Context, p ProposalLevel) VotingProcedure
- func (keeper Keeper) HasReachedTheMaxProposalNum(ctx sdk.Context, p ProposalLevel) (uint64, bool)
- func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (keeper Keeper) Init(ctx sdk.Context)
- func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
- func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
- func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
- func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
- func (keeper Keeper) SetCriticalProposalID(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) SetImportantProposalNum(ctx sdk.Context, num uint64)
- func (keeper Keeper) SetNormalProposalNum(ctx sdk.Context, num uint64)
- func (keeper Keeper) SetParamSet(ctx sdk.Context, params GovParams)
- func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal)
- func (keeper Keeper) SetSystemHaltHeight(ctx sdk.Context, height int64)
- func (keeper Keeper) SetValidatorSet(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) SubCriticalProposalNum(ctx sdk.Context)
- func (keeper Keeper) SubImportantProposalNum(ctx sdk.Context)
- func (keeper Keeper) SubNormalProposalNum(ctx sdk.Context)
- func (keeper Keeper) SubProposalNum(ctx sdk.Context, p ProposalLevel)
- func (keeper Keeper) SubmitProposal(ctx sdk.Context, msg sdk.Msg) (sdk.Tags, sdk.Error)
- type Label
- type Metrics
- func (metrics *Metrics) AddParameter(key string, value interface{})
- func (metrics *Metrics) AddVote(consAddr string, proposalID uint64, option VoteOption)
- func (metrics *Metrics) DeleteProposalStatus(proposalID uint64)
- func (metrics *Metrics) DeleteVote(valAddr string, proposalID uint64)
- func (metrics *Metrics) SetProposalStatus(proposalID uint64, status ProposalStatus)
- type MsgDeposit
- func (msg MsgDeposit) Get(key interface{}) (value interface{})
- func (msg MsgDeposit) GetSignBytes() []byte
- func (msg MsgDeposit) GetSigners() []sdk.AccAddress
- func (msg MsgDeposit) Route() string
- func (msg MsgDeposit) String() string
- func (msg MsgDeposit) Type() string
- func (msg MsgDeposit) ValidateBasic() sdk.Error
- type MsgSubmitCommunityTaxUsageProposal
- type MsgSubmitProposal
- func (msg MsgSubmitProposal) EnsureLength() sdk.Error
- func (msg MsgSubmitProposal) Get(key interface{}) (value interface{})
- func (msg MsgSubmitProposal) GetDescription() string
- func (msg MsgSubmitProposal) GetInitialDeposit() sdk.Coins
- func (msg MsgSubmitProposal) GetParams() Params
- func (msg MsgSubmitProposal) GetProposalType() ProposalKind
- func (msg MsgSubmitProposal) GetProposer() sdk.AccAddress
- func (msg MsgSubmitProposal) GetSignBytes() []byte
- func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress
- func (msg MsgSubmitProposal) GetTitle() string
- func (msg MsgSubmitProposal) Route() string
- func (msg MsgSubmitProposal) String() string
- func (msg MsgSubmitProposal) Type() string
- func (msg MsgSubmitProposal) ValidateBasic() sdk.Error
- type MsgSubmitSoftwareUpgradeProposal
- type MsgSubmitTokenAdditionProposal
- type MsgVote
- type Param
- type ParameterProposal
- type Params
- type PlainTextProposal
- type Proposal
- type ProposalKind
- func (pt ProposalKind) Format(s fmt.State, verb rune)
- func (pt ProposalKind) GetProposalLevel() ProposalLevel
- func (pt ProposalKind) Marshal() ([]byte, error)
- func (pt ProposalKind) MarshalJSON() ([]byte, error)
- func (pt ProposalKind) NewProposal(content Content) (Proposal, sdk.Error)
- func (pt ProposalKind) String() string
- func (pt *ProposalKind) Unmarshal(data []byte) error
- func (pt *ProposalKind) UnmarshalJSON(data []byte) error
- type ProposalLevel
- type ProposalQueue
- type ProposalResult
- type ProposalStatus
- func (status ProposalStatus) Format(s fmt.State, verb rune)
- func (status ProposalStatus) Marshal() ([]byte, error)
- func (status ProposalStatus) MarshalJSON() ([]byte, error)
- func (status ProposalStatus) String() string
- func (status *ProposalStatus) Unmarshal(data []byte) error
- func (status *ProposalStatus) UnmarshalJSON(data []byte) error
- type Proposals
- type QueryDepositParams
- type QueryDepositsParams
- type QueryProposalParams
- type QueryProposalsParams
- type QueryTallyParams
- type QueryVoteParams
- type QueryVotesParams
- type SoftwareUpgradeProposal
- func (sp *SoftwareUpgradeProposal) Execute(ctx sdk.Context, gk Keeper) sdk.Error
- func (sp SoftwareUpgradeProposal) GetProtocolDefinition() sdk.ProtocolDefinition
- func (sp *SoftwareUpgradeProposal) SetProtocolDefinition(upgrade sdk.ProtocolDefinition)
- func (sp *SoftwareUpgradeProposal) Validate(ctx sdk.Context, k Keeper, verify bool) sdk.Error
- type SystemHaltProposal
- type TallyResult
- type TallyingProcedure
- type TaxUsage
- type TokenAdditionProposal
- type UsageType
- type Vote
- type VoteOption
- type Votes
- type VotingProcedure
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "gov" 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 CodeInvalidProposalStatus sdk.CodeType = 11 CodeInvalidParam sdk.CodeType = 12 CodeInvalidParamOp sdk.CodeType = 13 CodeSwitchPeriodInProcess sdk.CodeType = 14 CodeInvalidPercent sdk.CodeType = 15 CodeInvalidUsageType sdk.CodeType = 16 CodeInvalidInput sdk.CodeType = 17 CodeInvalidVersion sdk.CodeType = 18 CodeInvalidProposal sdk.CodeType = 19 CodeNotEnoughInitialDeposit sdk.CodeType = 20 CodeDepositDeleted sdk.CodeType = 21 CodeVoteNotExisted sdk.CodeType = 22 CodeDepositNotExisted sdk.CodeType = 23 CodeNotInDepositPeriod sdk.CodeType = 24 CodeAlreadyVote sdk.CodeType = 25 CodeOnlyValidatorOrDelegatorVote sdk.CodeType = 26 CodeMoreThanMaxProposal sdk.CodeType = 27 CodeInvalidUpgradeParams sdk.CodeType = 28 CodeEmptyParam sdk.CodeType = 29 CodeInvalidParamNum sdk.CodeType = 30 )
const ( MetricsSubsystem = "module_gov" ValidatorLabel = "validator_address" ProposalIDLabel = "proposal_id" ParamKeyLabel = "parameter_key" )
const ( CRITICAL_DEPOSIT = 4000 IMPORTANT_DEPOSIT = 2000 NORMAL_DEPOSIT = 1000 CRITICAL = "Critical" IMPORTANT = "Important" NORMAL = "Normal" LOWER_BOUND_AMOUNT = 10 UPPER_BOUND_AMOUNT = 10000 STABLE_CRITIACAL_NUM = 1 DEFAULT_IMPORTANT_NUM = 5 DEFAULT_NORMAL_NUM = 7 MIN_IMPORTANT_NUM = 1 MIN_NORMAL_NUM = 1 )
const ( Insert string = "insert" Update string = "update" )
const ( QueryProposals = "proposals" QueryProposal = "proposal" QueryDeposits = "deposits" QueryDeposit = "deposit" QueryVotes = "votes" QueryVote = "vote" QueryTally = "tally" )
query endpoints supported by the governance Querier
const (
DefaultParamSpace = "gov"
)
default paramspace for params keeper
const MsgRoute = "gov"
name to idetify transaction types
const (
Prefix = "gov/"
)
const StartingProposalID = 1
Variables ¶
var ( BurnRate = sdk.NewDecWithPrec(2, 1) MinDepositRate = sdk.NewDecWithPrec(3, 1) )
nolint
var ( KeyDelimiter = []byte(":") KeyNextProposalID = []byte("newProposalID") PrefixActiveProposalQueue = []byte("activeProposalQueue") PrefixInactiveProposalQueue = []byte("inactiveProposalQueue") )
Key for getting a the next available proposalID from the store
var ( KeySystemHaltHeight = []byte("SystemHaltHeight") KeyCriticalProposal = []byte("CriticalProposal") KeyImportantProposalNum = []byte("ImportantProposalNum") KeyNormalProposalNum = []byte("NormalProposalNum") PrefixValidatorSet = []byte("vs") )
Key for getting a the next available proposalID from the store
var ( KeyCriticalDepositPeriod = []byte(CRITICAL + "DepositPeriod") KeyCriticalMinDeposit = []byte(CRITICAL + "MinDeposit") KeyCriticalVotingPeriod = []byte(CRITICAL + "VotingPeriod") KeyCriticalMaxNum = []byte(CRITICAL + "MaxNum") KeyCriticalThreshold = []byte(CRITICAL + "Threshold") KeyCriticalVeto = []byte(CRITICAL + "Veto") KeyCriticalParticipation = []byte(CRITICAL + "Participation") KeyCriticalPenalty = []byte(CRITICAL + "Penalty") KeyImportantDepositPeriod = []byte(IMPORTANT + "DepositPeriod") KeyImportantMinDeposit = []byte(IMPORTANT + "MinDeposit") KeyImportantVotingPeriod = []byte(IMPORTANT + "VotingPeriod") KeyImportantMaxNum = []byte(IMPORTANT + "MaxNum") KeyImportantThreshold = []byte(IMPORTANT + "Threshold") KeyImportantVeto = []byte(IMPORTANT + "Veto") KeyImportantParticipation = []byte(IMPORTANT + "Participation") KeyImportantPenalty = []byte(IMPORTANT + "Penalty") KeyNormalDepositPeriod = []byte(NORMAL + "DepositPeriod") KeyNormalMinDeposit = []byte(NORMAL + "MinDeposit") KeyNormalVotingPeriod = []byte(NORMAL + "VotingPeriod") KeyNormalMaxNum = []byte(NORMAL + "MaxNum") KeyNormalThreshold = []byte(NORMAL + "Threshold") KeyNormalVeto = []byte(NORMAL + "Veto") KeyNormalParticipation = []byte(NORMAL + "Participation") KeyNormalPenalty = []byte(NORMAL + "Penalty") KeySystemHaltPeriod = []byte("SystemHaltPeriod") )
Parameter store key
Functions ¶
func AllInvariants ¶ added in v0.15.0
AllInvariants tests all governance invariants
func EndBlocker ¶
Called every block, process inflation, update validator set
func ErrAddressNotStaked ¶ added in v0.10.2
func ErrAddressNotStaked(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
func ErrAlreadyActiveProposal ¶ added in v0.10.2
func ErrAlreadyActiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func ErrAlreadyFinishedProposal ¶ added in v0.10.2
func ErrAlreadyFinishedProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func ErrAlreadyVote ¶ added in v0.10.2
func ErrAlreadyVote(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
func ErrCodeDepositDeleted ¶ added in v0.10.2
func ErrCodeDepositDeleted(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func ErrCodeDepositNotExisted ¶ added in v0.10.2
func ErrCodeDepositNotExisted(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
func ErrCodeInvalidSwitchHeight ¶ added in v0.10.2
func ErrCodeInvalidVersion ¶ added in v0.10.2
func ErrCodeInvalidVersion(codespace sdk.CodespaceType, version uint64) sdk.Error
func ErrCodeVoteNotExisted ¶ added in v0.10.2
func ErrCodeVoteNotExisted(codespace sdk.CodespaceType, address sdk.AccAddress, proposalID uint64) sdk.Error
func ErrEmptyParam ¶ added in v0.10.2
func ErrEmptyParam(codespace sdk.CodespaceType) sdk.Error
func ErrInactiveProposal ¶ added in v0.10.2
func ErrInactiveProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func ErrInvalidDescription ¶ added in v0.10.2
func ErrInvalidDescription(codespace sdk.CodespaceType, description string) sdk.Error
func ErrInvalidGenesis ¶ added in v0.10.2
func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidParam ¶ added in v0.10.2
func ErrInvalidParam(codespace sdk.CodespaceType, str string) sdk.Error
func ErrInvalidParamNum ¶ added in v0.15.0
func ErrInvalidParamNum(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidParamOp ¶ added in v0.10.2
func ErrInvalidParamOp(codespace sdk.CodespaceType, opStr string) sdk.Error
func ErrInvalidPercent ¶ added in v0.10.2
func ErrInvalidProposalType ¶ added in v0.10.2
func ErrInvalidProposalType(codespace sdk.CodespaceType, proposalType ProposalKind) sdk.Error
func ErrInvalidTitle ¶ added in v0.10.2
func ErrInvalidTitle(codespace sdk.CodespaceType, title string) sdk.Error
func ErrInvalidUpgradeThreshold ¶ added in v0.15.0
func ErrInvalidUsageType ¶ added in v0.10.2
func ErrInvalidUsageType(codespace sdk.CodespaceType, usageType UsageType) sdk.Error
func ErrInvalidVote ¶ added in v0.10.2
func ErrInvalidVote(codespace sdk.CodespaceType, voteOption VoteOption) sdk.Error
func ErrMoreThanMaxProposal ¶ added in v0.10.2
func ErrNotEnoughInitialDeposit ¶ added in v0.10.2
func ErrNotInDepositPeriod ¶ added in v0.10.2
func ErrNotInDepositPeriod(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func ErrNotProfiler ¶ added in v0.10.2
func ErrNotProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
func ErrNotTrustee ¶ added in v0.10.2
func ErrNotTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
func ErrOnlyValidatorOrDelegatorVote ¶ added in v0.15.0
func ErrOnlyValidatorOrDelegatorVote(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
func ErrSwitchPeriodInProcess ¶ added in v0.10.2
func ErrSwitchPeriodInProcess(codespace sdk.CodespaceType) sdk.Error
func ErrUnknownProposal ¶ added in v0.10.2
func ErrUnknownProposal(codespace sdk.CodespaceType, proposalID uint64) sdk.Error
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis - store genesis parameters
func KeyActiveProposalQueueProposal ¶
Returns the key for a proposalID in the activeProposalQueue
func KeyDeposit ¶
func KeyDeposit(proposalID uint64, depositorAddr sdk.AccAddress) []byte
Key for getting a specific deposit from the store
func KeyDepositsSubspace ¶
Key for getting all deposits on a proposal from the store
func KeyInactiveProposalQueueProposal ¶
Returns the key for a proposalID in the activeProposalQueue
func KeyProposal ¶
Key for getting a specific proposal from the store
func KeyValidatorSet ¶ added in v0.10.2
func KeyVote ¶
func KeyVote(proposalID uint64, voterAddr sdk.AccAddress) []byte
Key for getting a specific vote from the store
func KeyVotesSubspace ¶
Key for getting all votes on a proposal from the store
func NewQuerier ¶
func ParamTypeTable ¶ added in v0.10.2
ParamTable for mint module
func PrefixActiveProposalQueueTime ¶
Returns the key for a proposalID in the activeProposalQueue
func PrefixInactiveProposalQueueTime ¶
Returns the key for a proposalID in the activeProposalQueue
func PrepForZeroHeightGenesis ¶ added in v0.10.2
func ValidProposalStatus ¶ added in v0.10.2
func ValidProposalStatus(status ProposalStatus) bool
is defined ProposalType?
func ValidProposalType ¶ added in v0.10.2
func ValidProposalType(pt ProposalKind) bool
is defined ProposalType?
func ValidVoteOption ¶ added in v0.10.2
func ValidVoteOption(option VoteOption) bool
Is defined VoteOption
func ValidateGenesis ¶ added in v0.10.2
func ValidateGenesis(data GenesisState) error
Types ¶
type AssetKeeper ¶ added in v0.15.0
type AssetKeeper interface { IssueToken(ctx sdk.Context, token exported.FungibleToken) (sdk.Tags, sdk.Error) HasToken(ctx sdk.Context, tokenId string) bool }
AssetKeeper expected asset keeper
type BasicProposal ¶ added in v0.15.0
type BasicProposal struct { ProposalID uint64 `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 ProposalStatus `json:"proposal_status"` // Status of the Proposal {Pending, Active, Passed, Rejected} TallyResult TallyResult `json:"tally_result"` // Result of Tallys SubmitTime time.Time `json:"submit_time"` // Time of the block where TxGovSubmitProposal was included DepositEndTime time.Time `json:"deposit_end_time"` // Time that the Proposal would expire if deposit amount isn't met TotalDeposit sdk.Coins `json:"total_deposit"` // Current deposit on this proposal. Initial value is set at InitialDeposit VotingStartTime time.Time `json:"voting_start_time"` // Time of the block where MinDeposit was reached. -1 if MinDeposit is not reached VotingEndTime time.Time `json:"voting_end_time"` // Time that the VotingPeriod for this proposal will end and votes will be tallied Proposer sdk.AccAddress `json:"proposer"` }
----------------------------------------------------------- Basic Proposals
func (BasicProposal) GetDepositEndTime ¶ added in v0.15.0
func (bp BasicProposal) GetDepositEndTime() time.Time
func (BasicProposal) GetDescription ¶ added in v0.15.0
func (bp BasicProposal) GetDescription() string
func (BasicProposal) GetProposalID ¶ added in v0.15.0
func (bp BasicProposal) GetProposalID() uint64
nolint
func (*BasicProposal) GetProposalLevel ¶ added in v0.15.0
func (bp *BasicProposal) GetProposalLevel() ProposalLevel
func (BasicProposal) GetProposalType ¶ added in v0.15.0
func (bp BasicProposal) GetProposalType() ProposalKind
func (*BasicProposal) GetProposer ¶ added in v0.15.0
func (bp *BasicProposal) GetProposer() sdk.AccAddress
func (BasicProposal) GetProtocolDefinition ¶ added in v0.15.0
func (bp BasicProposal) GetProtocolDefinition() sdk.ProtocolDefinition
func (BasicProposal) GetStatus ¶ added in v0.15.0
func (bp BasicProposal) GetStatus() ProposalStatus
func (BasicProposal) GetSubmitTime ¶ added in v0.15.0
func (bp BasicProposal) GetSubmitTime() time.Time
func (BasicProposal) GetTallyResult ¶ added in v0.15.0
func (bp BasicProposal) GetTallyResult() TallyResult
func (BasicProposal) GetTaxUsage ¶ added in v0.15.0
func (bp BasicProposal) GetTaxUsage() TaxUsage
func (BasicProposal) GetTitle ¶ added in v0.15.0
func (bp BasicProposal) GetTitle() string
func (BasicProposal) GetTotalDeposit ¶ added in v0.15.0
func (bp BasicProposal) GetTotalDeposit() sdk.Coins
func (BasicProposal) GetVotingEndTime ¶ added in v0.15.0
func (bp BasicProposal) GetVotingEndTime() time.Time
func (BasicProposal) GetVotingStartTime ¶ added in v0.15.0
func (bp BasicProposal) GetVotingStartTime() time.Time
func (BasicProposal) HumanString ¶ added in v0.15.0
func (bp BasicProposal) HumanString(converter sdk.CoinsConverter) string
func (*BasicProposal) SetDepositEndTime ¶ added in v0.15.0
func (bp *BasicProposal) SetDepositEndTime(depositEndTime time.Time)
func (*BasicProposal) SetDescription ¶ added in v0.15.0
func (bp *BasicProposal) SetDescription(description string)
func (*BasicProposal) SetProposalID ¶ added in v0.15.0
func (bp *BasicProposal) SetProposalID(proposalID uint64)
func (*BasicProposal) SetProposalType ¶ added in v0.15.0
func (bp *BasicProposal) SetProposalType(proposalType ProposalKind)
func (*BasicProposal) SetProtocolDefinition ¶ added in v0.15.0
func (bp *BasicProposal) SetProtocolDefinition(sdk.ProtocolDefinition)
func (*BasicProposal) SetStatus ¶ added in v0.15.0
func (bp *BasicProposal) SetStatus(status ProposalStatus)
func (*BasicProposal) SetSubmitTime ¶ added in v0.15.0
func (bp *BasicProposal) SetSubmitTime(submitTime time.Time)
func (*BasicProposal) SetTallyResult ¶ added in v0.15.0
func (bp *BasicProposal) SetTallyResult(tallyResult TallyResult)
func (*BasicProposal) SetTaxUsage ¶ added in v0.15.0
func (bp *BasicProposal) SetTaxUsage(taxUsage TaxUsage)
func (*BasicProposal) SetTitle ¶ added in v0.15.0
func (bp *BasicProposal) SetTitle(title string)
func (*BasicProposal) SetTotalDeposit ¶ added in v0.15.0
func (bp *BasicProposal) SetTotalDeposit(totalDeposit sdk.Coins)
func (*BasicProposal) SetVotingEndTime ¶ added in v0.15.0
func (bp *BasicProposal) SetVotingEndTime(votingEndTime time.Time)
func (*BasicProposal) SetVotingStartTime ¶ added in v0.15.0
func (bp *BasicProposal) SetVotingStartTime(votingStartTime time.Time)
func (BasicProposal) String ¶ added in v0.15.0
func (bp BasicProposal) String() string
type CommunityTaxUsageProposal ¶ added in v0.15.0
type CommunityTaxUsageProposal struct { BasicProposal TaxUsage TaxUsage `json:"tax_usage"` }
func (CommunityTaxUsageProposal) GetTaxUsage ¶ added in v0.15.0
func (tp CommunityTaxUsageProposal) GetTaxUsage() TaxUsage
func (*CommunityTaxUsageProposal) SetTaxUsage ¶ added in v0.15.0
func (tp *CommunityTaxUsageProposal) SetTaxUsage(taxUsage TaxUsage)
type Content ¶ added in v0.15.0
type Content interface { sdk.Msg GetTitle() string GetDescription() string GetProposalType() ProposalKind GetProposer() sdk.AccAddress GetInitialDeposit() sdk.Coins GetParams() Params }
type Deposit ¶ added in v0.10.2
type Deposit struct { Depositor sdk.AccAddress `json:"depositor"` // Address of the depositor ProposalID uint64 `json:"proposal_id"` // proposalID of the proposal Amount sdk.Coins `json:"amount"` // Deposit amount }
Deposit
func (Deposit) HumanString ¶ added in v0.15.0
func (d Deposit) HumanString(converter sdk.CoinsConverter) string
type DepositProcedure ¶ added in v0.10.2
type Deposits ¶ added in v0.15.0
type Deposits []Deposit
Deposits is a collection of depoist
func (Deposits) HumanString ¶ added in v0.15.0
func (d Deposits) HumanString(converter sdk.CoinsConverter) string
type GenesisState ¶
type GenesisState struct {
Params GovParams `json:"params"` // inflation params
}
GenesisState - all gov state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func DefaultGenesisStateForCliTest ¶
func DefaultGenesisStateForCliTest() GenesisState
get raw genesis raw message for testing
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis - output genesis parameters
func NewGenesisState ¶
func NewGenesisState(systemHaltPeriod int64, params GovParams) GenesisState
type GovParams ¶ added in v0.10.2
type GovParams struct { CriticalDepositPeriod time.Duration `json:"critical_deposit_period"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months CriticalMinDeposit sdk.Coins `json:"critical_min_deposit"` // Minimum deposit for a critical proposal to enter voting period. CriticalVotingPeriod time.Duration `json:"critical_voting_period"` // Length of the critical voting period. CriticalMaxNum uint64 `json:"critical_max_num"` CriticalThreshold sdk.Dec `json:"critical_threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5 CriticalVeto sdk.Dec `json:"critical_veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 CriticalParticipation sdk.Dec `json:"critical_participation"` // CriticalPenalty sdk.Dec `json:"critical_penalty"` // Penalty if validator does not vote ImportantDepositPeriod time.Duration `json:"important_deposit_period"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months ImportantMinDeposit sdk.Coins `json:"important_min_deposit"` // Minimum deposit for a important proposal to enter voting period. ImportantVotingPeriod time.Duration `json:"important_voting_period"` // Length of the important voting period. ImportantMaxNum uint64 `json:"important_max_num"` ImportantThreshold sdk.Dec `json:"important_threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5 ImportantVeto sdk.Dec `json:"important_veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 ImportantParticipation sdk.Dec `json:"important_participation"` // ImportantPenalty sdk.Dec `json:"important_penalty"` // Penalty if validator does not vote NormalDepositPeriod time.Duration `json:"normal_deposit_period"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months NormalMinDeposit sdk.Coins `json:"normal_min_deposit"` // Minimum deposit for a normal proposal to enter voting period. NormalVotingPeriod time.Duration `json:"normal_voting_period"` // Length of the normal voting period. NormalMaxNum uint64 `json:"normal_max_num"` NormalThreshold sdk.Dec `json:"normal_threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5 NormalVeto sdk.Dec `json:"normal_veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 NormalParticipation sdk.Dec `json:"normal_participation"` // NormalPenalty sdk.Dec `json:"normal_penalty"` // Penalty if validator does not vote SystemHaltPeriod int64 `json:"system_halt_period"` }
mint parameters
func DefaultParams ¶ added in v0.10.2
func DefaultParams() GovParams
default minting module parameters
func DefaultParamsForTest ¶ added in v0.15.0
func DefaultParamsForTest() GovParams
func (*GovParams) GetParamSpace ¶ added in v0.10.2
Implements params.ParamStruct
func (*GovParams) KeyValuePairs ¶ added in v0.10.2
func (p *GovParams) KeyValuePairs() params.KeyValuePairs
func (*GovParams) StringFromBytes ¶ added in v0.10.2
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Governance ProtocolKeeper
func NewKeeper ¶
func NewKeeper(key sdk.StoreKey, cdc *codec.Codec, paramSpace params.Subspace, paramsKeeper params.Keeper, protocolKeeper sdk.ProtocolKeeper, ck bank.Keeper, dk distribution.Keeper, guardianKeeper guardian.Keeper, ds sdk.DelegationSet, codespace sdk.CodespaceType, metrics *Metrics, ak AssetKeeper) Keeper
NewProtocolKeeper returns a governance keeper. It handles: - submitting governance proposals - depositing funds into proposals, and activating upon sufficient funds being deposited - users voting on proposals, with weight proportional to stake in the system - and tallying the result of the vote.
func (Keeper) ActiveProposalQueueIterator ¶
Returns an iterator for all the proposals in the Active Queue that expire by endTime
func (Keeper) AddCriticalProposalNum ¶ added in v0.10.2
func (Keeper) AddDeposit ¶
func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (sdk.Error, bool)
Adds or updates a deposit of a specific depositor on a specific proposal Activates voting period when appropriate
func (Keeper) AddImportantProposalNum ¶ added in v0.10.2
func (Keeper) AddNormalProposalNum ¶ added in v0.10.2
func (Keeper) AddProposalNum ¶ added in v0.10.2
func (keeper Keeper) AddProposalNum(ctx sdk.Context, p ProposalLevel, args ...interface{})
func (Keeper) AddVote ¶
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, option VoteOption) sdk.Error
Adds a vote on a specific proposal
func (Keeper) DeleteDeposits ¶
Deletes all the deposits on a specific proposal without refunding them
func (Keeper) DeleteProposal ¶
Implements sdk.AccountKeeper.
func (Keeper) DeleteValidatorSet ¶ added in v0.10.2
func (Keeper) GetCriticalProposalID ¶ added in v0.10.2
func (Keeper) GetCriticalProposalNum ¶ added in v0.10.2
func (Keeper) GetDeposit ¶
func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (Deposit, bool)
Gets the deposit of a specific depositor on a specific proposal
func (Keeper) GetDepositProcedure ¶ added in v0.10.2
func (keeper Keeper) GetDepositProcedure(ctx sdk.Context, p ProposalLevel) DepositProcedure
Returns the current Deposit Procedure from the global param store
func (Keeper) GetDeposits ¶
Gets all the deposits on a specific proposal
func (Keeper) GetImportantProposalNum ¶ added in v0.10.2
func (Keeper) GetLastProposalID ¶
Get the last used proposal ID
func (Keeper) GetMaxNumByProposalLevel ¶ added in v0.10.2
func (keeper Keeper) GetMaxNumByProposalLevel(ctx sdk.Context, p ProposalLevel) uint64
func (Keeper) GetNormalProposalNum ¶ added in v0.10.2
func (Keeper) GetParamSet ¶ added in v0.10.2
get inflation params from the global param store
func (Keeper) GetProposal ¶
Get Proposal from store by ProposalID
func (Keeper) GetProposalsFiltered ¶
func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, voterAddr sdk.AccAddress, depositorAddr sdk.AccAddress, status ProposalStatus, numLatest uint64) []Proposal
Get Proposal from store by ProposalID
func (Keeper) GetSystemHaltHeight ¶ added in v0.10.2
func (Keeper) GetSystemHaltPeriod ¶ added in v0.10.2
func (Keeper) GetTallyingProcedure ¶ added in v0.10.2
func (keeper Keeper) GetTallyingProcedure(ctx sdk.Context, p ProposalLevel) TallyingProcedure
Returns the current Tallying Procedure from the global param store
func (Keeper) GetValidatorSet ¶ added in v0.10.2
func (Keeper) GetVote ¶
func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (Vote, bool)
Gets the vote of a specific voter on a specific proposal
func (Keeper) GetVotingProcedure ¶ added in v0.10.2
func (keeper Keeper) GetVotingProcedure(ctx sdk.Context, p ProposalLevel) VotingProcedure
Returns the current Voting Procedure from the global param store
func (Keeper) HasReachedTheMaxProposalNum ¶ added in v0.10.2
func (Keeper) InactiveProposalQueueIterator ¶
Returns an iterator for all the proposals in the Inactive Queue that expire by endTime
func (Keeper) InsertActiveProposalQueue ¶
func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
Inserts a ProposalID into the active proposal queue at endTime
func (Keeper) InsertInactiveProposalQueue ¶
func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
Inserts a ProposalID into the inactive proposal queue at endTime
func (Keeper) RefundDeposits ¶
Returns and deletes all the deposits on a specific proposal
func (Keeper) RemoveFromActiveProposalQueue ¶
func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
removes a proposalID from the Active Proposal Queue
func (Keeper) RemoveFromInactiveProposalQueue ¶
func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, endTime time.Time, proposalID uint64)
removes a proposalID from the Inactive Proposal Queue
func (Keeper) SetCriticalProposalID ¶ added in v0.10.2
func (Keeper) SetImportantProposalNum ¶ added in v0.10.2
func (Keeper) SetNormalProposalNum ¶ added in v0.10.2
func (Keeper) SetParamSet ¶ added in v0.10.2
set inflation params from the global param store
func (Keeper) SetProposal ¶
Implements sdk.AccountKeeper.
func (Keeper) SetSystemHaltHeight ¶ added in v0.10.2
func (Keeper) SetValidatorSet ¶ added in v0.10.2
func (Keeper) SubCriticalProposalNum ¶ added in v0.10.2
func (Keeper) SubImportantProposalNum ¶ added in v0.10.2
func (Keeper) SubNormalProposalNum ¶ added in v0.10.2
func (Keeper) SubProposalNum ¶ added in v0.10.2
func (keeper Keeper) SubProposalNum(ctx sdk.Context, p ProposalLevel)
type Label ¶ added in v0.16.0
type Label = stdprometheus.Labels
type Metrics ¶ added in v0.15.0
type Metrics struct { ProposalStatus *stdprometheus.GaugeVec // 1:DepositPeriod 2:VotingPeriod 3:Passed 4:Rejected Vote *stdprometheus.GaugeVec // 1:Yes 2:Abstain 3:No 4:NoWithVeto Param *stdprometheus.GaugeVec // contains filtered or unexported fields }
func NopMetrics ¶ added in v0.15.0
func NopMetrics() *Metrics
func PrometheusMetrics ¶ added in v0.15.0
func PrometheusMetrics(config *cfg.InstrumentationConfig) *Metrics
PrometheusMetrics returns Metrics build using Prometheus client library.
func (*Metrics) AddParameter ¶ added in v0.16.0
func (*Metrics) AddVote ¶ added in v0.16.0
func (metrics *Metrics) AddVote(consAddr string, proposalID uint64, option VoteOption)
func (*Metrics) DeleteProposalStatus ¶ added in v0.16.0
func (*Metrics) DeleteVote ¶ added in v0.16.0
func (*Metrics) SetProposalStatus ¶ added in v0.16.0
func (metrics *Metrics) SetProposalStatus(proposalID uint64, status ProposalStatus)
type MsgDeposit ¶
type MsgDeposit struct { ProposalID uint64 `json:"proposal_id"` // ID of the proposal Depositor sdk.AccAddress `json:"depositor"` // Address of the depositor Amount sdk.Coins `json:"amount"` // Coins to add to the proposal's deposit }
----------------------------------------------------------- MsgDeposit
func NewMsgDeposit ¶
func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) MsgDeposit
func (MsgDeposit) Get ¶
func (msg MsgDeposit) Get(key interface{}) (value interface{})
Implements Msg.
func (MsgDeposit) String ¶
func (msg MsgDeposit) String() string
func (MsgDeposit) Type ¶
func (msg MsgDeposit) Type() string
type MsgSubmitCommunityTaxUsageProposal ¶ added in v0.15.0
type MsgSubmitCommunityTaxUsageProposal struct { MsgSubmitProposal Usage UsageType `json:"usage"` DestAddress sdk.AccAddress `json:"dest_address"` Percent sdk.Dec `json:"percent"` }
func NewMsgSubmitCommunityTaxUsageProposal ¶ added in v0.15.0
func NewMsgSubmitCommunityTaxUsageProposal(msgSubmitProposal MsgSubmitProposal, usage UsageType, destAddress sdk.AccAddress, percent sdk.Dec) MsgSubmitCommunityTaxUsageProposal
func (MsgSubmitCommunityTaxUsageProposal) GetSignBytes ¶ added in v0.15.0
func (msg MsgSubmitCommunityTaxUsageProposal) GetSignBytes() []byte
func (MsgSubmitCommunityTaxUsageProposal) ValidateBasic ¶ added in v0.15.0
func (msg MsgSubmitCommunityTaxUsageProposal) ValidateBasic() sdk.Error
type MsgSubmitProposal ¶
type MsgSubmitProposal struct { 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} Proposer sdk.AccAddress `json:"proposer"` // Address of the proposer InitialDeposit sdk.Coins `json:"initial_deposit"` // Initial deposit paid by sender. Must be strictly positive. Params Params `json:"params"` }
----------------------------------------------------------- MsgSubmitProposal
func NewMsgSubmitProposal ¶
func NewMsgSubmitProposal(title string, description string, proposalType ProposalKind, proposer sdk.AccAddress, initialDeposit sdk.Coins, params Params) MsgSubmitProposal
func (MsgSubmitProposal) EnsureLength ¶ added in v0.15.0
func (msg MsgSubmitProposal) EnsureLength() sdk.Error
func (MsgSubmitProposal) Get ¶
func (msg MsgSubmitProposal) Get(key interface{}) (value interface{})
Implements Msg.
func (MsgSubmitProposal) GetDescription ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetDescription() string
func (MsgSubmitProposal) GetInitialDeposit ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetInitialDeposit() sdk.Coins
func (MsgSubmitProposal) GetParams ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetParams() Params
func (MsgSubmitProposal) GetProposalType ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetProposalType() ProposalKind
func (MsgSubmitProposal) GetProposer ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetProposer() sdk.AccAddress
func (MsgSubmitProposal) GetSignBytes ¶
func (msg MsgSubmitProposal) GetSignBytes() []byte
Implements Msg.
func (MsgSubmitProposal) GetSigners ¶
func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress
Implements Msg.
func (MsgSubmitProposal) GetTitle ¶ added in v0.15.0
func (msg MsgSubmitProposal) GetTitle() string
func (MsgSubmitProposal) String ¶
func (msg MsgSubmitProposal) String() string
func (MsgSubmitProposal) Type ¶
func (msg MsgSubmitProposal) Type() string
func (MsgSubmitProposal) ValidateBasic ¶
func (msg MsgSubmitProposal) ValidateBasic() sdk.Error
Implements Msg.
type MsgSubmitSoftwareUpgradeProposal ¶
type MsgSubmitSoftwareUpgradeProposal struct { MsgSubmitProposal Version uint64 `json:"version"` Software string `json:"software"` SwitchHeight uint64 `json:"switch_height"` Threshold sdk.Dec `json:"threshold"` }
func NewMsgSubmitSoftwareUpgradeProposal ¶
func NewMsgSubmitSoftwareUpgradeProposal(msgSubmitProposal MsgSubmitProposal, version uint64, software string, switchHeight uint64, threshold sdk.Dec) MsgSubmitSoftwareUpgradeProposal
func (MsgSubmitSoftwareUpgradeProposal) GetSignBytes ¶
func (msg MsgSubmitSoftwareUpgradeProposal) GetSignBytes() []byte
func (MsgSubmitSoftwareUpgradeProposal) ValidateBasic ¶
func (msg MsgSubmitSoftwareUpgradeProposal) ValidateBasic() sdk.Error
type MsgSubmitTokenAdditionProposal ¶ added in v0.15.0
type MsgSubmitTokenAdditionProposal struct { MsgSubmitProposal Symbol string `json:"symbol"` CanonicalSymbol string `json:"canonical_symbol"` Name string `json:"name"` Decimal uint8 `json:"decimal"` MinUnitAlias string `json:"min_unit_alias"` }
func NewMsgSubmitTokenAdditionProposal ¶ added in v0.15.0
func NewMsgSubmitTokenAdditionProposal(msgSubmitProposal MsgSubmitProposal, symbol, canonicalSymbol, name, minUnitAlias string, decimal uint8) MsgSubmitTokenAdditionProposal
func (MsgSubmitTokenAdditionProposal) GetSignBytes ¶ added in v0.15.0
func (msg MsgSubmitTokenAdditionProposal) GetSignBytes() []byte
func (MsgSubmitTokenAdditionProposal) ValidateBasic ¶ added in v0.15.0
func (msg MsgSubmitTokenAdditionProposal) ValidateBasic() sdk.Error
type MsgVote ¶
type MsgVote struct { ProposalID uint64 `json:"proposal_id"` // ID of the proposal Voter sdk.AccAddress `json:"voter"` // address of the voter Option VoteOption `json:"option"` // option from OptionSet chosen by the voter }
----------------------------------------------------------- MsgVote
func NewMsgVote ¶
func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) MsgVote
type ParameterProposal ¶ added in v0.10.2
type ParameterProposal struct { BasicProposal Params Params `json:"params"` }
type PlainTextProposal ¶ added in v0.15.0
type PlainTextProposal struct {
BasicProposal
}
type Proposal ¶ added in v0.10.2
type Proposal interface { GetProposalID() uint64 SetProposalID(uint64) GetTitle() string SetTitle(string) GetDescription() string SetDescription(string) GetProposalType() ProposalKind SetProposalType(ProposalKind) GetStatus() ProposalStatus SetStatus(ProposalStatus) GetTallyResult() TallyResult SetTallyResult(TallyResult) GetSubmitTime() time.Time SetSubmitTime(time.Time) GetDepositEndTime() time.Time SetDepositEndTime(time.Time) GetTotalDeposit() sdk.Coins SetTotalDeposit(sdk.Coins) GetVotingStartTime() time.Time SetVotingStartTime(time.Time) GetVotingEndTime() time.Time SetVotingEndTime(time.Time) GetProposalLevel() ProposalLevel GetProposer() sdk.AccAddress String() string Validate(ctx sdk.Context, gk Keeper, verifyPropNum bool) sdk.Error Execute(ctx sdk.Context, gk Keeper) sdk.Error }
----------------------------------------------------------- Proposal interface
type ProposalKind ¶ added in v0.10.2
type ProposalKind byte
Type that represents Proposal Type as a byte
const ( ProposalTypeNil ProposalKind = 0x00 ProposalTypeParameter ProposalKind = 0x01 ProposalTypeSoftwareUpgrade ProposalKind = 0x02 ProposalTypeSystemHalt ProposalKind = 0x03 ProposalTypeCommunityTaxUsage ProposalKind = 0x04 ProposalTypePlainText ProposalKind = 0x05 ProposalTypeTokenAddition ProposalKind = 0x06 )
nolint
func ProposalTypeFromString ¶ added in v0.10.2
func ProposalTypeFromString(str string) (ProposalKind, error)
String to proposalType byte. Returns ff if invalid.
func (ProposalKind) Format ¶ added in v0.10.2
func (pt ProposalKind) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s nolint: errcheck
func (ProposalKind) GetProposalLevel ¶ added in v0.15.0
func (pt ProposalKind) GetProposalLevel() ProposalLevel
func (ProposalKind) Marshal ¶ added in v0.10.2
func (pt ProposalKind) Marshal() ([]byte, error)
Marshal needed for protobuf compatibility
func (ProposalKind) MarshalJSON ¶ added in v0.10.2
func (pt ProposalKind) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (ProposalKind) NewProposal ¶ added in v0.15.0
func (pt ProposalKind) NewProposal(content Content) (Proposal, sdk.Error)
func (ProposalKind) String ¶ added in v0.10.2
func (pt ProposalKind) String() string
Turns VoteOption byte to String
func (*ProposalKind) Unmarshal ¶ added in v0.10.2
func (pt *ProposalKind) Unmarshal(data []byte) error
Unmarshal needed for protobuf compatibility
func (*ProposalKind) UnmarshalJSON ¶ added in v0.10.2
func (pt *ProposalKind) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type ProposalLevel ¶ added in v0.10.2
type ProposalLevel byte
Type that represents Proposal Level as a byte
const ( ProposalLevelNil ProposalLevel = 0x00 ProposalLevelCritical ProposalLevel = 0x01 ProposalLevelImportant ProposalLevel = 0x02 ProposalLevelNormal ProposalLevel = 0x03 )
nolint
type ProposalQueue ¶ added in v0.10.2
type ProposalQueue []uint64
----------------------------------------------------------- ProposalQueue
type ProposalResult ¶ added in v0.10.2
type ProposalResult string
const ( PASS ProposalResult = "pass" REJECT ProposalResult = "reject" REJECTVETO ProposalResult = "reject-veto" )
type ProposalStatus ¶ added in v0.10.2
type ProposalStatus byte
Type that represents Proposal Status as a byte
const ( StatusNil ProposalStatus = 0x00 StatusDepositPeriod ProposalStatus = 0x01 StatusVotingPeriod ProposalStatus = 0x02 StatusPassed ProposalStatus = 0x03 StatusRejected ProposalStatus = 0x04 )
nolint
func ProposalStatusFromString ¶ added in v0.10.2
func ProposalStatusFromString(str string) (ProposalStatus, error)
ProposalStatusToString turns a string into a ProposalStatus
func (ProposalStatus) Format ¶ added in v0.10.2
func (status ProposalStatus) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s nolint: errcheck
func (ProposalStatus) Marshal ¶ added in v0.10.2
func (status ProposalStatus) Marshal() ([]byte, error)
Marshal needed for protobuf compatibility
func (ProposalStatus) MarshalJSON ¶ added in v0.10.2
func (status ProposalStatus) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (ProposalStatus) String ¶ added in v0.10.2
func (status ProposalStatus) String() string
Turns VoteStatus byte to String
func (*ProposalStatus) Unmarshal ¶ added in v0.10.2
func (status *ProposalStatus) Unmarshal(data []byte) error
Unmarshal needed for protobuf compatibility
func (*ProposalStatus) UnmarshalJSON ¶ added in v0.10.2
func (status *ProposalStatus) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type Proposals ¶ added in v0.15.0
type Proposals []Proposal
Proposals is an array of proposal
func (Proposals) HumanString ¶ added in v0.15.0
func (p Proposals) HumanString(converter sdk.CoinsConverter) string
type QueryDepositParams ¶
type QueryDepositParams struct { ProposalID uint64 Depositor sdk.AccAddress }
Params for query 'custom/gov/deposit'
type QueryDepositsParams ¶
type QueryDepositsParams struct {
ProposalID uint64
}
Params for query 'custom/gov/deposits'
type QueryProposalParams ¶
type QueryProposalParams struct {
ProposalID uint64
}
Params for query 'custom/gov/proposal'
type QueryProposalsParams ¶
type QueryProposalsParams struct { Voter sdk.AccAddress Depositor sdk.AccAddress ProposalStatus string Limit uint64 }
Params for query 'custom/gov/proposals'
type QueryTallyParams ¶
type QueryTallyParams struct {
ProposalID uint64
}
Params for query 'custom/gov/tally'
type QueryVoteParams ¶
type QueryVoteParams struct { ProposalID uint64 Voter sdk.AccAddress }
Params for query 'custom/gov/vote'
type QueryVotesParams ¶
type QueryVotesParams struct {
ProposalID uint64
}
Params for query 'custom/gov/votes'
type SoftwareUpgradeProposal ¶ added in v0.10.2
type SoftwareUpgradeProposal struct { BasicProposal ProtocolDefinition sdk.ProtocolDefinition `json:"protocol_definition"` }
func (SoftwareUpgradeProposal) GetProtocolDefinition ¶ added in v0.10.2
func (sp SoftwareUpgradeProposal) GetProtocolDefinition() sdk.ProtocolDefinition
func (*SoftwareUpgradeProposal) SetProtocolDefinition ¶ added in v0.10.2
func (sp *SoftwareUpgradeProposal) SetProtocolDefinition(upgrade sdk.ProtocolDefinition)
type SystemHaltProposal ¶ added in v0.10.2
type SystemHaltProposal struct {
BasicProposal
}
type TallyResult ¶ added in v0.10.2
type TallyResult struct { Yes sdk.Dec `json:"yes"` Abstain sdk.Dec `json:"abstain"` No sdk.Dec `json:"no"` NoWithVeto sdk.Dec `json:"no_with_veto"` SystemVotingPower sdk.Dec `json:"system_voting_power"` }
----------------------------------------------------------- Tally Results
func EmptyTallyResult ¶ added in v0.10.2
func EmptyTallyResult() TallyResult
checks if two proposals are equal
func (TallyResult) Equals ¶ added in v0.10.2
func (tr TallyResult) Equals(resultB TallyResult) bool
checks if two proposals are equal
func (TallyResult) String ¶ added in v0.15.0
func (tr TallyResult) String() string
type TallyingProcedure ¶ added in v0.10.2
type TallyingProcedure struct { Threshold sdk.Dec `json:"threshold"` // Minimum propotion of Yes votes for proposal to pass. Initial value: 0.5 Veto sdk.Dec `json:"veto"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 Participation sdk.Dec `json:"participation"` // Penalty sdk.Dec `json:"penalty"` // Penalty if validator does not vote }
type TaxUsage ¶ added in v0.10.2
type TaxUsage struct { Usage UsageType `json:"usage"` DestAddress sdk.AccAddress `json:"dest_address"` Percent sdk.Dec `json:"percent"` }
type TokenAdditionProposal ¶ added in v0.15.0
type TokenAdditionProposal struct { BasicProposal FToken exported.FungibleToken `json:"f_token"` }
func (TokenAdditionProposal) HumanString ¶ added in v0.15.0
func (atp TokenAdditionProposal) HumanString(converter sdk.CoinsConverter) string
type UsageType ¶ added in v0.10.2
type UsageType byte
func UsageTypeFromString ¶ added in v0.10.2
String to UsageType byte. Returns ff if invalid.
func (UsageType) Format ¶ added in v0.10.2
For Printf / Sprintf, returns bech32 when using %s nolint: errcheck
func (UsageType) MarshalJSON ¶ added in v0.10.2
Marshals to JSON using string
func (*UsageType) UnmarshalJSON ¶ added in v0.10.2
Unmarshals from JSON assuming Bech32 encoding
type Vote ¶ added in v0.10.2
type Vote struct { Voter sdk.AccAddress `json:"voter"` // address of the voter ProposalID uint64 `json:"proposal_id"` // proposalID of the proposal Option VoteOption `json:"option"` // option from OptionSet chosen by the voter }
Vote
type VoteOption ¶ added in v0.10.2
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 VoteOptionFromString ¶ added in v0.10.2
func VoteOptionFromString(str string) (VoteOption, error)
String to proposalType byte. Returns ff if invalid.
func (VoteOption) Format ¶ added in v0.10.2
func (vo VoteOption) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s nolint: errcheck
func (VoteOption) Marshal ¶ added in v0.10.2
func (vo VoteOption) Marshal() ([]byte, error)
Marshal needed for protobuf compatibility
func (VoteOption) MarshalJSON ¶ added in v0.10.2
func (vo VoteOption) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (VoteOption) String ¶ added in v0.10.2
func (vo VoteOption) String() string
Turns VoteOption byte to String
func (*VoteOption) Unmarshal ¶ added in v0.10.2
func (vo *VoteOption) Unmarshal(data []byte) error
Unmarshal needed for protobuf compatibility
func (*VoteOption) UnmarshalJSON ¶ added in v0.10.2
func (vo *VoteOption) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type VotingProcedure ¶ added in v0.10.2
Source Files ¶
- abci.go
- codec.go
- depositsvotes.go
- errors.go
- expected_keepers.go
- genesis.go
- govparams_util.go
- handler.go
- invariants.go
- keeper.go
- keeper_keys.go
- metrics.go
- msgs.go
- params.go
- proposal_community_tax_usage.go
- proposal_parameter.go
- proposal_plain_text.go
- proposal_software_upgrade.go
- proposal_system_halt.go
- proposal_token_addition.go
- proposal_util.go
- proposals.go
- queryable.go
- store_key.go
- tally.go
- test_common.go