gov

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/hbtc-chain/bhchain/x/gov/types

nolint:deadcode unused

Index

Constants

View Source
const (
	MaxDescriptionLength         = types.MaxDescriptionLength
	MaxTitleLength               = types.MaxTitleLength
	DefaultCodespace             = types.DefaultCodespace
	CodeUnknownProposal          = types.CodeUnknownProposal
	CodeInactiveProposal         = types.CodeInactiveProposal
	CodeAlreadyActiveProposal    = types.CodeAlreadyActiveProposal
	CodeAlreadyFinishedProposal  = types.CodeAlreadyFinishedProposal
	CodeAddressNotStaked         = types.CodeAddressNotStaked
	CodeInvalidContent           = types.CodeInvalidContent
	CodeInvalidProposalType      = types.CodeInvalidProposalType
	CodeInvalidVote              = types.CodeInvalidVote
	CodeInvalidGenesis           = types.CodeInvalidGenesis
	CodeInvalidProposalStatus    = types.CodeInvalidProposalStatus
	CodeProposalHandlerNotExists = types.CodeProposalHandlerNotExists
	ModuleName                   = types.ModuleName
	StoreKey                     = types.StoreKey
	RouterKey                    = types.RouterKey
	QuerierRoute                 = types.QuerierRoute
	DefaultParamspace            = types.DefaultParamspace
	TypeMsgDeposit               = types.TypeMsgDeposit
	TypeMsgVote                  = types.TypeMsgVote
	TypeMsgSubmitProposal        = types.TypeMsgSubmitProposal
	StatusNil                    = types.StatusNil
	StatusDepositPeriod          = types.StatusDepositPeriod
	StatusVotingPeriod           = types.StatusVotingPeriod
	StatusPassed                 = types.StatusPassed
	StatusRejected               = types.StatusRejected
	StatusFailed                 = types.StatusFailed
	ProposalTypeText             = types.ProposalTypeText
	QueryParams                  = types.QueryParams
	QueryProposals               = types.QueryProposals
	QueryProposal                = types.QueryProposal
	QueryDeposits                = types.QueryDeposits
	QueryDeposit                 = types.QueryDeposit
	QueryVotes                   = types.QueryVotes
	QueryVote                    = types.QueryVote
	QueryTally                   = types.QueryTally
	ParamDeposit                 = types.ParamDeposit
	ParamVoting                  = types.ParamVoting
	ParamTallying                = types.ParamTallying
	OptionEmpty                  = types.OptionEmpty
	OptionYes                    = types.OptionYes
	OptionAbstain                = types.OptionAbstain
	OptionNo                     = types.OptionNo
	OptionNoWithVeto             = types.OptionNoWithVeto
)
View Source
const (
	// Default period for deposits & voting
	DefaultPeriod time.Duration = 86400 * 2 * time.Second // 2 days

)

Variables

View Source
var (
	// functions aliases
	RegisterCodec                 = types.RegisterCodec
	RegisterProposalTypeCodec     = types.RegisterProposalTypeCodec
	ValidateAbstract              = types.ValidateAbstract
	NewDeposit                    = types.NewDeposit
	ErrUnknownProposal            = types.ErrUnknownProposal
	ErrInactiveProposal           = types.ErrInactiveProposal
	ErrAlreadyActiveProposal      = types.ErrAlreadyActiveProposal
	ErrAlreadyFinishedProposal    = types.ErrAlreadyFinishedProposal
	ErrAddressNotStaked           = types.ErrAddressNotStaked
	ErrInvalidProposalContent     = types.ErrInvalidProposalContent
	ErrInvalidProposalType        = types.ErrInvalidProposalType
	ErrInvalidProposalVoteTime    = types.ErrInvalidProposalVoteTime
	ErrInvalidVote                = types.ErrInvalidVote
	ErrInvalidGenesis             = types.ErrInvalidGenesis
	ErrNoProposalHandlerExists    = types.ErrNoProposalHandlerExists
	ProposalKey                   = types.ProposalKey
	ActiveProposalByTimeKey       = types.ActiveProposalByTimeKey
	ActiveProposalQueueKey        = types.ActiveProposalQueueKey
	InactiveProposalByTimeKey     = types.InactiveProposalByTimeKey
	InactiveProposalQueueKey      = types.InactiveProposalQueueKey
	DepositsKey                   = types.DepositsKey
	DepositKey                    = types.DepositKey
	VotesKey                      = types.VotesKey
	VoteKey                       = types.VoteKey
	SplitProposalKey              = types.SplitProposalKey
	SplitActiveProposalQueueKey   = types.SplitActiveProposalQueueKey
	SplitInactiveProposalQueueKey = types.SplitInactiveProposalQueueKey
	SplitKeyDeposit               = types.SplitKeyDeposit
	SplitKeyVote                  = types.SplitKeyVote
	NewMsgSubmitProposal          = types.NewMsgSubmitProposal
	NewMsgDeposit                 = types.NewMsgDeposit
	NewMsgVote                    = types.NewMsgVote
	ParamKeyTable                 = types.ParamKeyTable
	NewDepositParams              = types.NewDepositParams
	NewTallyParams                = types.NewTallyParams
	NewVotingParams               = types.NewVotingParams
	NewParams                     = types.NewParams
	NewProposal                   = types.NewProposal
	ProposalStatusFromString      = types.ProposalStatusFromString
	ValidProposalStatus           = types.ValidProposalStatus
	NewTallyResult                = types.NewTallyResult
	NewTallyResultFromMap         = types.NewTallyResultFromMap
	EmptyTallyResult              = types.EmptyTallyResult
	NewTextProposal               = types.NewTextProposal
	RegisterProposalType          = types.RegisterProposalType
	ContentFromProposalType       = types.ContentFromProposalType
	IsValidProposalType           = types.IsValidProposalType
	ProposalHandler               = types.ProposalHandler
	NewQueryProposalParams        = types.NewQueryProposalParams
	NewQueryDepositParams         = types.NewQueryDepositParams
	NewQueryVoteParams            = types.NewQueryVoteParams
	NewQueryProposalsParams       = types.NewQueryProposalsParams
	NewVote                       = types.NewVote
	NewDaoVote                    = types.NewDaoVote
	VoteOptionFromString          = types.VoteOptionFromString
	ValidVoteOption               = types.ValidVoteOption

	// variable aliases
	ModuleCdc                   = types.ModuleCdc
	ProposalsKeyPrefix          = types.ProposalsKeyPrefix
	ActiveProposalQueuePrefix   = types.ActiveProposalQueuePrefix
	InactiveProposalQueuePrefix = types.InactiveProposalQueuePrefix
	ProposalIDKey               = types.ProposalIDKey
	DepositsKeyPrefix           = types.DepositsKeyPrefix
	VotesKeyPrefix              = types.VotesKeyPrefix
	ParamStoreKeyDepositParams  = types.ParamStoreKeyDepositParams
	ParamStoreKeyVotingParams   = types.ParamStoreKeyVotingParams
	ParamStoreKeyTallyParams    = types.ParamStoreKeyTallyParams
)

Functions

func AllInvariants

func AllInvariants(keeper Keeper) sdk.Invariant

AllInvariants runs all invariants of the governance module

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper Keeper)

EndBlocker called every block, process inflation, update validator set.

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, supplyKeeper SupplyKeeper, data GenesisState)

InitGenesis - store genesis parameters

func ModuleAccountInvariant

func ModuleAccountInvariant(keeper Keeper) sdk.Invariant

ModuleAccountInvariant checks that the module CU coins reflects the sum of deposit amounts held on store

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

Handle all "gov" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

func ProposalEqual

func ProposalEqual(proposalA Proposal, proposalB Proposal) bool

checks if two proposals are equal (note: slow, for tests only)

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all governance invariants

func SortAddresses

func SortAddresses(addrs []sdk.CUAddress)

Sorts Addresses

func SortByteArrays

func SortByteArrays(src [][]byte) [][]byte

Public

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis checks if parameters are within valid ranges

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

___________________________ app module

func NewAppModule

func NewAppModule(keeper Keeper, supplyKeeper SupplyKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

module begin-block

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

app module basics object

func NewAppModuleBasic

func NewAppModuleBasic(proposalHandlers ...client.ProposalHandler) AppModuleBasic

NewAppModuleBasic creates a new AppModuleBasic object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type Content

type Content = types.Content

type DaoVote

type DaoVote = types.DaoVote

type DaoVotes

type DaoVotes = types.DaoVotes

type Deposit

type Deposit = types.Deposit

type DepositParams

type DepositParams = types.DepositParams

type Deposits

type Deposits = types.Deposits

type DistributionKeeper

type DistributionKeeper interface {
	AddToFeePool(ctx sdk.Context, coins sdk.DecCoins)
	SetFeePool(ctx sdk.Context, feePool distrtype.FeePool)
	GetFeePool(ctx sdk.Context) distrtype.FeePool
}

type GenesisState

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

GenesisState - all staking state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() 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(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) GenesisState

NewGenesisState creates a new genesis state for the governance module

func (GenesisState) Equal

func (data GenesisState) Equal(data2 GenesisState) bool

Checks whether 2 GenesisState structs are equivalent.

func (GenesisState) IsEmpty

func (data GenesisState) IsEmpty() bool

Returns if a GenesisState is empty or has data in it

type Handler

type Handler = types.Handler

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Governance Keeper

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, key sdk.StoreKey, paramsKeeper params.Keeper, paramSpace params.Subspace,
	supplyKeeper SupplyKeeper, sk StakingKeeper, dk DistributionKeeper, tk TransferKeeper, codespace sdk.CodespaceType, rtr Router,
) Keeper

NewKeeper 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

func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

ActiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Active Queue that expire by endTime

func (Keeper) AddDaoVote

func (keeper Keeper) AddDaoVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.CUAddress, voteAmount sdk.Coins, option VoteOption) (sdk.Result, sdk.Error)

func (Keeper) AddDeposit

func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.CUAddress, depositAmount sdk.Coins) (sdk.Result, sdk.Error, bool)

AddDeposit adds or updates a deposit of a specific depositor on a specific proposal Activates voting period when appropriate

func (Keeper) AddVote

func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.CUAddress, option VoteOption) sdk.Error

AddVote Adds a vote on a specific proposal

func (Keeper) DeleteProposal

func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64)

DeleteProposal deletes a proposal from store

func (Keeper) GetAllDaoVotes

func (keeper Keeper) GetAllDaoVotes(ctx sdk.Context) (votes DaoVotes)

GetAllVotes returns all the votes from the store

func (Keeper) GetAllDeposits

func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits Deposits)

GetAllDeposits returns all the deposits from the store

func (Keeper) GetAllVotes

func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes Votes)

GetAllVotes returns all the votes from the store

func (Keeper) GetDaoVote

func (keeper Keeper) GetDaoVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.CUAddress) (vote DaoVote, found bool)

GetVote gets the vote from an address on a specific proposal

func (Keeper) GetDaoVotes

func (keeper Keeper) GetDaoVotes(ctx sdk.Context, proposalID uint64) (votes DaoVotes)

GetVotes returns all the votes from a proposal

func (Keeper) GetDaoVotesIterator

func (keeper Keeper) GetDaoVotesIterator(ctx sdk.Context, proposalID uint64) sdk.Iterator

GetVotesIterator gets all the votes on a specific proposal as an sdk.Iterator

func (Keeper) GetDeposit

func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.CUAddress) (deposit Deposit, found bool)

GetDeposit gets the deposit of a specific depositor on a specific proposal

func (Keeper) GetDepositParams

func (keeper Keeper) GetDepositParams(ctx sdk.Context) DepositParams

Returns the current DepositParams from the global param store

func (Keeper) GetDeposits

func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits Deposits)

GetDeposits returns all the deposits from a proposal

func (Keeper) GetDepositsIterator

func (keeper Keeper) GetDepositsIterator(ctx sdk.Context, proposalID uint64) sdk.Iterator

GetDepositsIterator gets all the deposits on a specific proposal as an sdk.Iterator

func (Keeper) GetGovernanceAccount

func (keeper Keeper) GetGovernanceAccount(ctx sdk.Context) exported.ModuleAccountI

GetGovernanceAccount returns the governance ModuleAccount

func (Keeper) GetProposal

func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (proposal Proposal, ok bool)

GetProposal get Proposal from store by ProposalID

func (Keeper) GetProposalID

func (keeper Keeper) GetProposalID(ctx sdk.Context) (proposalID uint64, err sdk.Error)

GetProposalID gets the highest proposal ID

func (Keeper) GetProposals

func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals Proposals)

GetProposals returns all the proposals from store

func (Keeper) GetProposalsFiltered

func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, voterAddr sdk.CUAddress, depositorAddr sdk.CUAddress, status ProposalStatus, numLatest uint64) []Proposal

GetProposalsFiltered get Proposals from store by ProposalID voterAddr will filter proposals by whether or not that address has voted on them depositorAddr will filter proposals by whether or not that address has deposited to them status will filter proposals by status numLatest will fetch a specified number of the most recent proposals, or 0 for all proposals

func (Keeper) GetTallyParams

func (keeper Keeper) GetTallyParams(ctx sdk.Context) TallyParams

Returns the current TallyParam from the global param store

func (Keeper) GetVote

func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.CUAddress) (vote Vote, found bool)

GetVote gets the vote from an address on a specific proposal

func (Keeper) GetVotes

func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes Votes)

GetVotes returns all the votes from a proposal

func (Keeper) GetVotesIterator

func (keeper Keeper) GetVotesIterator(ctx sdk.Context, proposalID uint64) sdk.Iterator

GetVotesIterator gets all the votes on a specific proposal as an sdk.Iterator

func (Keeper) GetVotingParams

func (keeper Keeper) GetVotingParams(ctx sdk.Context) VotingParams

Returns the current VotingParams from the global param store

func (Keeper) InactiveProposalQueueIterator

func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

InactiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Inactive Queue that expire by endTime

func (Keeper) InsertActiveProposalQueue

func (keeper Keeper) InsertActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)

InsertActiveProposalQueue inserts a ProposalID into the active proposal queue at endTime

func (Keeper) InsertInactiveProposalQueue

func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)

InsertInactiveProposalQueue Inserts a ProposalID into the inactive proposal queue at endTime

func (Keeper) IterateActiveProposalsQueue

func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool))

IterateActiveProposalsQueue iterates over the proposals in the active proposal queue and performs a callback function

func (Keeper) IterateAllDaoVotes

func (keeper Keeper) IterateAllDaoVotes(ctx sdk.Context, cb func(vote types.DaoVote) (stop bool))

func (Keeper) IterateAllDeposits

func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))

IterateAllDeposits iterates over the all the stored deposits and performs a callback function

func (Keeper) IterateAllVotes

func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) (stop bool))

IterateAllVotes iterates over the all the stored votes and performs a callback function

func (Keeper) IterateDaoVotes

func (keeper Keeper) IterateDaoVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.DaoVote) (stop bool))

IterateDaoVotes iterates over the all the proposals daovotes and performs a callback function

func (Keeper) IterateDeposits

func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit types.Deposit) (stop bool))

IterateDeposits iterates over the all the proposals deposits and performs a callback function

func (Keeper) IterateInactiveProposalsQueue

func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool))

IterateInactiveProposalsQueue iterates over the proposals in the inactive proposal queue and performs a callback function

func (Keeper) IterateProposals

func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool))

IterateProposals iterates over the all the proposals and performs a callback function

func (Keeper) IterateVotes

func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.Vote) (stop bool))

IterateVotes iterates over the all the proposals votes and performs a callback function

func (Keeper) Logger

func (keeper Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) RefundDeposits

func (keeper Keeper) RefundDeposits(ctx sdk.Context, proposalID uint64)

RefundDeposits refunds and deletes all the deposits on a specific proposal

func (Keeper) RemoveFromActiveProposalQueue

func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)

RemoveFromActiveProposalQueue removes a proposalID from the Active Proposal Queue

func (Keeper) RemoveFromInactiveProposalQueue

func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time)

RemoveFromInactiveProposalQueue removes a proposalID from the Inactive Proposal Queue

func (Keeper) SetProposal

func (keeper Keeper) SetProposal(ctx sdk.Context, proposal Proposal)

SetProposal set a proposal to store

func (Keeper) SubmitProposal

func (keeper Keeper) SubmitProposal(ctx sdk.Context, content Content, voteTime uint32) (Proposal, sdk.Error)

SubmitProposal create new proposal given a content

func (Keeper) TransferDepositsToCommunityPool

func (keeper Keeper) TransferDepositsToCommunityPool(ctx sdk.Context, proposalID uint64)

TransferDepositsToCommunityPool transfer all the deposits on a specific proposal to community pool

type MsgCancelDaoVote

type MsgCancelDaoVote = types.MsgCancelDaoVote

type MsgDaoVote

type MsgDaoVote = types.MsgDaoVote

type MsgDeposit

type MsgDeposit = types.MsgDeposit

type MsgSubmitProposal

type MsgSubmitProposal = types.MsgSubmitProposal

type MsgVote

type MsgVote = types.MsgVote

type Params

type Params = types.Params

type Proposal

type Proposal = types.Proposal

type ProposalQueue

type ProposalQueue = types.ProposalQueue

type ProposalStatus

type ProposalStatus = types.ProposalStatus

type Proposals

type Proposals = types.Proposals

type QueryDepositParams

type QueryDepositParams = types.QueryDepositParams

type QueryProposalParams

type QueryProposalParams = types.QueryProposalParams

type QueryProposalsParams

type QueryProposalsParams = types.QueryProposalsParams

type QueryVoteParams

type QueryVoteParams = types.QueryVoteParams

type Router

type Router interface {
	AddRoute(r string, h Handler) (rtr Router)
	HasRoute(r string) bool
	GetRoute(path string) (h Handler)
	Seal()
}

Router implements a governance Handler router.

TODO: Use generic router (ref #3976).

func NewRouter

func NewRouter() Router

type StakingKeeper

type StakingKeeper interface {
	// iterate through bonded validators by operator address, execute func for each validator
	IterateBondedValidatorsByPower(sdk.Context,
		func(index int64, validator stakingexported.ValidatorI) (stop bool))

	TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set

	IterateDelegations(ctx sdk.Context, delegator sdk.CUAddress,
		fn func(index int64, delegation stakingexported.DelegationI) (stop bool))
}

StakingKeeper expected staking keeper (Validator and Delegator sets)

type SupplyKeeper

type SupplyKeeper interface {
	GetModuleAddress(name string) sdk.CUAddress
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI

	// TODO remove with genesis 2-phases refactor https://github.com/hbtc-chain/bhchain/issues/2862
	SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI)

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error)
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.CUAddress, recipientModule string, amt sdk.Coins) (sdk.Result, sdk.Error)
	BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error
	GetSupply(ctx sdk.Context) supplyexported.SupplyI
}

SupplyKeeper defines the supply Keeper for module accounts

type TallyParams

type TallyParams = types.TallyParams

type TallyResult

type TallyResult = types.TallyResult

type TextProposal

type TextProposal = types.TextProposal

type TransferKeeper added in v0.9.3

type TransferKeeper interface {
	GetAllBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins
	AddCoins(ctx sdk.Context, addr sdk.CUAddress, coins sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
}

type Vote

type Vote = types.Vote

type VoteOption

type VoteOption = types.VoteOption

type Votes

type Votes = types.Votes

type VotingParams

type VotingParams = types.VotingParams

Directories

Path Synopsis
cli
nolint
nolint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL