keeper

package
v0.47.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 17 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 storetypes.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) AllowancesByGranter added in v0.45.5

AllowancesByGranter queries all the allowances granted by the given granter

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) RemoveExpiredAllowances added in v0.46.0

func (k Keeper) RemoveExpiredAllowances(ctx sdk.Context)

RemoveExpiredAllowances iterates grantsByExpiryQueue and deletes the expired grants.

func (Keeper) UpdateAllowance added in v0.46.0

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

UpdateAllowance updates the 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

type Migrator added in v0.46.0

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v0.46.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.46.0

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

Jump to

Keyboard shortcuts

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