Documentation ¶
Index ¶
- Constants
- func BeginBlocker(ctx sdk.Ctx, _ abci.RequestBeginBlock, k Keeper)
- func EndBlocker(ctx sdk.Ctx, k Keeper) []abci.ValidatorUpdate
- func NewQuerier(k Keeper) sdk.Querier
- func ParamKeyTable() sdk.KeyTable
- type Keeper
- func (k Keeper) AllApplications(ctx sdk.Ctx) (apps []exported.ApplicationI)
- func (k Keeper) Application(ctx sdk.Ctx, address sdk.Address) exported.ApplicationI
- func (k Keeper) BaselineThroughputStakeRate(ctx sdk.Ctx) (base int64)
- func (k Keeper) BeginUnstakingApplication(ctx sdk.Ctx, application types.Application)
- func (k Keeper) CalculateAppRelays(ctx sdk.Ctx, application types.Application) sdk.BigInt
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) ConvertState(ctx sdk.Ctx)
- func (k Keeper) DeleteApplication(ctx sdk.Ctx, addr sdk.Address)
- func (k Keeper) EditStakeApplication(ctx sdk.Ctx, application, updatedApplication types.Application, ...) sdk.Error
- func (k Keeper) FinishUnstakingApplication(ctx sdk.Ctx, application types.Application)
- func (k Keeper) ForceApplicationUnstake(ctx sdk.Ctx, application types.Application) sdk.Error
- func (k Keeper) GetAllApplications(ctx sdk.Ctx) (applications types.Applications)
- func (k Keeper) GetAllApplicationsWithOpts(ctx sdk.Ctx, opts types.QueryApplicationsWithOpts) (applications types.Applications)
- func (k Keeper) GetApplication(ctx sdk.Ctx, addr sdk.Address) (application types.Application, found bool)
- func (k Keeper) GetApplications(ctx sdk.Ctx, maxRetrieve uint16) (applications types.Applications)
- func (k Keeper) GetParams(ctx sdk.Ctx) types.Params
- func (k Keeper) GetStakedPool(ctx sdk.Ctx) (stakedPool exported.ModuleAccountI)
- func (k Keeper) GetStakedTokens(ctx sdk.Ctx) sdk.BigInt
- func (k Keeper) IncrementJailedApplications(ctx sdk.Ctx)
- func (k Keeper) IterateAndExecuteOverApps(ctx sdk.Ctx, ...)
- func (k Keeper) IterateAndExecuteOverStakedApps(ctx sdk.Ctx, ...)
- func (k Keeper) JailApplication(ctx sdk.Ctx, addr sdk.Address)
- func (k Keeper) LegacyForceApplicationUnstake(ctx sdk.Ctx, application types.Application) sdk.Error
- func (k Keeper) Logger(ctx sdk.Ctx) log.Logger
- func (k Keeper) MaxApplications(ctx sdk.Ctx) (res int64)
- func (k Keeper) MaxChains(ctx sdk.Ctx) (res int64)
- func (k Keeper) MinimumStake(ctx sdk.Ctx) (res int64)
- func (k Keeper) ParticipationRateOn(ctx sdk.Ctx) (isOn bool)
- func (k Keeper) SetApplication(ctx sdk.Ctx, application types.Application)
- func (k Keeper) SetApplications(ctx sdk.Ctx, applications types.Applications)
- func (k Keeper) SetParams(ctx sdk.Ctx, params types.Params)
- func (k Keeper) SetStakedApplication(ctx sdk.Ctx, application types.Application)
- func (k Keeper) SetUnstakingApplication(ctx sdk.Ctx, val types.Application)
- func (k Keeper) StakeApplication(ctx sdk.Ctx, application types.Application, amount sdk.BigInt) sdk.Error
- func (k Keeper) StakeDenom(ctx sdk.Ctx) string
- func (k Keeper) StakedRatio(ctx sdk.Ctx) sdk.BigDec
- func (k Keeper) StakingAdjustment(ctx sdk.Ctx) (adjustment int64)
- func (k Keeper) TotalTokens(ctx sdk.Ctx) sdk.BigInt
- func (k Keeper) UnStakingTime(ctx sdk.Ctx) (res time.Duration)
- func (k Keeper) UnjailApplication(ctx sdk.Ctx, addr sdk.Address)
- func (k Keeper) UpgradeCodec(ctx sdk.Ctx)
- func (k Keeper) ValidateApplicationBeginUnstaking(ctx sdk.Ctx, application types.Application) sdk.Error
- func (k Keeper) ValidateApplicationFinishUnstaking(ctx sdk.Ctx, application types.Application) sdk.Error
- func (k Keeper) ValidateApplicationStaking(ctx sdk.Ctx, application types.Application, amount sdk.BigInt) sdk.Error
- func (k Keeper) ValidateEditStake(ctx sdk.Ctx, currentApp types.Application, amount sdk.BigInt) sdk.Error
- func (k Keeper) ValidateUnjailMessage(ctx sdk.Ctx, msg types.MsgUnjail) (addr sdk.Address, err sdk.Error)
Constants ¶
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 ¶
NewQuerier - creates a query router for staking REST endpoints
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 ¶
Application - wrapper for GetApplication call
func (Keeper) BaselineThroughputStakeRate ¶
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 (Keeper) Codespace ¶
func (k Keeper) Codespace() sdk.CodespaceType
Codespace - Retrieve the codespace
func (Keeper) ConvertState ¶
func (Keeper) DeleteApplication ¶
SetValidator - Store validator in the main store
func (Keeper) EditStakeApplication ¶
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 ¶
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 ¶
GetApplications - Retrieve a a given amount of all the applications
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 ¶
GetStakedTokens - Retrieve total staking tokens supply which is staked
func (Keeper) IncrementJailedApplications ¶
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 ¶
JailApplication - Send a application to jail
func (Keeper) LegacyForceApplicationUnstake ¶
LegacyForceApplicationUnstake - Coerce unstake (called when slashed below the minimum)
func (Keeper) MaxApplications ¶
MaxApplications - Retrieve maximum number of applications
func (Keeper) MinimumStake ¶
MinimumStake - Retrieve minimum stake
func (Keeper) ParticipationRateOn ¶
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) 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 ¶
StakeDenom - Retrieve the denomination of coins.
func (Keeper) StakedRatio ¶
StakedRatio - Retrieve the fraction of the staking tokens which are currently staked
func (Keeper) StakingAdjustment ¶
StakingAdjustment - Retrieve stability adjustment
func (Keeper) TotalTokens ¶
TotalTokens - Retrieve total staking tokens from the total supply
func (Keeper) UnStakingTime ¶
UnStakingTime - Retrieve unstaking time param
func (Keeper) UnjailApplication ¶
UnjailApplication - Remove a application from jail
func (Keeper) UpgradeCodec ¶
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