keeper

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const NumSessionsAppToGatewayUndelegationRetention = 2

NumSessionsAppToGatewayUndelegationRetention is the number of sessions for which undelegation from applications to gateways are delayed before being pruned. TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906. TODO_MAINNET(#516): Should this be configurable? Note that it should likely be a function of SubmitProofCloseWindowNumBlocks once implemented.

Variables

This section is empty.

Functions

func GetNumBlocksUndelegationRetention added in v0.0.2

func GetNumBlocksUndelegationRetention(sharedParams *sharedtypes.Params) int64

GetNumBlocksUndelegationRetention returns the number of blocks for which undelegations should be kept before being pruned, given the passed shared module parameters.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,

	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	gatewayKeeper types.GatewayKeeper,
	sharedKeeper types.SharedKeeper,
) Keeper

func (Keeper) EndBlockerAutoUndelegateFromUnstakedGateways added in v0.0.4

func (k Keeper) EndBlockerAutoUndelegateFromUnstakedGateways(ctx cosmostypes.Context) error

EndBlockerAutoUndelegateFromUnstakedGateways is called every block and handles Application auto-undelegating from unstaked gateways. TODO_BETA(@bryanchriswhite): Gateway unstaking should be delayed until the current block's session end height to align with the application's pending undelegations.

func (Keeper) EndBlockerPruneAppToGatewayPendingUndelegation added in v0.0.2

func (k Keeper) EndBlockerPruneAppToGatewayPendingUndelegation(ctx sdk.Context) error

EndBlockerPruneAppToGatewayPendingUndelegation runs at the end of each block and prunes app to gateway undelegations that have exceeded the retention delay.

func (Keeper) EndBlockerTransferApplication added in v0.0.10

func (k Keeper) EndBlockerTransferApplication(ctx context.Context) error

EndBlockerTransferApplication completes pending application transfers. This always happens on the last block of a session during which the transfer started. It is accomplished by:

  1. Copying the current state of the source app onto a new destination app
  2. Unstaking (removing) the source app
  3. Staking (storing) the destination app

func (Keeper) EndBlockerUnbondApplications added in v0.0.7

func (k Keeper) EndBlockerUnbondApplications(ctx context.Context) error

EndBlockerUnbondApplications unbonds applications whose unbonding period has elapsed.

func (Keeper) GetAllApplications

func (k Keeper) GetAllApplications(ctx context.Context) (apps []types.Application)

GetAllApplications returns all application

func (Keeper) GetApplication

func (k Keeper) GetApplication(
	ctx context.Context,
	appAddr string,
) (app types.Application, found bool)

GetApplication returns a application from its index

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetNumBlocksUndelegationRetention added in v0.0.3

func (k Keeper) GetNumBlocksUndelegationRetention(ctx context.Context) int64

GetNumBlocksUndelegationRetention returns the number of blocks for which undelegations should be kept before being pruned, given the current on-chain shared module parameters.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) RemoveApplication

func (k Keeper) RemoveApplication(ctx context.Context, appAddr string)

RemoveApplication removes a application from the store

func (Keeper) SetApplication

func (k Keeper) SetApplication(ctx context.Context, application types.Application)

SetApplication set a specific application in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) UnbondApplication added in v0.0.10

func (k Keeper) UnbondApplication(ctx context.Context, app *apptypes.Application) error

UnbondApplication transfers the application stake to the bank module balance for the corresponding account and removes the application from the application module state.

Jump to

Keyboard shortcuts

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