keeper

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

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 MsgServer interface for the provided Keeper.

func PublicKeyToHex

func PublicKeyToHex(pubKey crypto.PubKey) string

Types

type Delegation

type Delegation struct {
	Account         string `json:"account"`
	DelegatedAmount int64  `json:"delegated_amount"`
}

type HeartbeatManager

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

func NewHeartbeatManager

func NewHeartbeatManager(storeService store.KVStoreService, keeper *Keeper) *HeartbeatManager

func (*HeartbeatManager) GetDelegationData

func (hm *HeartbeatManager) GetDelegationData(ctx sdk.Context) ([]Delegation, error)

func (*HeartbeatManager) SendHeartbeatIfDataChanged

func (hm *HeartbeatManager) SendHeartbeatIfDataChanged(ctx sdk.Context, data []Delegation) error

func (*HeartbeatManager) StartHeartbeatTimer

func (hm *HeartbeatManager) StartHeartbeatTimer(ctx sdk.Context)

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	ps paramtypes.Subspace,
	bk types.BankKeeper,
	authority string,
	storeService store.KVStoreService,
	ak types.AccountKeeper,

) *Keeper

func (Keeper) AddUnbondingEntry

func (k Keeper) AddUnbondingEntry(ctx context.Context, entry types.UnbondingEntry) error

AddUnbondingEntry adds a new unbonding entry for a given account.

func (Keeper) AllDelegations

AllDelegations implements the QueryServer.AllDelegations method

func (Keeper) DelegateTokens

func (k Keeper) DelegateTokens(ctx context.Context, delegator sdk.AccAddress, amount sdkmath.Int) error

DelegateTokens locks the tokens for gridnode delegation

func (Keeper) GetBankKeeper

func (k Keeper) GetBankKeeper() types.BankKeeper

func (Keeper) GetBondingPrefix

func (k Keeper) GetBondingPrefix() string

func (Keeper) GetDelegatedAmount

func (k Keeper) GetDelegatedAmount(ctx context.Context, delegator sdk.AccAddress) sdkmath.Int

func (Keeper) GetLockedBalance

func (k Keeper) GetLockedBalance(ctx context.Context, delegator sdk.AccAddress) sdkmath.Int

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetPublicKeyForDelegator

func (k Keeper) GetPublicKeyForDelegator(ctx context.Context, delegator sdk.AccAddress) (string, error)

func (Keeper) GetStoreKey

func (k Keeper) GetStoreKey() storetypes.StoreKey

func (Keeper) GetStoreService

func (k Keeper) GetStoreService() store.KVStoreService

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) QueryAllDelegations

func (k Keeper) QueryAllDelegations(ctx context.Context) ([]types.DelegationInfo, error)

func (Keeper) SetDelegatedAmount

func (k Keeper) SetDelegatedAmount(ctx context.Context, delegator sdk.AccAddress, amount sdkmath.Int)

func (Keeper) SetLockedBalance

func (k Keeper) SetLockedBalance(ctx context.Context, delegator sdk.AccAddress, amount sdkmath.Int, pubKey string)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (*Keeper) StartHeartbeatTimer

func (k *Keeper) StartHeartbeatTimer(ctx sdk.Context)

func (Keeper) UndelegateTokens

func (k Keeper) UndelegateTokens(ctx context.Context, account sdk.AccAddress, amount sdkmath.Int) error

UndelegateTokens unlocks the tokens from gridnode delegation

Jump to

Keyboard shortcuts

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