keeper

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k Keeper) feegrant.MsgServer

NewMsgServerImpl returns an implementation of the feegrant MsgServer interface for the provided Keeper.

Types

type Keeper

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

Keeper manages state of all fee grants, as well as calculating approval. It must have a codec with all available allowances registered.

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, ak feegrant.AccountKeeper) Keeper

NewKeeper creates a fee grant Keeper

func (Keeper) Allowance

Allowance returns fee granted to the grantee by the granter.

func (Keeper) Allowances

Allowances queries all the allowances granted to the given grantee.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (*feegrant.GenesisState, error)

ExportGenesis will dump the contents of the keeper into a serializable GenesisState.

func (Keeper) GetAllowance

func (k Keeper) GetAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress) (feegrant.FeeAllowanceI, error)

GetAllowance returns the allowance between the granter and grantee. If there is none, it returns nil, nil. Returns an error on parsing issues

func (Keeper) GrantAllowance

func (k Keeper) GrantAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress, feeAllowance feegrant.FeeAllowanceI) error

GrantAllowance creates a new grant

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data *feegrant.GenesisState) error

InitGenesis will initialize the keeper from a *previously validated* GenesisState

func (Keeper) IterateAllFeeAllowances

func (k Keeper) IterateAllFeeAllowances(ctx sdk.Context, cb func(grant feegrant.Grant) bool) error

IterateAllFeeAllowances iterates over all the grants in the store. Callback to get all data, returns true to stop, false to keep reading Calling this without pagination is very expensive and only designed for export genesis

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) UseGrantedFees

func (k Keeper) UseGrantedFees(ctx sdk.Context, granter, grantee sdk.AccAddress, fee sdk.Coins, msgs []sdk.Msg) error

UseGrantedFees will try to pay the given fee from the granter's account as requested by the grantee

Jump to

Keyboard shortcuts

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