Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func SetDelegationKeeper(k *Keeper, delegationKeeper delegationKeeper.Keeper)
- type Keeper
- func (k Keeper) AddActiveStaker(ctx sdk.Context, staker string)
- func (k Keeper) AddOneToCount(ctx sdk.Context, poolId uint64)
- func (k Keeper) AddValaccountToPool(ctx sdk.Context, poolId uint64, stakerAddress string, valaddress string)
- func (k Keeper) AppendStaker(ctx sdk.Context, staker types.Staker)
- func (k Keeper) AssertValaccountAuthorized(ctx sdk.Context, poolId uint64, stakerAddress string, valaddress string) error
- func (k Keeper) DoesLeavePoolEntryExistByIndex2(ctx sdk.Context, staker string, poolId uint64) bool
- func (k Keeper) DoesStakerExist(ctx sdk.Context, staker string) bool
- func (k Keeper) DoesValaccountExist(ctx sdk.Context, poolId uint64, stakerAddress string) bool
- func (k Keeper) GetActiveStakers(ctx sdk.Context) []string
- func (k Keeper) GetActiveValidators(ctx context.Context) (validators []interface{})
- func (k Keeper) GetAllCommissionChangeEntries(ctx sdk.Context) (list []types.CommissionChangeEntry)
- func (k Keeper) GetAllLeavePoolEntries(ctx sdk.Context) (list []types.LeavePoolEntry)
- func (k Keeper) GetAllStakerAddressesOfPool(ctx sdk.Context, poolId uint64) (stakers []string)
- func (k Keeper) GetAllStakers(ctx sdk.Context) (list []types.Staker)
- func (k Keeper) GetAllValaccounts(ctx sdk.Context) (list []types.Valaccount)
- func (k Keeper) GetAllValaccountsOfPool(ctx sdk.Context, poolId uint64) (val []*types.Valaccount)
- func (k Keeper) GetCommission(ctx sdk.Context, stakerAddress string) math.LegacyDec
- func (k Keeper) GetCommissionChangeEntry(ctx sdk.Context, index uint64) (val types.CommissionChangeEntry, found bool)
- func (k Keeper) GetCommissionChangeEntryByIndex2(ctx sdk.Context, staker string) (val types.CommissionChangeEntry, found bool)
- func (k Keeper) GetCommissionChangeTime(ctx sdk.Context) (res uint64)
- func (k Keeper) GetDelegations(ctx context.Context, delegator string) (validators []string, amounts []math.LegacyDec)
- func (k Keeper) GetLeavePoolEntry(ctx sdk.Context, index uint64) (val types.LeavePoolEntry, found bool)
- func (k Keeper) GetLeavePoolEntryByIndex2(ctx sdk.Context, staker string, poolId uint64) (val types.LeavePoolEntry, found bool)
- func (k Keeper) GetLeavePoolTime(ctx sdk.Context) (res uint64)
- func (k Keeper) GetPaginatedStakerQuery(ctx sdk.Context, pagination *query.PageRequest, ...) (*query.PageResponse, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPoolCount(ctx sdk.Context, stakerAddress string) (poolCount uint64)
- func (k Keeper) GetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER) (state types.QueueState)
- func (k Keeper) GetStaker(ctx sdk.Context, staker string) (val types.Staker, found bool)
- func (k Keeper) GetStakerCountOfPool(ctx sdk.Context, poolId uint64) uint64
- func (k Keeper) GetValaccount(ctx sdk.Context, poolId uint64, stakerAddress string) (val types.Valaccount, found bool)
- func (k Keeper) GetValaccountsFromStaker(ctx sdk.Context, stakerAddress string) (val []*types.Valaccount)
- func (k Keeper) IncreaseStakerCommissionRewards(ctx sdk.Context, address string, payerModuleName string, amount sdk.Coins) error
- func (k Keeper) IncrementPoints(ctx sdk.Context, poolId uint64, stakerAddress string) uint64
- func (k Keeper) LeavePool(ctx sdk.Context, staker string, poolId uint64)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Migration_SetStaker(ctx sdk.Context, staker types.Staker)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProcessCommissionChangeQueue(ctx sdk.Context)
- func (k Keeper) ProcessLeavePoolQueue(ctx sdk.Context)
- func (k Keeper) RemoveCommissionChangeEntry(ctx sdk.Context, commissionChangeEntry *types.CommissionChangeEntry)
- func (k Keeper) RemoveLeavePoolEntry(ctx sdk.Context, leavePoolEntry *types.LeavePoolEntry)
- func (k Keeper) RemoveValaccountFromPool(ctx sdk.Context, poolId uint64, stakerAddress string)
- func (k Keeper) ResetPoints(ctx sdk.Context, poolId uint64, stakerAddress string) (previousPoints uint64)
- func (k Keeper) SetCommissionChangeEntry(ctx sdk.Context, commissionChangeEntry types.CommissionChangeEntry)
- func (k Keeper) SetLeavePoolEntry(ctx sdk.Context, leavePoolEntry types.LeavePoolEntry)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER, state types.QueueState)
- func (k Keeper) SetValaccount(ctx sdk.Context, valaccount types.Valaccount)
- func (k Keeper) TotalBondedTokens(ctx context.Context) math.Int
- func (k Keeper) UpdateStakerCommission(ctx sdk.Context, address string, commission math.LegacyDec)
- func (k Keeper) UpdateStakerMetadata(ctx sdk.Context, address string, moniker string, website string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func SetDelegationKeeper ¶
func SetDelegationKeeper(k *Keeper, delegationKeeper delegationKeeper.Keeper)
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, memService store.MemoryStoreService, logger log.Logger, authority string, accountKeeper util.AccountKeeper, bankKeeper util.BankKeeper, distrkeeper util.DistributionKeeper, poolKeeper types.PoolKeeper, upgradeKeeper util.UpgradeKeeper, ) *Keeper
func (Keeper) AddActiveStaker ¶
AddActiveStaker increases the active-staker-count of the given staker by one. The amount tracks the number of pools the staker is in. It also allows to determine that a given staker is at least in one pool.
func (Keeper) AddValaccountToPool ¶
func (k Keeper) AddValaccountToPool(ctx sdk.Context, poolId uint64, stakerAddress string, valaddress string)
AddValaccountToPool adds a valaccount to a pool. If valaccount already belongs to pool, nothing happens.
func (Keeper) AssertValaccountAuthorized ¶
func (k Keeper) AssertValaccountAuthorized(ctx sdk.Context, poolId uint64, stakerAddress string, valaddress string) error
AssertValaccountAuthorized checks if the given `valaddress` is allowed to vote in pool with id `poolId` to vote in favor of `stakerAddress`. If the valaddress is not authorized the appropriate error is returned. Otherwise, it returns `nil`
func (Keeper) DoesLeavePoolEntryExistByIndex2 ¶
DoesLeavePoolEntryExistByIndex2 ...
func (Keeper) DoesStakerExist ¶
DoesStakerExist returns true if the staker exists
func (Keeper) DoesValaccountExist ¶
DoesValaccountExist only checks if the key is present in the KV-Store without loading and unmarshalling to full entry
func (Keeper) GetActiveStakers ¶
GetActiveStakers returns all staker-addresses that are currently participating in at least one pool.
func (Keeper) GetActiveValidators ¶
GetActiveValidators returns all protocol-node information which are needed by the governance to calculate the voting powers. The interface needs to correspond to github.com/cosmos/cosmos-sdk/x/gov/types/v1.ValidatorGovInfo But as there is no direct dependency in the cosmos-sdk-fork this value is passed as an interface{}
func (Keeper) GetAllCommissionChangeEntries ¶
func (k Keeper) GetAllCommissionChangeEntries(ctx sdk.Context) (list []types.CommissionChangeEntry)
GetAllCommissionChangeEntries returns all pending commission change entries of all stakers
func (Keeper) GetAllLeavePoolEntries ¶
func (k Keeper) GetAllLeavePoolEntries(ctx sdk.Context) (list []types.LeavePoolEntry)
GetAllLeavePoolEntries ...
func (Keeper) GetAllStakerAddressesOfPool ¶
GetAllStakerAddressesOfPool returns a list of all stakers which have currently a valaccount registered for the given pool and are therefore allowed to participate in that pool.
func (Keeper) GetAllStakers ¶
GetAllStakers returns all staker
func (Keeper) GetAllValaccounts ¶
func (k Keeper) GetAllValaccounts(ctx sdk.Context) (list []types.Valaccount)
GetAllValaccounts ...
func (Keeper) GetAllValaccountsOfPool ¶
GetAllValaccountsOfPool returns a list of all valaccount
func (Keeper) GetCommission ¶
GetCommission returns the commission of a staker as a parsed math.LegacyDec
func (Keeper) GetCommissionChangeEntry ¶
func (k Keeper) GetCommissionChangeEntry(ctx sdk.Context, index uint64) (val types.CommissionChangeEntry, found bool)
GetCommissionChangeEntry ...
func (Keeper) GetCommissionChangeEntryByIndex2 ¶
func (k Keeper) GetCommissionChangeEntryByIndex2(ctx sdk.Context, staker string) (val types.CommissionChangeEntry, found bool)
GetCommissionChangeEntryByIndex2 returns a pending commission change entry by staker address (if there is one)
func (Keeper) GetCommissionChangeTime ¶
GetCommissionChangeTime returns the CommissionChangeTime param
func (Keeper) GetDelegations ¶
func (k Keeper) GetDelegations(ctx context.Context, delegator string) (validators []string, amounts []math.LegacyDec)
GetDelegations returns the address and the delegation amount of all active protocol-stakers the delegator as delegated to. This is used to calculate the vote weight each delegator has.
func (Keeper) GetLeavePoolEntry ¶
func (k Keeper) GetLeavePoolEntry(ctx sdk.Context, index uint64) (val types.LeavePoolEntry, found bool)
GetLeavePoolEntry ...
func (Keeper) GetLeavePoolEntryByIndex2 ¶
func (k Keeper) GetLeavePoolEntryByIndex2(ctx sdk.Context, staker string, poolId uint64) (val types.LeavePoolEntry, found bool)
GetLeavePoolEntryByIndex2 ...
func (Keeper) GetLeavePoolTime ¶
GetLeavePoolTime returns the LeavePoolTime param
func (Keeper) GetPaginatedStakerQuery ¶
func (k Keeper) GetPaginatedStakerQuery( ctx sdk.Context, pagination *query.PageRequest, accumulator func(staker types.Staker), ) (*query.PageResponse, error)
func (Keeper) GetPoolCount ¶
GetPoolCount returns the number of pools the current staker is currently participating.
func (Keeper) GetQueueState ¶
func (k Keeper) GetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER) (state types.QueueState)
GetQueueState returns a queue state object based on the identifier as there are multiple queues present in the stakers module
func (Keeper) GetStakerCountOfPool ¶
func (Keeper) GetValaccount ¶
func (k Keeper) GetValaccount(ctx sdk.Context, poolId uint64, stakerAddress string) (val types.Valaccount, found bool)
GetValaccount returns a Valaccount from its index
func (Keeper) GetValaccountsFromStaker ¶
func (k Keeper) GetValaccountsFromStaker(ctx sdk.Context, stakerAddress string) (val []*types.Valaccount)
GetValaccountsFromStaker returns all pools the staker has valaccounts in
func (Keeper) IncreaseStakerCommissionRewards ¶ added in v1.3.0
func (k Keeper) IncreaseStakerCommissionRewards(ctx sdk.Context, address string, payerModuleName string, amount sdk.Coins) error
IncreaseStakerCommissionRewards sets the uploader's commission rewards and transfers the funds from the payer module to the stakers module, so the funds can be later claimed and transferred from here
func (Keeper) IncrementPoints ¶
IncrementPoints increments to Points for a staker in a given pool. Returns the amount of the current points (including the current incrementation)
func (Keeper) LeavePool ¶
LeavePool removes a staker from a pool and emits the corresponding event. The staker is no longer able to participate in the given pool. All points the staker had in that pool are deleted.
func (Keeper) Migration_SetStaker ¶ added in v1.5.0
TODO: remove after migration
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) ProcessCommissionChangeQueue ¶
ProcessCommissionChangeQueue checks the queue for entries which are due and can be executed. If this is the case, the new commission will be applied to the staker
func (Keeper) ProcessLeavePoolQueue ¶
ProcessLeavePoolQueue ...
func (Keeper) RemoveCommissionChangeEntry ¶
func (k Keeper) RemoveCommissionChangeEntry(ctx sdk.Context, commissionChangeEntry *types.CommissionChangeEntry)
RemoveCommissionChangeEntry ...
func (Keeper) RemoveLeavePoolEntry ¶
func (k Keeper) RemoveLeavePoolEntry(ctx sdk.Context, leavePoolEntry *types.LeavePoolEntry)
RemoveLeavePoolEntry ...
func (Keeper) RemoveValaccountFromPool ¶
RemoveValaccountFromPool removes a valaccount from a given pool and updates all aggregated variables. If the valaccount is not in the pool nothing happens.
func (Keeper) ResetPoints ¶
func (k Keeper) ResetPoints(ctx sdk.Context, poolId uint64, stakerAddress string) (previousPoints uint64)
ResetPoints sets the point count for the staker in the given pool back to zero. Returns the amount of points the staker had before the reset.
func (Keeper) SetCommissionChangeEntry ¶
func (k Keeper) SetCommissionChangeEntry(ctx sdk.Context, commissionChangeEntry types.CommissionChangeEntry)
SetCommissionChangeEntry ...
func (Keeper) SetLeavePoolEntry ¶
func (k Keeper) SetLeavePoolEntry(ctx sdk.Context, leavePoolEntry types.LeavePoolEntry)
SetLeavePoolEntry ...
func (Keeper) SetQueueState ¶
func (k Keeper) SetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER, state types.QueueState)
SetQueueState sets a endBlocker queue state based on the identifier. The identifier is used to distinguish between different queues.
func (Keeper) SetValaccount ¶
func (k Keeper) SetValaccount(ctx sdk.Context, valaccount types.Valaccount)
SetValaccount set a specific Valaccount in the store from its index
func (Keeper) TotalBondedTokens ¶
TotalBondedTokens returns all tokens which are currently bonded by the protocol I.e. the sum of all delegation of all stakers that are currently participating in at least one pool
func (Keeper) UpdateStakerCommission ¶
UpdateStakerCommission ...
Source Files ¶
- exported_functions.go
- getters_commission.go
- getters_leave.go
- getters_params.go
- getters_queue.go
- getters_staker.go
- getters_valaccount.go
- grpc_query.go
- keeper.go
- logic_commission.go
- logic_leave.go
- logic_queue.go
- logic_stakers.go
- msg_server.go
- msg_server_claim_commission_rewards.go
- msg_server_create_staker.go
- msg_server_join_pool.go
- msg_server_leave_pool.go
- msg_server_update_commission.go
- msg_server_update_metadata.go
- msg_server_update_params.go