Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error
- func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ sdkmath.LegacyDec) error
- type Keeper
- func (k Keeper) DeactivateVault(ctx sdk.Context, key string) error
- func (k Keeper) DeleteLock(ctx sdk.Context, addr sdk.AccAddress, key string)
- func (k Keeper) DeleteStake(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetDelegationPower(ctx sdk.Context, stakerAddr sdk.AccAddress) (sdkmath.Int, error)
- func (k Keeper) GetLock(ctx sdk.Context, addr sdk.AccAddress, key string) (types.Lock, bool)
- func (k Keeper) GetLockedPower(ctx sdk.Context, stakerAddr sdk.AccAddress, key string) (sdkmath.Int, error)
- func (k Keeper) GetLocks(ctx sdk.Context) (locks []types.Lock)
- func (k Keeper) GetLocksByAddress(ctx sdk.Context, addr sdk.AccAddress) (locks []types.Lock)
- func (k Keeper) GetLocksByAddressIterator(ctx sdk.Context, addr sdk.AccAddress) storetypes.Iterator
- func (k Keeper) GetLocksIterator(ctx sdk.Context) storetypes.Iterator
- func (k Keeper) GetModuleAccount(ctx sdk.Context) sdk.ModuleAccountI
- func (k Keeper) GetOrCreateVault(ctx sdk.Context, key string) (types.Vault, error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetStake(ctx sdk.Context, addr sdk.AccAddress) types.Stake
- func (k Keeper) GetStakedPower(ctx sdk.Context, stakerAddr sdk.AccAddress) sdkmath.Int
- func (k Keeper) GetStakes(ctx sdk.Context) (stakes []types.Stake)
- func (k Keeper) GetStakesIterator(ctx sdk.Context) storetypes.Iterator
- func (k Keeper) GetTotalPower(ctx sdk.Context, stakerAddr sdk.AccAddress) (sdkmath.Int, error)
- func (k Keeper) GetVault(ctx sdk.Context, key string) (types.Vault, bool)
- func (k Keeper) GetVaults(ctx sdk.Context) (vaults []types.Vault)
- func (k Keeper) GetVaultsIterator(ctx sdk.Context) storetypes.Iterator
- func (k Keeper) HasVault(ctx sdk.Context, vaultName string) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IsActiveVault(ctx sdk.Context, key string) bool
- func (k Keeper) IsLiquidStaker(addr sdk.AccAddress) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustGetVault(ctx sdk.Context, key string) types.Vault
- func (k Keeper) SetLock(ctx sdk.Context, lock types.Lock)
- func (k Keeper) SetLockedPower(ctx sdk.Context, stakerAddr sdk.AccAddress, key string, power sdkmath.Int) error
- func (k Keeper) SetModuleAccount(ctx sdk.Context, acc sdk.ModuleAccountI)
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error
- func (k Keeper) SetStake(ctx sdk.Context, stake types.Stake)
- func (k Keeper) SetVault(ctx sdk.Context, vault types.Vault)
- type Querier
- func (k Querier) Lock(c context.Context, req *types.QueryLockRequest) (*types.QueryLockResponse, error)
- func (k Querier) Locks(c context.Context, req *types.QueryLocksRequest) (*types.QueryLocksResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Stake(c context.Context, req *types.QueryStakeRequest) (*types.QueryStakeResponse, error)
- func (k Querier) Vault(c context.Context, req *types.QueryVaultRequest) (*types.QueryVaultResponse, error)
- func (k Querier) Vaults(c context.Context, req *types.QueryVaultsRequest) (*types.QueryVaultsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error
check if after delegation is modified, the locked power is still less than total delegation
func (Hooks) AfterUnbondingInitiated ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
check if after delegation is removed, the locked power is still less than total delegation
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the x/restake store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, authority string, ) Keeper
NewKeeper creates a new restake Keeper instance
func (Keeper) DeactivateVault ¶
DeactivateVault deactivates the vault.
func (Keeper) DeleteLock ¶
DeleteLock deletes a lock from the store.
func (Keeper) DeleteStake ¶
func (k Keeper) DeleteStake(ctx sdk.Context, addr sdk.AccAddress)
DeleteStake deletes a stake from the store.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the module's exported genesis
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetDelegationPower ¶
GetDelegationPower returns the power from delegation
func (Keeper) GetLockedPower ¶
func (k Keeper) GetLockedPower(ctx sdk.Context, stakerAddr sdk.AccAddress, key string) (sdkmath.Int, error)
GetLockedPower returns locked power of the address to the vault.
func (Keeper) GetLocksByAddress ¶
GetLocksByAddress gets all locks of the address.
func (Keeper) GetLocksByAddressIterator ¶
func (k Keeper) GetLocksByAddressIterator(ctx sdk.Context, addr sdk.AccAddress) storetypes.Iterator
GetLocksByAddressIterator gets iterator of locks of the speicfic address.
func (Keeper) GetLocksIterator ¶
func (k Keeper) GetLocksIterator(ctx sdk.Context) storetypes.Iterator
GetLocksIterator gets iterator of lock store.
func (Keeper) GetModuleAccount ¶
func (k Keeper) GetModuleAccount(ctx sdk.Context) sdk.ModuleAccountI
GetModuleAccount returns the restake ModuleAccount
func (Keeper) GetOrCreateVault ¶
GetOrCreateVault get the vault object by using key. If the vault doesn't exist, it will initialize the new vault.
func (Keeper) GetStakedPower ¶
GetStakedPower returns the power from staked coins in the module.
func (Keeper) GetStakesIterator ¶
func (k Keeper) GetStakesIterator(ctx sdk.Context) storetypes.Iterator
GetStakesIterator gets iterator of stake store.
func (Keeper) GetTotalPower ¶
GetTotalPower returns the total power of an address.
func (Keeper) GetVaultsIterator ¶
func (k Keeper) GetVaultsIterator(ctx sdk.Context) storetypes.Iterator
GetVaultsIterator gets iterator of vault store.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
InitGenesis initializes the module's state from a provided genesis state.
func (Keeper) IsActiveVault ¶
IsActiveVault checks whether the vault is active or not.
func (Keeper) IsLiquidStaker ¶
func (k Keeper) IsLiquidStaker(addr sdk.AccAddress) bool
Checks if an account associated with a given delegation is related to liquid staking
This is determined by checking if the account has a 32-length address which will identify the following scenarios:
- An account has tokenized their shares, and thus the delegation is owned by the tokenize share record module account
- A liquid staking provider is delegating through an ICA account
Both ICA accounts and tokenize share record module accounts have 32-length addresses
func (Keeper) MustGetVault ¶
MustGetVault gets a vault from store by name. Panics if can't get the vault.
func (Keeper) SetLockedPower ¶
func (k Keeper) SetLockedPower(ctx sdk.Context, stakerAddr sdk.AccAddress, key string, power sdkmath.Int) error
SetLockedPower sets the new locked power of the address to the vault This function will override the previous locked power.
func (Keeper) SetModuleAccount ¶
func (k Keeper) SetModuleAccount(ctx sdk.Context, acc sdk.ModuleAccountI)
SetModuleAccount sets a module account in the account keeper.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicated methods if used directly, and gRPC names take precedence over keeper.
func (Querier) Lock ¶
func (k Querier) Lock( c context.Context, req *types.QueryLockRequest, ) (*types.QueryLockResponse, error)
Lock queries info about a lock by using address and key
func (Querier) Locks ¶
func (k Querier) Locks( c context.Context, req *types.QueryLocksRequest, ) (*types.QueryLocksResponse, error)
Locks queries all locks with pagination.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries all params of the module.
func (Querier) Stake ¶
func (k Querier) Stake( c context.Context, req *types.QueryStakeRequest, ) (*types.QueryStakeResponse, error)
Stake queries stake information of an address.
func (Querier) Vault ¶
func (k Querier) Vault( c context.Context, req *types.QueryVaultRequest, ) (*types.QueryVaultResponse, error)
Vault queries info about a vault.
func (Querier) Vaults ¶
func (k Querier) Vaults( c context.Context, req *types.QueryVaultsRequest, ) (*types.QueryVaultsResponse, error)
Vaults queries all vaults with pagination.