keeper

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 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(keeper *Keeper) types.MsgServer

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

Types

type BankHooks

type BankHooks interface {
	TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins)       // Must be before any send is executed
	BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error // Must be before any send is executed
}

type Keeper

type Keeper struct {
	bankkeeper.BaseKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	ak types.AccountKeeper,
	blockedAddrs map[string]bool,
	authority string,
	logger log.Logger,
) Keeper

func (Keeper) BlockBeforeSend

func (k Keeper) BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error

BlockBeforeSend executes the BlockBeforeSend hook if registered.

func (Keeper) DelegateCoins

func (k Keeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error

func (Keeper) DelegateCoinsFromAccountToModule

func (k Keeper) DelegateCoinsFromAccountToModule(
	ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins,
) error

DelegateCoinsFromAccountToModule delegates coins and transfers them from a delegator account to a module account. It will panic if the module account does not exist or is unauthorized.

func (Keeper) SendCoins

func (k Keeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error

func (Keeper) SendCoinsFromAccountToModule

func (k Keeper) SendCoinsFromAccountToModule(
	ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins,
) error

SendCoinsFromAccountToModule transfers coins from an AccAddress to a ModuleAccount. It will panic if the module account does not exist.

func (Keeper) SendCoinsFromModuleToAccount

func (k Keeper) SendCoinsFromModuleToAccount(
	ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins,
) error

func (Keeper) SendCoinsFromModuleToModule

func (k Keeper) SendCoinsFromModuleToModule(
	ctx context.Context, senderModule, recipientModule string, amt sdk.Coins,
) error

SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another. It will panic if either module account does not exist. SendCoinsFromModuleToModule is the only send method that does not call both BlockBeforeSend and TrackBeforeSend hook. It only calls the TrackBeforeSend hook.

func (Keeper) SendCoinsWithoutBlockHook

func (k Keeper) SendCoinsWithoutBlockHook(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error

SendCoinsWithoutBlockHook calls sendCoins without calling the `BlockBeforeSend` hook.

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(bh BankHooks) *Keeper

func (Keeper) TrackBeforeSend

func (k Keeper) TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins)

TrackBeforeSend executes the TrackBeforeSend hook if registered.

func (Keeper) UndelegateCoins

func (k Keeper) UndelegateCoins(ctx context.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error

func (Keeper) UndelegateCoinsFromModuleToAccount

func (k Keeper) UndelegateCoinsFromModuleToAccount(
	ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins,
) error

UndelegateCoinsFromModuleToAccount undelegates the unbonding coins and transfers them from a module account to the delegator account. It will panic if the module account does not exist or is unauthorized.

Jump to

Keyboard shortcuts

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