keeper

package
v5.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func (k Keeper) AddTotalCollectedCoins(ctx sdk.Context, budgetName string, amount sdk.Coins)

AddTotalCollectedCoins increases total collected coins for a budget.

func (Keeper) CollectBudgets

func (k Keeper) CollectBudgets(ctx sdk.Context) error

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) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the parameters for the budget module.

func (Keeper) GetTotalCollectedCoins

func (k Keeper) GetTotalCollectedCoins(ctx sdk.Context, budgetName string) sdk.Coins

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.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the parameters for the budget module.

func (Keeper) SetTotalCollectedCoins

func (k Keeper) SetTotalCollectedCoins(ctx sdk.Context, budgetName string, amount sdk.Coins)

SetTotalCollectedCoins sets total collected coins for a budget.

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

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

Budgets queries all budgets.

func (Querier) Params

Params queries the parameters of the budget module.

Jump to

Keyboard shortcuts

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