keeper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 59

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, storeService store.KVStoreService, ak feegrant.AccountKeeper) Keeper

NewKeeper creates a feegrant Keeper

func (Keeper) Allowance

Allowance returns granted allowance to the grantee by the granter.

func (Keeper) Allowances

Allowances queries all the allowances granted to the given grantee.

func (Keeper) AllowancesByGranter

AllowancesByGranter queries all the allowances granted by the given granter

func (Keeper) ExportGenesis

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

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

func (Keeper) GetAllowance

func (k Keeper) GetAllowance(ctx context.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 context.Context, granter, grantee sdk.AccAddress, feeAllowance feegrant.FeeAllowanceI) error

GrantAllowance creates a new grant

func (Keeper) InitGenesis

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

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

func (Keeper) IterateAllFeeAllowances

func (k Keeper) IterateAllFeeAllowances(ctx context.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

func (k Keeper) RemoveExpiredAllowances(ctx context.Context, limit int32) error

RemoveExpiredAllowances iterates grantsByExpiryQueue and deletes the expired grants.

func (Keeper) SetBankKeeper added in v0.1.1

func (k Keeper) SetBankKeeper(bk feegrant.BankKeeper) Keeper

Super ugly hack to not be breaking in v0.50 and v0.47 DO NOT USE.

func (Keeper) UpdateAllowance

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

UpdateAllowance updates the existing grant.

func (Keeper) UseGrantedFees

func (k Keeper) UseGrantedFees(ctx context.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

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

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

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