Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AddTotalCollectedCoins(ctx sdk.Context, budgetName string, amount sdk.Coins)
- func (k Keeper) CollectBudgets(ctx sdk.Context) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetCodec() codec.BinaryCodec
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTotalCollectedCoins(ctx sdk.Context, budgetName string) sdk.Coins
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateAllTotalCollectedCoins(ctx sdk.Context, cb func(record types.BudgetRecord) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTotalCollectedCoins(ctx sdk.Context, budgetName string, amount sdk.Coins)
- type Querier
- func (k Querier) Addresses(_ context.Context, req *types.QueryAddressesRequest) (*types.QueryAddressesResponse, error)
- func (k Querier) Budgets(c context.Context, req *types.QueryBudgetsRequest) (*types.QueryBudgetsResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the budget store
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, blockedAddrs map[string]bool, ) Keeper
NewKeeper returns a budget keeper. It handles: - creating new ModuleAccounts for each pool ReserveAccount - sending to and from ModuleAccounts - minting, burning PoolCoins
func (Keeper) AddTotalCollectedCoins ¶
AddTotalCollectedCoins increases total collected coins for a budget.
func (Keeper) CollectBudgets ¶
CollectBudgets collects all the valid budgets registered in params.Budgets and distributes the total collected coins to destination address.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the budget module's genesis state.
func (Keeper) GetCodec ¶
func (k Keeper) GetCodec() codec.BinaryCodec
GetCodec return codec.Codec object used by the keeper
func (Keeper) GetTotalCollectedCoins ¶
GetTotalCollectedCoins returns total collected coins for a budget.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the budget module's state from a given genesis state.
func (Keeper) IterateAllTotalCollectedCoins ¶
func (k Keeper) IterateAllTotalCollectedCoins(ctx sdk.Context, cb func(record types.BudgetRecord) (stop bool))
IterateAllTotalCollectedCoins iterates over all the stored TotalCollectedCoins and performs a callback function. Stops iteration when callback returns true.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.
func (Querier) Addresses ¶
func (k Querier) Addresses(_ context.Context, req *types.QueryAddressesRequest) (*types.QueryAddressesResponse, error)
Addresses queries an address that can be used as source and destination is derived according to the given name, module name and address type.
func (Querier) Budgets ¶
func (k Querier) Budgets(c context.Context, req *types.QueryBudgetsRequest) (*types.QueryBudgetsResponse, error)
Budgets queries all budgets.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the budget module.