keeper

package
v0.0.0-...-4955b9a Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

This section is empty.

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Ctx, _ abci.RequestBeginBlock, k Keeper)

func EndBlocker

func EndBlocker(ctx sdk.Ctx, k Keeper) []abci.ValidatorUpdate

EndBlocker - Called at the end of every block, update validator set

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier - creates a query router for staking REST endpoints

func ParamKeyTable

func ParamKeyTable() sdk.KeyTable

ParamKeyTable for staking module

Types

type Keeper

type Keeper struct {
	Cdc           *codec.Codec
	AccountKeeper types.AuthKeeper
	POSKeeper     types.PosKeeper
	PocketKeeper  types.PocketKeeper
	Paramstore    sdk.Subspace

	// Cache
	ApplicationCache *sdk.Cache
	// contains filtered or unexported fields
}

Keeper of the staking store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, posKeeper types.PosKeeper, supplyKeeper types.AuthKeeper, pocketKeeper types.PocketKeeper,
	paramstore sdk.Subspace, codespace sdk.CodespaceType) Keeper

NewKeeper creates a new staking Keeper instance

func (Keeper) AllApplications

func (k Keeper) AllApplications(ctx sdk.Ctx) (apps []exported.ApplicationI)

AllApplications - Retrieve a list of all applications

func (Keeper) Application

func (k Keeper) Application(ctx sdk.Ctx, address sdk.Address) exported.ApplicationI

Application - wrapper for GetApplication call

func (Keeper) BaselineThroughputStakeRate

func (k Keeper) BaselineThroughputStakeRate(ctx sdk.Ctx) (base int64)

BaselineThroughputStakeRate - Retrieve base relays per POKT

func (Keeper) BeginUnstakingApplication

func (k Keeper) BeginUnstakingApplication(ctx sdk.Ctx, application types.Application)

BeginUnstakingApplication - Store ops when application begins to unstake -> starts the unstaking timer

func (Keeper) CalculateAppRelays

func (k Keeper) CalculateAppRelays(ctx sdk.Ctx, application types.Application) sdk.BigInt

func (Keeper) Codespace

func (k Keeper) Codespace() sdk.CodespaceType

Codespace - Retrieve the codespace

func (Keeper) ConvertState

func (k Keeper) ConvertState(ctx sdk.Ctx)

func (Keeper) DeleteApplication

func (k Keeper) DeleteApplication(ctx sdk.Ctx, addr sdk.Address)

SetValidator - Store validator in the main store

func (Keeper) EditStakeApplication

func (k Keeper) EditStakeApplication(ctx sdk.Ctx, application, updatedApplication types.Application, amount sdk.BigInt) sdk.Error

func (Keeper) FinishUnstakingApplication

func (k Keeper) FinishUnstakingApplication(ctx sdk.Ctx, application types.Application)

FinishUnstakingApplication - Store ops to unstake a application -> called after unstaking time is up

func (Keeper) ForceApplicationUnstake

func (k Keeper) ForceApplicationUnstake(ctx sdk.Ctx, application types.Application) sdk.Error

ForceValidatorUnstake - Coerce unstake (called when slashed below the minimum)

func (Keeper) GetAllApplications

func (k Keeper) GetAllApplications(ctx sdk.Ctx) (applications types.Applications)

GetAllApplications - Retrieve the set of all applications with no limits from the main store

func (Keeper) GetAllApplicationsWithOpts

func (k Keeper) GetAllApplicationsWithOpts(ctx sdk.Ctx, opts types.QueryApplicationsWithOpts) (applications types.Applications)

GetAllApplicationsWithOpts - Retrieve the set of all applications with no limits from the main store

func (Keeper) GetApplication

func (k Keeper) GetApplication(ctx sdk.Ctx, addr sdk.Address) (application types.Application, found bool)

GetApplication - Retrieve a single application from the main store

func (Keeper) GetApplications

func (k Keeper) GetApplications(ctx sdk.Ctx, maxRetrieve uint16) (applications types.Applications)

GetApplications - Retrieve a a given amount of all the applications

func (Keeper) GetParams

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

Get all parameteras as types.Params

func (Keeper) GetStakedPool

func (k Keeper) GetStakedPool(ctx sdk.Ctx) (stakedPool exported.ModuleAccountI)

GetStakedPool - Retrieve the staked tokens pool's module account

func (Keeper) GetStakedTokens

func (k Keeper) GetStakedTokens(ctx sdk.Ctx) sdk.BigInt

GetStakedTokens - Retrieve total staking tokens supply which is staked

func (Keeper) IncrementJailedApplications

func (k Keeper) IncrementJailedApplications(ctx sdk.Ctx)

func (Keeper) IterateAndExecuteOverApps

func (k Keeper) IterateAndExecuteOverApps(
	ctx sdk.Ctx, fn func(index int64, application exported.ApplicationI) (stop bool))

IterateAndExecuteOverApps - Goes through the application set and perform the provided function

func (Keeper) IterateAndExecuteOverStakedApps

func (k Keeper) IterateAndExecuteOverStakedApps(
	ctx sdk.Ctx, fn func(index int64, application exported.ApplicationI) (stop bool))

IterateAndExecuteOverStakedApps - Goes through the staked application set and execute handler

func (Keeper) JailApplication

func (k Keeper) JailApplication(ctx sdk.Ctx, addr sdk.Address)

JailApplication - Send a application to jail

func (Keeper) LegacyForceApplicationUnstake

func (k Keeper) LegacyForceApplicationUnstake(ctx sdk.Ctx, application types.Application) sdk.Error

LegacyForceApplicationUnstake - Coerce unstake (called when slashed below the minimum)

func (Keeper) Logger

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

Logger - returns a module-specific logger.

func (Keeper) MaxApplications

func (k Keeper) MaxApplications(ctx sdk.Ctx) (res int64)

MaxApplications - Retrieve maximum number of applications

func (Keeper) MaxChains

func (k Keeper) MaxChains(ctx sdk.Ctx) (res int64)

MaxChains - Retrieve maximum chains

func (Keeper) MinimumStake

func (k Keeper) MinimumStake(ctx sdk.Ctx) (res int64)

MinimumStake - Retrieve minimum stake

func (Keeper) ParticipationRateOn

func (k Keeper) ParticipationRateOn(ctx sdk.Ctx) (isOn bool)

ParticipationRateOn - Retrieve participation rate

func (Keeper) SetApplication

func (k Keeper) SetApplication(ctx sdk.Ctx, application types.Application)

SetApplication - Add a single application the main store

func (Keeper) SetApplications

func (k Keeper) SetApplications(ctx sdk.Ctx, applications types.Applications)

func (Keeper) SetParams

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

SetParams - Apply set of params

func (Keeper) SetStakedApplication

func (k Keeper) SetStakedApplication(ctx sdk.Ctx, application types.Application)

SetStakedApplication - Store staked application

func (Keeper) SetUnstakingApplication

func (k Keeper) SetUnstakingApplication(ctx sdk.Ctx, val types.Application)

SetUnstakingApplication - Store an application address to the appropriate position in the unstaking queue

func (Keeper) StakeApplication

func (k Keeper) StakeApplication(ctx sdk.Ctx, application types.Application, amount sdk.BigInt) sdk.Error

StakeApplication - Store ops when a application stakes

func (Keeper) StakeDenom

func (k Keeper) StakeDenom(ctx sdk.Ctx) string

StakeDenom - Retrieve the denomination of coins.

func (Keeper) StakedRatio

func (k Keeper) StakedRatio(ctx sdk.Ctx) sdk.BigDec

StakedRatio - Retrieve the fraction of the staking tokens which are currently staked

func (Keeper) StakingAdjustment

func (k Keeper) StakingAdjustment(ctx sdk.Ctx) (adjustment int64)

StakingAdjustment - Retrieve stability adjustment

func (Keeper) TotalTokens

func (k Keeper) TotalTokens(ctx sdk.Ctx) sdk.BigInt

TotalTokens - Retrieve total staking tokens from the total supply

func (Keeper) UnStakingTime

func (k Keeper) UnStakingTime(ctx sdk.Ctx) (res time.Duration)

UnStakingTime - Retrieve unstaking time param

func (Keeper) UnjailApplication

func (k Keeper) UnjailApplication(ctx sdk.Ctx, addr sdk.Address)

UnjailApplication - Remove a application from jail

func (Keeper) UpgradeCodec

func (k Keeper) UpgradeCodec(ctx sdk.Ctx)

func (Keeper) ValidateApplicationBeginUnstaking

func (k Keeper) ValidateApplicationBeginUnstaking(ctx sdk.Ctx, application types.Application) sdk.Error

ValidateApplicationBeginUnstaking - Check for validator status

func (Keeper) ValidateApplicationFinishUnstaking

func (k Keeper) ValidateApplicationFinishUnstaking(ctx sdk.Ctx, application types.Application) sdk.Error

ValidateApplicationFinishUnstaking - Check if application can finish unstaking

func (Keeper) ValidateApplicationStaking

func (k Keeper) ValidateApplicationStaking(ctx sdk.Ctx, application types.Application, amount sdk.BigInt) sdk.Error

ValidateApplicationStaking - Check application before staking

func (Keeper) ValidateEditStake

func (k Keeper) ValidateEditStake(ctx sdk.Ctx, currentApp types.Application, amount sdk.BigInt) sdk.Error

ValidateEditStake - Validate the updates to a current staked validator

func (Keeper) ValidateUnjailMessage

func (k Keeper) ValidateUnjailMessage(ctx sdk.Ctx, msg types.MsgUnjail) (addr sdk.Address, err sdk.Error)

ValidateUnjailMessage - Check unjail message

Jump to

Keyboard shortcuts

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