keeper

package
v0.43.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 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) types.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.BinaryMarshaler, storeKey sdk.StoreKey, ak types.AccountKeeper) Keeper

NewKeeper creates a fee grant Keeper

func (Keeper) FeeAllowance

FeeAllowance returns fee granted to the grantee by the granter.

func (Keeper) GetFeeAllowance

func (k Keeper) GetFeeAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress) (types.FeeAllowanceI, error)

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

func (Keeper) GetFeeGrant

func (k Keeper) GetFeeGrant(ctx sdk.Context, granter sdk.AccAddress, grantee sdk.AccAddress) (types.FeeAllowanceGrant, bool)

GetFeeGrant returns entire grant between both accounts

func (Keeper) GrantFeeAllowance

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

GrantFeeAllowance creates a new grant

func (Keeper) IterateAllFeeAllowances

func (k Keeper) IterateAllFeeAllowances(ctx sdk.Context, cb func(types.FeeAllowanceGrant) 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) IterateAllGranteeFeeAllowances

func (k Keeper) IterateAllGranteeFeeAllowances(ctx sdk.Context, grantee sdk.AccAddress, cb func(types.FeeAllowanceGrant) bool) error

IterateAllGranteeFeeAllowances iterates over all the grants from anyone to the given grantee. Callback to get all data, returns true to stop, false to keep reading

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) RevokeFeeAllowance

func (k Keeper) RevokeFeeAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress) error

RevokeFeeAllowance removes an existing grant

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