keeper

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 13 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 liquidstaking MsgServer interface for the provided Keeper.

Types

type Hooks

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

Wrapper struct

func (Hooks) AfterProposalDeposit

func (h Hooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress)

func (Hooks) AfterProposalFailedMinDeposit

func (h Hooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64)

func (Hooks) AfterProposalSubmission

func (h Hooks) AfterProposalSubmission(_ sdk.Context, _ uint64)

func (Hooks) AfterProposalVote

func (h Hooks) AfterProposalVote(_ sdk.Context, _ uint64, _ sdk.AccAddress)

func (Hooks) AfterProposalVotingPeriodEnded

func (h Hooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64)

func (Hooks) GetOtherVotes

func (h Hooks) GetOtherVotes(ctx sdk.Context, votes *govtypes.Votes, otherVotes *govtypes.OtherVotes)

GetOtherVotes calculate the voting power of the person who participated in liquid staking.

type Keeper

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

Keeper of the liquidstaking store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace,
	accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, distrKeeper types.Distrkeeper, govKeeper types.GovKeeper,
) Keeper

NewKeeper returns a liquidstaking keeper. It handles: - creating new ModuleAccounts for each pool ReserveAccount - sending to and from ModuleAccounts - minting, burning PoolCoins

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the liquidstaking module's genesis state.

func (Keeper) GetActiveLiquidValidators

func (k Keeper) GetActiveLiquidValidators(ctx sdk.Context) (vals []types.LiquidValidator, totalWeight sdk.Dec)

GetActiveLiquidValidators get the set of active liquid validators.

func (Keeper) GetAllLiquidValidators

func (k Keeper) GetAllLiquidValidators(ctx sdk.Context) (vals []types.LiquidValidator)

GetAllLiquidValidators get the set of all liquid validators with no limits, used during genesis dump

func (Keeper) GetAllLiquidValidatorsMap

func (k Keeper) GetAllLiquidValidatorsMap(ctx sdk.Context) map[string]types.LiquidValidator

GetAllLiquidValidatorsMap get the set of all liquid validators as map with no limits

func (Keeper) GetCodec

func (k Keeper) GetCodec() codec.BinaryCodec

GetCodec return codec.Codec object used by the keeper

func (Keeper) GetLiquidValidator

func (k Keeper) GetLiquidValidator(ctx sdk.Context, addr sdk.ValAddress) (val types.LiquidValidator, found bool)

GetLiquidValidator get a single liquid validator

func (Keeper) GetParams

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

GetParams gets the parameters for the liquidstaking module.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Create new distribution hooks

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

InitGenesis initializes the liquidstaking module's state from a given genesis state.

func (Keeper) LiquidBondDenom

func (k Keeper) LiquidBondDenom(ctx sdk.Context) (res string)

func (Keeper) LiquidStaking

func (k Keeper) LiquidStaking(
	ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, stakingCoin sdk.Coin) (newShares sdk.Dec, err error)

LiquidStaking ...

func (Keeper) LiquidUnbond

func (k Keeper) LiquidUnbond(
	ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec,
) (time.Time, stakingtypes.UnbondingDelegation, error)

LiquidUnbond ...

func (Keeper) LiquidUnstaking

func (k Keeper) LiquidUnstaking(
	ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, amount sdk.Coin,
) (time.Time, []stakingtypes.UnbondingDelegation, error)

LiquidUnstaking ...

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) NetAmount

func (k Keeper) NetAmount(ctx sdk.Context) sdk.Dec

func (Keeper) Rebalancing

func (k Keeper) Rebalancing(ctx sdk.Context, moduleAcc sdk.AccAddress, activeVals types.LiquidValidators, threshold sdk.Dec) (rebalancedLiquidVals types.LiquidValidators)

activeVals containing ValidatorStatusActive which is containing just added on whitelist(power 0) and ValidatorStatusDelisting

func (Keeper) SetLiquidValidator

func (k Keeper) SetLiquidValidator(ctx sdk.Context, val types.LiquidValidator)

SetLiquidValidator set the main record holding liquid validator details

func (Keeper) SetParams

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

SetParams sets the parameters for the liquidstaking module.

func (Keeper) UpdateLiquidValidators

func (k Keeper) UpdateLiquidValidators(ctx sdk.Context)

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.

func (Querier) LiquidValidators

LiquidValidators queries all liquid validators.

func (Querier) Params

Params queries the parameters of the liquidstaking module.

Jump to

Keyboard shortcuts

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