Documentation ¶
Index ¶
- func AccountsBalancesInvariants(k *Keeper) sdk.Invariant
- func AllowedOperatorsExistInvariant(k *Keeper) sdk.Invariant
- func NewMsgServer(keeper *Keeper) types.MsgServer
- func OperatorDelegationToOperatorDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
- func OperatorsDelegatorsSharesInvariant(k *Keeper) sdk.Invariant
- func OperatorsJoinedServicesExistInvariant(k *Keeper) sdk.Invariant
- func PoolDelegationToPoolDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
- func PoolsDelegatorsSharesInvariant(k *Keeper) sdk.Invariant
- func PositiveOperatorsDelegationsInvariant(k *Keeper) sdk.Invariant
- func PositivePoolsDelegationsInvariant(k *Keeper) sdk.Invariant
- func PositiveServicesDelegationsInvariant(k *Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- func ServiceDelegationToServiceDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
- func ServicesDelegatorsSharesInvariant(k *Keeper) sdk.Invariant
- type Keeper
- func (k *Keeper) AddOperatorToServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) error
- func (k *Keeper) AddOperatorTokensAndShares(ctx sdk.Context, operator operatorstypes.Operator, tokensToAdd sdk.Coins) (operatorOut operatorstypes.Operator, addedShares sdk.DecCoins, err error)
- func (k *Keeper) AddPoolToServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) error
- func (k *Keeper) AddPoolTokensAndShares(ctx sdk.Context, pool poolstypes.Pool, tokensToAdd sdk.Coin) (poolOut poolstypes.Pool, addedShares sdk.DecCoin, err error)
- func (k *Keeper) AddServiceToOperatorJoinedServices(ctx sdk.Context, operatorID uint32, serviceID uint32) error
- func (k *Keeper) AddServiceTokensAndShares(ctx sdk.Context, service servicestypes.Service, tokensToAdd sdk.Coins) (serviceOut servicestypes.Service, addedShares sdk.DecCoins, err error)
- func (k *Keeper) AfterOperatorDelegationModified(ctx sdk.Context, operatorID uint32, delegator string) error
- func (k *Keeper) AfterPoolDelegationModified(ctx sdk.Context, poolID uint32, delegator string) error
- func (k *Keeper) AfterServiceDelegationModified(ctx sdk.Context, serviceID uint32, delegator string) error
- func (k *Keeper) AfterUnbondingInitiated(ctx sdk.Context, unbondingDelegationID uint64) error
- func (k *Keeper) BeforeOperatorDelegationCreated(ctx sdk.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforeOperatorDelegationRemoved(ctx sdk.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforeOperatorDelegationSharesModified(ctx sdk.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationCreated(ctx sdk.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationRemoved(ctx sdk.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationSharesModified(ctx sdk.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationCreated(ctx sdk.Context, serviceID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationRemoved(ctx sdk.Context, serviceID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationSharesModified(ctx sdk.Context, serviceID uint32, delegator string) error
- func (k *Keeper) CanOperatorValidateService(ctx sdk.Context, serviceID uint32, operatorID uint32) (bool, error)
- func (k *Keeper) CompleteMatureUnbondingDelegations(ctx sdk.Context) error
- func (k *Keeper) CompleteUnbonding(ctx sdk.Context, data types.DTData) (sdk.Coins, error)
- func (k *Keeper) DelegateToOperator(ctx sdk.Context, operatorID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DelegateToPool(ctx sdk.Context, amount sdk.Coin, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DelegateToService(ctx sdk.Context, serviceID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DeleteUnbondingIndex(ctx sdk.Context, id uint64)
- func (k *Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DTData)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetAllDelegations(ctx sdk.Context) []types.Delegation
- func (k *Keeper) GetAllOperatorDelegations(ctx sdk.Context) []types.Delegation
- func (k *Keeper) GetAllOperatorUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
- func (k *Keeper) GetAllOperatorsJoinedServices(ctx sdk.Context) ([]types.OperatorJoinedServices, error)
- func (k *Keeper) GetAllPoolDelegations(ctx sdk.Context) []types.Delegation
- func (k *Keeper) GetAllPoolUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
- func (k *Keeper) GetAllServiceAllowedOperators(ctx sdk.Context, serviceID uint32) ([]uint32, error)
- func (k *Keeper) GetAllServiceDelegations(ctx sdk.Context) []types.Delegation
- func (k *Keeper) GetAllServiceSecuringPools(ctx sdk.Context, serviceID uint32) ([]uint32, error)
- func (k *Keeper) GetAllServiceUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
- func (k *Keeper) GetAllServicesAllowedOperators(ctx sdk.Context) ([]types.ServiceAllowedOperators, error)
- func (k *Keeper) GetAllServicesSecuringPools(ctx sdk.Context) ([]types.ServiceSecuringPools, error)
- func (k *Keeper) GetAllUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserOperatorUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserPoolUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserRestakedCoins(ctx sdk.Context, userAddress string) (sdk.DecCoins, error)
- func (k *Keeper) GetAllUserServiceUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetDelegationForTarget(ctx sdk.Context, target types.DelegationTarget, delegator string) (types.Delegation, bool)
- func (k *Keeper) GetDelegationTargetFromDelegation(ctx sdk.Context, delegation types.Delegation) (types.DelegationTarget, bool)
- func (k *Keeper) GetOperatorDelegation(ctx sdk.Context, operatorID uint32, userAddress string) (types.Delegation, bool)
- func (k *Keeper) GetOperatorUnbondingDelegation(ctx sdk.Context, operatorID uint32, delegatorAddress string) (types.UnbondingDelegation, bool)
- func (k *Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k *Keeper) GetPoolDelegation(ctx sdk.Context, poolID uint32, userAddress string) (types.Delegation, bool)
- func (k *Keeper) GetPoolUnbondingDelegation(ctx sdk.Context, poolID uint32, delegator string) (types.UnbondingDelegation, bool)
- func (k *Keeper) GetServiceDelegation(ctx sdk.Context, serviceID uint32, userAddress string) (types.Delegation, bool)
- func (k *Keeper) GetServiceUnbondingDelegation(ctx sdk.Context, serviceID uint32, delegator string) (types.UnbondingDelegation, bool)
- func (k *Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DTData)
- func (k *Keeper) GetUnbondingDelegation(ctx sdk.Context, delegatorAddress string, ubdType types.DelegationType, ...) (types.UnbondingDelegation, bool)
- func (k *Keeper) HasOperatorJoinedService(ctx sdk.Context, operatorID uint32, serviceID uint32) (bool, error)
- func (k *Keeper) IncrementUnbondingID(ctx sdk.Context) (unbondingID uint64)
- func (k *Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k *Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
- func (k *Keeper) IsOperatorInServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) (bool, error)
- func (k *Keeper) IsPoolInServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) (bool, error)
- func (k *Keeper) IsServiceOpertorsAllowListConfigured(ctx sdk.Context, serviceID uint32) (bool, error)
- func (k *Keeper) IsServiceSecuredByPool(ctx sdk.Context, serviceID uint32, poolID uint32) (bool, error)
- func (k *Keeper) IsServiceSecuringPoolsConfigured(ctx sdk.Context, serviceID uint32) (bool, error)
- func (k *Keeper) IterateAllOperatorDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
- func (k *Keeper) IterateAllOperatorsJoinedServices(ctx sdk.Context, ...) error
- func (k *Keeper) IterateAllPoolDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
- func (k *Keeper) IterateAllServiceDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
- func (k *Keeper) IterateAllServicesAllowedOperators(ctx sdk.Context, ...) error
- func (k *Keeper) IterateUserDelegations(ctx sdk.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserOperatorDelegations(ctx sdk.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserPoolDelegations(ctx sdk.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserServiceDelegations(ctx sdk.Context, userAddress string, ...) error
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) OperatorsHooks() operatorstypes.OperatorsHooks
- func (k *Keeper) PerformDelegation(ctx sdk.Context, data types.DelegationData) (sdk.DecCoins, error)
- func (k *Keeper) PerformUndelegation(ctx sdk.Context, data types.UndelegationData) (time.Time, error)
- func (k *Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k *Keeper) RemoveOperatorDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k *Keeper) RemoveOperatorFromServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) error
- func (k *Keeper) RemovePoolDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k *Keeper) RemovePoolFromServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) error
- func (k *Keeper) RemoveServiceDelegation(ctx sdk.Context, delegation types.Delegation)
- func (k *Keeper) RemoveServiceFromOperatorJoinedServices(ctx sdk.Context, operatorID uint32, serviceID uint32) error
- func (k *Keeper) RemoveTargetTokensAndShares(ctx sdk.Context, data types.UndelegationData) (sdk.Coins, error)
- func (k *Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation) error
- func (k *Keeper) ServiceAllowedOperatorsIterator(ctx sdk.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
- func (k *Keeper) ServiceSecuringPoolsIterator(ctx sdk.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
- func (k *Keeper) ServicesHooks() servicestypes.ServicesHooks
- func (k *Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation) error
- func (k *Keeper) SetHooks(rs types.RestakingHooks) *Keeper
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DTData)
- func (k *Keeper) SetUnbondingDelegation(ctx sdk.Context, ud types.UnbondingDelegation) ([]byte, error)
- func (k *Keeper) SetUnbondingDelegationByUnbondingID(ctx sdk.Context, ubd types.UnbondingDelegation, ubdKey []byte, id uint64)
- func (k *Keeper) SetUnbondingDelegationEntry(ctx sdk.Context, data types.UndelegationData, creationHeight int64, ...) (types.UnbondingDelegation, error)
- func (k *Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) storetypes.Iterator
- func (k *Keeper) Unbond(ctx sdk.Context, data types.UndelegationData) (amount sdk.Coins, err error)
- func (k *Keeper) UnbondRestakedAssets(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) (time.Time, error)
- func (k *Keeper) UnbondingTime(ctx sdk.Context) time.Duration
- func (k *Keeper) UndelegateFromOperator(ctx sdk.Context, operatorID uint32, amount sdk.Coins, delegator string) (time.Time, error)
- func (k *Keeper) UndelegateFromPool(ctx sdk.Context, amount sdk.Coin, delegator string) (time.Time, error)
- func (k *Keeper) UndelegateFromService(ctx sdk.Context, serviceID uint32, amount sdk.Coins, delegator string) (time.Time, error)
- func (k *Keeper) ValidateUnbondAmount(ctx sdk.Context, delAddr string, target types.DelegationTarget, amt sdk.Coins) (shares sdk.DecCoins, err error)
- type Migrator
- type OperatorsHooks
- func (o *OperatorsHooks) AfterOperatorDeleted(ctx sdk.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorInactivatingCompleted(ctx sdk.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorInactivatingStarted(ctx sdk.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorRegistered(ctx sdk.Context, operatorID uint32) error
- type Querier
- func (k Querier) DelegatorOperator(goCtx context.Context, req *types.QueryDelegatorOperatorRequest) (*types.QueryDelegatorOperatorResponse, error)
- func (k Querier) DelegatorOperatorDelegations(goCtx context.Context, req *types.QueryDelegatorOperatorDelegationsRequest) (*types.QueryDelegatorOperatorDelegationsResponse, error)
- func (k Querier) DelegatorOperatorUnbondingDelegations(goCtx context.Context, ...) (*types.QueryDelegatorOperatorUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorOperators(goCtx context.Context, req *types.QueryDelegatorOperatorsRequest) (*types.QueryDelegatorOperatorsResponse, error)
- func (k Querier) DelegatorPool(goCtx context.Context, req *types.QueryDelegatorPoolRequest) (*types.QueryDelegatorPoolResponse, error)
- func (k Querier) DelegatorPoolDelegations(goCtx context.Context, req *types.QueryDelegatorPoolDelegationsRequest) (*types.QueryDelegatorPoolDelegationsResponse, error)
- func (k Querier) DelegatorPoolUnbondingDelegations(goCtx context.Context, ...) (*types.QueryDelegatorPoolUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorPools(goCtx context.Context, req *types.QueryDelegatorPoolsRequest) (*types.QueryDelegatorPoolsResponse, error)
- func (k Querier) DelegatorService(goCtx context.Context, req *types.QueryDelegatorServiceRequest) (*types.QueryDelegatorServiceResponse, error)
- func (k Querier) DelegatorServiceDelegations(goCtx context.Context, req *types.QueryDelegatorServiceDelegationsRequest) (*types.QueryDelegatorServiceDelegationsResponse, error)
- func (k Querier) DelegatorServiceUnbondingDelegations(goCtx context.Context, ...) (*types.QueryDelegatorServiceUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorServices(goCtx context.Context, req *types.QueryDelegatorServicesRequest) (*types.QueryDelegatorServicesResponse, error)
- func (k Querier) OperatorDelegation(goCtx context.Context, req *types.QueryOperatorDelegationRequest) (*types.QueryOperatorDelegationResponse, error)
- func (k Querier) OperatorDelegations(goCtx context.Context, req *types.QueryOperatorDelegationsRequest) (*types.QueryOperatorDelegationsResponse, error)
- func (k Querier) OperatorJoinedServices(goCtx context.Context, req *types.QueryOperatorJoinedServicesRequest) (*types.QueryOperatorJoinedServicesResponse, error)
- func (k Querier) OperatorUnbondingDelegation(goCtx context.Context, req *types.QueryOperatorUnbondingDelegationRequest) (*types.QueryOperatorUnbondingDelegationResponse, error)
- func (k Querier) OperatorUnbondingDelegations(goCtx context.Context, req *types.QueryOperatorUnbondingDelegationsRequest) (*types.QueryOperatorUnbondingDelegationsResponse, error)
- func (k Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PoolDelegation(goCtx context.Context, req *types.QueryPoolDelegationRequest) (*types.QueryPoolDelegationResponse, error)
- func (k Querier) PoolDelegations(goCtx context.Context, req *types.QueryPoolDelegationsRequest) (*types.QueryPoolDelegationsResponse, error)
- func (k Querier) PoolUnbondingDelegation(goCtx context.Context, req *types.QueryPoolUnbondingDelegationRequest) (*types.QueryPoolUnbondingDelegationResponse, error)
- func (k Querier) PoolUnbondingDelegations(goCtx context.Context, req *types.QueryPoolUnbondingDelegationsRequest) (*types.QueryPoolUnbondingDelegationsResponse, error)
- func (k Querier) ServiceAllowedOperators(goCtx context.Context, req *types.QueryServiceAllowedOperatorsRequest) (*types.QueryServiceAllowedOperatorsResponse, error)
- func (k Querier) ServiceDelegation(goCtx context.Context, req *types.QueryServiceDelegationRequest) (*types.QueryServiceDelegationResponse, error)
- func (k Querier) ServiceDelegations(goCtx context.Context, req *types.QueryServiceDelegationsRequest) (*types.QueryServiceDelegationsResponse, error)
- func (k Querier) ServiceOperators(goCtx context.Context, req *types.QueryServiceOperatorsRequest) (*types.QueryServiceOperatorsResponse, error)
- func (k Querier) ServiceSecuringPools(goCtx context.Context, req *types.QueryServiceSecuringPoolsRequest) (*types.QueryServiceSecuringPoolsResponse, error)
- func (k Querier) ServiceUnbondingDelegation(goCtx context.Context, req *types.QueryServiceUnbondingDelegationRequest) (*types.QueryServiceUnbondingDelegationResponse, error)
- func (k Querier) ServiceUnbondingDelegations(goCtx context.Context, req *types.QueryServiceUnbondingDelegationsRequest) (*types.QueryServiceUnbondingDelegationsResponse, error)
- type ServicesHooks
- func (h *ServicesHooks) AfterServiceActivated(ctx sdk.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceCreated(ctx sdk.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceDeactivated(ctx sdk.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceDeleted(ctx sdk.Context, serviceID uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountsBalancesInvariants ¶
AccountsBalancesInvariants checks that the pools, operators and services accounts have the correct balance based on the delegations that are stored in the store
func AllowedOperatorsExistInvariant ¶ added in v1.3.0
AllowedOperatorsExistInvariant checks that all the operators that are allowed to join a service exist
func NewMsgServer ¶
func OperatorDelegationToOperatorDelegationResponse ¶
func OperatorDelegationToOperatorDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
OperatorDelegationToOperatorDelegationResponse converts a OperatorDelegation to a OperatorDelegationResponse
func OperatorsDelegatorsSharesInvariant ¶
OperatorsDelegatorsSharesInvariant checks that the sum of all delegators shares for each operator is equal to the total delegators shares stored in the operator object
func OperatorsJoinedServicesExistInvariant ¶ added in v1.3.0
OperatorsJoinedServicesExistInvariant checks that all the services that are joined by operators exist
func PoolDelegationToPoolDelegationResponse ¶
func PoolDelegationToPoolDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
PoolDelegationToPoolDelegationResponse converts a PoolDelegation to a PoolDelegationResponse
func PoolsDelegatorsSharesInvariant ¶
PoolsDelegatorsSharesInvariant checks that the sum of all delegators shares for each pool is equal to the total delegators shares stored in the pool object
func PositiveOperatorsDelegationsInvariant ¶
PositiveOperatorsDelegationsInvariant checks that all stored operator delegations have > 0 shares.
func PositivePoolsDelegationsInvariant ¶
PositivePoolsDelegationsInvariant checks that all stored pools delegations have > 0 shares
func PositiveServicesDelegationsInvariant ¶
PositiveServicesDelegationsInvariant checks that all stored service delegations have > 0 shares.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
func ServiceDelegationToServiceDelegationResponse ¶
func ServiceDelegationToServiceDelegationResponse(ctx sdk.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
ServiceDelegationToServiceDelegationResponse converts a ServiceDelegation to a ServiceDelegationResponse
func ServicesDelegatorsSharesInvariant ¶
ServicesDelegatorsSharesInvariant checks that the sum of all delegators shares for each service is equal to the total delegators shares stored in the service object
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, storeService corestoretypes.KVStoreService, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, poolsKeeper types.PoolsKeeper, operatorsKeeper types.OperatorsKeeper, servicesKeeper types.ServicesKeeper, authority string, ) *Keeper
func (*Keeper) AddOperatorToServiceAllowList ¶ added in v1.3.0
func (k *Keeper) AddOperatorToServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) error
AddOperatorToServiceAllowList adds an operator to the list of operators allowed to secure a service. If the operator is already in the list, no action is taken.
func (*Keeper) AddOperatorTokensAndShares ¶
func (k *Keeper) AddOperatorTokensAndShares( ctx sdk.Context, operator operatorstypes.Operator, tokensToAdd sdk.Coins, ) (operatorOut operatorstypes.Operator, addedShares sdk.DecCoins, err error)
AddOperatorTokensAndShares adds the given amount of tokens to the operator and returns the added shares
func (*Keeper) AddPoolToServiceSecuringPools ¶ added in v1.3.0
func (k *Keeper) AddPoolToServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) error
AddPoolToServiceSecuringPools adds a pool to the list of pools permitted for securing the service
func (*Keeper) AddPoolTokensAndShares ¶
func (k *Keeper) AddPoolTokensAndShares( ctx sdk.Context, pool poolstypes.Pool, tokensToAdd sdk.Coin, ) (poolOut poolstypes.Pool, addedShares sdk.DecCoin, err error)
AddPoolTokensAndShares adds the given amount of tokens to the pool and returns the added shares
func (*Keeper) AddServiceToOperatorJoinedServices ¶ added in v1.3.0
func (k *Keeper) AddServiceToOperatorJoinedServices(ctx sdk.Context, operatorID uint32, serviceID uint32) error
AddServiceToOperatorJoinedServices adds the given service to the list of services joined by the operator with the given ID
func (*Keeper) AddServiceTokensAndShares ¶
func (k *Keeper) AddServiceTokensAndShares( ctx sdk.Context, service servicestypes.Service, tokensToAdd sdk.Coins, ) (serviceOut servicestypes.Service, addedShares sdk.DecCoins, err error)
AddServiceTokensAndShares adds the given amount of tokens to the service and returns the added shares
func (*Keeper) AfterOperatorDelegationModified ¶
func (k *Keeper) AfterOperatorDelegationModified(ctx sdk.Context, operatorID uint32, delegator string) error
AfterOperatorDelegationModified implements types.RestakingHooks
func (*Keeper) AfterPoolDelegationModified ¶
func (k *Keeper) AfterPoolDelegationModified(ctx sdk.Context, poolID uint32, delegator string) error
AfterPoolDelegationModified implements types.RestakingHooks
func (*Keeper) AfterServiceDelegationModified ¶
func (k *Keeper) AfterServiceDelegationModified(ctx sdk.Context, serviceID uint32, delegator string) error
AfterServiceDelegationModified implements types.RestakingHooks
func (*Keeper) AfterUnbondingInitiated ¶
AfterUnbondingInitiated implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationCreated ¶
func (k *Keeper) BeforeOperatorDelegationCreated(ctx sdk.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationRemoved ¶
func (k *Keeper) BeforeOperatorDelegationRemoved(ctx sdk.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationSharesModified ¶
func (k *Keeper) BeforeOperatorDelegationSharesModified(ctx sdk.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationSharesModified implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationCreated ¶
func (k *Keeper) BeforePoolDelegationCreated(ctx sdk.Context, poolID uint32, delegator string) error
BeforePoolDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationRemoved ¶
func (k *Keeper) BeforePoolDelegationRemoved(ctx sdk.Context, poolID uint32, delegator string) error
BeforePoolDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationSharesModified ¶
func (k *Keeper) BeforePoolDelegationSharesModified(ctx sdk.Context, poolID uint32, delegator string) error
BeforePoolDelegationSharesModified implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationCreated ¶
func (k *Keeper) BeforeServiceDelegationCreated(ctx sdk.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationRemoved ¶
func (k *Keeper) BeforeServiceDelegationRemoved(ctx sdk.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationSharesModified ¶
func (k *Keeper) BeforeServiceDelegationSharesModified(ctx sdk.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationSharesModified implements types.RestakingHooks
func (*Keeper) CanOperatorValidateService ¶ added in v1.3.0
func (k *Keeper) CanOperatorValidateService(ctx sdk.Context, serviceID uint32, operatorID uint32) (bool, error)
CanOperatorValidateService returns true if the given operator can secure the given service
func (*Keeper) CompleteMatureUnbondingDelegations ¶
CompleteMatureUnbondingDelegations runs the endblocker logic for delegations
func (*Keeper) CompleteUnbonding ¶
CompleteUnbonding completes the unbonding of all mature entries in the retrieved unbonding delegation object and returns the total unbonding balance or an error upon failure.
func (*Keeper) DelegateToOperator ¶
func (k *Keeper) DelegateToOperator(ctx sdk.Context, operatorID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
DelegateToOperator sends the given amount to the operator account and saves the delegation for the given user
func (*Keeper) DelegateToPool ¶
func (k *Keeper) DelegateToPool(ctx sdk.Context, amount sdk.Coin, delegator string) (sdk.DecCoins, error)
DelegateToPool sends the given amount to the pool account and saves the delegation for the given user
func (*Keeper) DelegateToService ¶
func (k *Keeper) DelegateToService(ctx sdk.Context, serviceID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
DelegateToService sends the given amount to the service account and saves the delegation for the given user
func (*Keeper) DeleteUnbondingIndex ¶
DeleteUnbondingIndex removes a mapping from UnbondingId to unbonding operation
func (*Keeper) DequeueAllMatureUBDQueue ¶
func (k *Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DTData)
DequeueAllMatureUBDQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a new GenesisState instance containing the information currently present inside the store
func (*Keeper) GetAllDelegations ¶
func (k *Keeper) GetAllDelegations(ctx sdk.Context) []types.Delegation
GetAllDelegations returns all the delegations
func (*Keeper) GetAllOperatorDelegations ¶
func (k *Keeper) GetAllOperatorDelegations(ctx sdk.Context) []types.Delegation
GetAllOperatorDelegations returns all the operator delegations
func (*Keeper) GetAllOperatorUnbondingDelegations ¶
func (k *Keeper) GetAllOperatorUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
GetAllOperatorUnbondingDelegations returns all the operator unbonding delegations
func (*Keeper) GetAllOperatorsJoinedServices ¶ added in v1.3.0
func (k *Keeper) GetAllOperatorsJoinedServices(ctx sdk.Context) ([]types.OperatorJoinedServices, error)
GetAllOperatorsJoinedServices returns all services that each operator has joined
func (*Keeper) GetAllPoolDelegations ¶
func (k *Keeper) GetAllPoolDelegations(ctx sdk.Context) []types.Delegation
GetAllPoolDelegations returns all the pool delegations
func (*Keeper) GetAllPoolUnbondingDelegations ¶
func (k *Keeper) GetAllPoolUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
GetAllPoolUnbondingDelegations returns all the pool unbonding delegations
func (*Keeper) GetAllServiceAllowedOperators ¶ added in v1.3.0
GetAllServiceAllowedOperators returns all operators that have been whitelisted by a service
func (*Keeper) GetAllServiceDelegations ¶
func (k *Keeper) GetAllServiceDelegations(ctx sdk.Context) []types.Delegation
GetAllServiceDelegations returns all the service delegations
func (*Keeper) GetAllServiceSecuringPools ¶ added in v1.3.0
GetAllServiceSecuringPools returns all pools that have been allowed to to secure the give service
func (*Keeper) GetAllServiceUnbondingDelegations ¶
func (k *Keeper) GetAllServiceUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
GetAllServiceUnbondingDelegations returns all the service unbonding delegations
func (*Keeper) GetAllServicesAllowedOperators ¶ added in v1.3.0
func (k *Keeper) GetAllServicesAllowedOperators(ctx sdk.Context) ([]types.ServiceAllowedOperators, error)
GetAllServicesAllowedOperators returns all the operators that are allowed to secure a service for all the services
func (*Keeper) GetAllServicesSecuringPools ¶ added in v1.3.0
GetAllServicesSecuringPools returns all the pools from which the services are allowed to borrow security
func (*Keeper) GetAllUnbondingDelegations ¶
func (k *Keeper) GetAllUnbondingDelegations(ctx sdk.Context) []types.UnbondingDelegation
GetAllUnbondingDelegations returns all the unbonding delegations
func (*Keeper) GetAllUserOperatorUnbondingDelegations ¶
func (k *Keeper) GetAllUserOperatorUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
GetAllUserOperatorUnbondingDelegations returns all the user's unbonding delegations from a operator
func (*Keeper) GetAllUserPoolUnbondingDelegations ¶
func (k *Keeper) GetAllUserPoolUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
GetAllUserPoolUnbondingDelegations returns all the user's unbonding delegations from a pool
func (*Keeper) GetAllUserRestakedCoins ¶
GetAllUserRestakedCoins returns all the user's restaked coins
func (*Keeper) GetAllUserServiceUnbondingDelegations ¶
func (k *Keeper) GetAllUserServiceUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
GetAllUserServiceUnbondingDelegations returns all the user's unbonding delegations from a service
func (*Keeper) GetAllUserUnbondingDelegations ¶
func (k *Keeper) GetAllUserUnbondingDelegations(ctx sdk.Context, userAddress string) []types.UnbondingDelegation
GetAllUserUnbondingDelegations returns all the user's unbonding delegations
func (*Keeper) GetDelegationForTarget ¶
func (k *Keeper) GetDelegationForTarget( ctx sdk.Context, target types.DelegationTarget, delegator string, ) (types.Delegation, bool)
GetDelegationForTarget returns the delegation for the given delegator and target.
func (*Keeper) GetDelegationTargetFromDelegation ¶
func (k *Keeper) GetDelegationTargetFromDelegation( ctx sdk.Context, delegation types.Delegation, ) (types.DelegationTarget, bool)
GetDelegationTargetFromDelegation returns the target of the given delegation.
func (*Keeper) GetOperatorDelegation ¶
func (k *Keeper) GetOperatorDelegation(ctx sdk.Context, operatorID uint32, userAddress string) (types.Delegation, bool)
GetOperatorDelegation retrieves the delegation for the given user and operator If the delegation does not exist, false is returned instead
func (*Keeper) GetOperatorUnbondingDelegation ¶
func (k *Keeper) GetOperatorUnbondingDelegation(ctx sdk.Context, operatorID uint32, delegatorAddress string) (types.UnbondingDelegation, bool)
GetOperatorUnbondingDelegation returns the unbonding delegation for the given delegator address and operator id. If no unbonding delegation is found, false is returned instead.
func (*Keeper) GetPoolDelegation ¶
func (k *Keeper) GetPoolDelegation(ctx sdk.Context, poolID uint32, userAddress string) (types.Delegation, bool)
GetPoolDelegation retrieves the delegation for the given user and pool If the delegation does not exist, false is returned instead
func (*Keeper) GetPoolUnbondingDelegation ¶
func (k *Keeper) GetPoolUnbondingDelegation(ctx sdk.Context, poolID uint32, delegator string) (types.UnbondingDelegation, bool)
GetPoolUnbondingDelegation returns the unbonding delegation for the given delegator address and pool id. If no unbonding delegation is found, false is returned instead.
func (*Keeper) GetServiceDelegation ¶
func (k *Keeper) GetServiceDelegation(ctx sdk.Context, serviceID uint32, userAddress string) (types.Delegation, bool)
GetServiceDelegation retrieves the delegation for the given user and service If the delegation does not exist, false is returned instead
func (*Keeper) GetServiceUnbondingDelegation ¶
func (k *Keeper) GetServiceUnbondingDelegation(ctx sdk.Context, serviceID uint32, delegator string) (types.UnbondingDelegation, bool)
GetServiceUnbondingDelegation returns the unbonding delegation for the given delegator address and service id. If no unbonding delegation is found, false is returned instead.
func (*Keeper) GetUBDQueueTimeSlice ¶
func (k *Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DTData)
GetUBDQueueTimeSlice gets a specific unbonding queue timeslice. A timeslice is a slice of DVPairs corresponding to unbonding delegations that expire at a certain time.
func (*Keeper) GetUnbondingDelegation ¶
func (k *Keeper) GetUnbondingDelegation( ctx sdk.Context, delegatorAddress string, ubdType types.DelegationType, targetID uint32, ) (types.UnbondingDelegation, bool)
GetUnbondingDelegation returns the unbonding delegation for the given delegator and target.
func (*Keeper) HasOperatorJoinedService ¶ added in v1.3.0
func (k *Keeper) HasOperatorJoinedService(ctx sdk.Context, operatorID uint32, serviceID uint32) (bool, error)
HasOperatorJoinedService returns whether the operator with the given ID has joined the provided service
func (*Keeper) IncrementUnbondingID ¶
IncrementUnbondingID increments and returns a unique ID for an unbonding operation
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
InitGenesis initializes the genesis store using the provided data
func (*Keeper) InsertUBDQueue ¶
func (k *Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)
InsertUBDQueue inserts an unbonding delegation to the appropriate timeslice in the unbonding queue.
func (*Keeper) IsOperatorInServiceAllowList ¶ added in v1.3.0
func (k *Keeper) IsOperatorInServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) (bool, error)
IsOperatorInServiceAllowList returns true if the given operator is in the service operators allow list
func (*Keeper) IsPoolInServiceSecuringPools ¶ added in v1.3.0
func (k *Keeper) IsPoolInServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) (bool, error)
IsPoolInServiceSecuringPools returns true if the pool is in the list of pools from which the service can borrow security
func (*Keeper) IsServiceOpertorsAllowListConfigured ¶ added in v1.3.0
func (k *Keeper) IsServiceOpertorsAllowListConfigured(ctx sdk.Context, serviceID uint32) (bool, error)
IsServiceOpertorsAllowListConfigured returns true if the operators allow list
func (*Keeper) IsServiceSecuredByPool ¶ added in v1.3.0
func (k *Keeper) IsServiceSecuredByPool(ctx sdk.Context, serviceID uint32, poolID uint32) (bool, error)
IsServiceSecuredByPool returns true if the service is being secured by the given pool
func (*Keeper) IsServiceSecuringPoolsConfigured ¶ added in v1.3.0
IsServiceSecuringPoolsConfigured returns true if the list of securing pools has been configured for the given service
func (*Keeper) IterateAllOperatorDelegations ¶
func (k *Keeper) IterateAllOperatorDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
IterateAllOperatorDelegations iterates all the operator delegations and performs the given callback function
func (*Keeper) IterateAllOperatorsJoinedServices ¶ added in v1.3.0
func (k *Keeper) IterateAllOperatorsJoinedServices(ctx sdk.Context, action func(operatorID uint32, serviceID uint32) (stop bool, err error)) error
IterateAllOperatorsJoinedServices iterates over all the operators and their joined services, performing the given action. If the action returns true, the iteration will stop.
func (*Keeper) IterateAllPoolDelegations ¶
func (k *Keeper) IterateAllPoolDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
IterateAllPoolDelegations iterates all the pool delegations and performs the given callback function
func (*Keeper) IterateAllServiceDelegations ¶
func (k *Keeper) IterateAllServiceDelegations(ctx sdk.Context, cb func(del types.Delegation) (stop bool))
IterateAllServiceDelegations iterates all the service delegations and performs the given callback function
func (*Keeper) IterateAllServicesAllowedOperators ¶ added in v1.3.0
func (k *Keeper) IterateAllServicesAllowedOperators(ctx sdk.Context, action func(serviceID uint32, operatorID uint32) (stop bool, err error)) error
IterateAllServicesAllowedOperators iterates over all the services and their allowed operators, performing the given action. If the action returns true, the iteration will stop.
func (*Keeper) IterateUserDelegations ¶
func (k *Keeper) IterateUserDelegations( ctx sdk.Context, userAddress string, cb func(del types.Delegation) (stop bool, err error), ) error
IterateUserDelegations iterates over the user's delegations. The delegations will be iterated in the following order: 1. Pool delegations 2. Service delegations 3. Operator delegations
func (*Keeper) IterateUserOperatorDelegations ¶
func (k *Keeper) IterateUserOperatorDelegations(ctx sdk.Context, userAddress string, cb func(del types.Delegation) (stop bool, err error)) error
IterateUserOperatorDelegations iterates all the operator delegations of a user and performs the given callback function
func (*Keeper) IterateUserPoolDelegations ¶
func (k *Keeper) IterateUserPoolDelegations(ctx sdk.Context, userAddress string, cb func(del types.Delegation) (stop bool, err error)) error
IterateUserPoolDelegations iterates all the pool delegations of a user and performs the given callback function
func (*Keeper) IterateUserServiceDelegations ¶
func (k *Keeper) IterateUserServiceDelegations(ctx sdk.Context, userAddress string, cb func(del types.Delegation) (stop bool, err error)) error
IterateUserServiceDelegations iterates all the service delegations of a user and performs the given callback function
func (*Keeper) OperatorsHooks ¶ added in v1.3.0
func (k *Keeper) OperatorsHooks() operatorstypes.OperatorsHooks
func (*Keeper) PerformDelegation ¶
func (k *Keeper) PerformDelegation(ctx sdk.Context, data types.DelegationData) (sdk.DecCoins, error)
PerformDelegation performs a delegation of the given amount from the delegator to the receiver. It sends the coins to the receiver address and updates the delegation object and returns the new shares of the delegation. NOTE: This is done so that if we implement other delegation types in the future we can have a single function that performs common operations for all of them.
func (*Keeper) PerformUndelegation ¶
func (k *Keeper) PerformUndelegation(ctx sdk.Context, data types.UndelegationData) (time.Time, error)
PerformUndelegation unbonds an amount of delegator shares from a given validator. It will verify that the unbonding entries between the delegator and validator are not exceeded and unbond the staked tokens (based on shares) by creating an unbonding object and inserting it into the unbonding queue which will be processed during the staking EndBlocker.
func (*Keeper) RemoveDelegation ¶
func (k *Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation)
RemoveDelegation removes the given delegation from the store
func (*Keeper) RemoveOperatorDelegation ¶
func (k *Keeper) RemoveOperatorDelegation(ctx sdk.Context, delegation types.Delegation)
RemoveOperatorDelegation removes the given operator delegation from the store
func (*Keeper) RemoveOperatorFromServiceAllowList ¶ added in v1.3.0
func (k *Keeper) RemoveOperatorFromServiceAllowList(ctx sdk.Context, serviceID uint32, operatorID uint32) error
RemoveOperatorFromServiceAllowList removes an operator from the list of operators allowed to secure a service. If the operator is not in the list, no action is taken.
func (*Keeper) RemovePoolDelegation ¶
func (k *Keeper) RemovePoolDelegation(ctx sdk.Context, delegation types.Delegation)
RemovePoolDelegation removes the given pool delegation from the store
func (*Keeper) RemovePoolFromServiceSecuringPools ¶ added in v1.3.0
func (k *Keeper) RemovePoolFromServiceSecuringPools(ctx sdk.Context, serviceID uint32, poolID uint32) error
RemovePoolFromServiceSecuringPools removes a pool from the list of pools from which the service is borrowing the security from
func (*Keeper) RemoveServiceDelegation ¶
func (k *Keeper) RemoveServiceDelegation(ctx sdk.Context, delegation types.Delegation)
RemoveServiceDelegation removes the given service delegation from the store
func (*Keeper) RemoveServiceFromOperatorJoinedServices ¶ added in v1.3.0
func (k *Keeper) RemoveServiceFromOperatorJoinedServices(ctx sdk.Context, operatorID uint32, serviceID uint32) error
RemoveServiceFromOperatorJoinedServices removes the given service from the list of services joined by the operator with the given ID
func (*Keeper) RemoveTargetTokensAndShares ¶
func (k *Keeper) RemoveTargetTokensAndShares(ctx sdk.Context, data types.UndelegationData) (sdk.Coins, error)
RemoveTargetTokensAndShares removes the given amount of tokens and shares from the target.
func (*Keeper) RemoveUnbondingDelegation ¶
RemoveUnbondingDelegation removes the unbonding delegation object and associated index.
func (*Keeper) ServiceAllowedOperatorsIterator ¶ added in v1.3.0
func (k *Keeper) ServiceAllowedOperatorsIterator(ctx sdk.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
ServiceAllowedOperatorsIterator returns an iterator that iterates over all operators allowed to secure a service
func (*Keeper) ServiceSecuringPoolsIterator ¶ added in v1.3.0
func (k *Keeper) ServiceSecuringPoolsIterator(ctx sdk.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
ServiceSecuringPoolsIterator returns an iterator that iterates over all pools allowed to secure the given service.
func (*Keeper) ServicesHooks ¶ added in v1.3.0
func (k *Keeper) ServicesHooks() servicestypes.ServicesHooks
func (*Keeper) SetDelegation ¶
SetDelegation stores the given delegation in the store
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(rs types.RestakingHooks) *Keeper
SetHooks allows to set the reactions hooks
func (*Keeper) SetUBDQueueTimeSlice ¶
SetUBDQueueTimeSlice sets a specific unbonding queue timeslice.
func (*Keeper) SetUnbondingDelegation ¶
func (k *Keeper) SetUnbondingDelegation(ctx sdk.Context, ud types.UnbondingDelegation) ([]byte, error)
SetUnbondingDelegation stores the given unbonding delegation in the store
func (*Keeper) SetUnbondingDelegationByUnbondingID ¶
func (k *Keeper) SetUnbondingDelegationByUnbondingID(ctx sdk.Context, ubd types.UnbondingDelegation, ubdKey []byte, id uint64)
SetUnbondingDelegationByUnbondingID sets an index to look up an UnbondingDelegation by the unbondingID of an UnbondingDelegationEntry that it contains Note, it does not set the unbonding delegation itself, use SetUnbondingDelegation(ctx, ubd) for that
func (*Keeper) SetUnbondingDelegationEntry ¶
func (k *Keeper) SetUnbondingDelegationEntry( ctx sdk.Context, data types.UndelegationData, creationHeight int64, minTime time.Time, balance sdk.Coins, ) (types.UnbondingDelegation, error)
SetUnbondingDelegationEntry adds an entry to the unbonding delegation at the given addresses. It creates the unbonding delegation if it does not exist.
func (*Keeper) UBDQueueIterator ¶
UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.
func (*Keeper) Unbond ¶
Unbond unbonds a particular delegation and perform associated store operations.
func (*Keeper) UnbondRestakedAssets ¶
func (k *Keeper) UnbondRestakedAssets(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) (time.Time, error)
UnbondRestakedAssets unbonds the provided amount from the user's delegations. The algorithm will go over the user's delegation in the following order: pools, services and operators until the token undelegated matches the provided amount.
func (*Keeper) UnbondingTime ¶
UnbondingTime returns the unbonding time
func (*Keeper) UndelegateFromOperator ¶
func (k *Keeper) UndelegateFromOperator(ctx sdk.Context, operatorID uint32, amount sdk.Coins, delegator string) (time.Time, error)
UndelegateFromOperator removes the given amount from the operator account and saves the unbonding delegation for the given user
func (*Keeper) UndelegateFromPool ¶
func (k *Keeper) UndelegateFromPool(ctx sdk.Context, amount sdk.Coin, delegator string) (time.Time, error)
UndelegateFromPool removes the given amount from the pool account and saves the unbonding delegation for the given user
func (*Keeper) UndelegateFromService ¶
func (k *Keeper) UndelegateFromService(ctx sdk.Context, serviceID uint32, amount sdk.Coins, delegator string) (time.Time, error)
UndelegateFromService removes the given amount from the service account and saves the unbonding delegation for the given user
func (*Keeper) ValidateUnbondAmount ¶
func (k *Keeper) ValidateUnbondAmount( ctx sdk.Context, delAddr string, target types.DelegationTarget, amt sdk.Coins, ) (shares sdk.DecCoins, err error)
ValidateUnbondAmount validates that a given unbond or redelegation amount is valid based on upon the converted shares. If the amount is valid, the total amount of respective shares is returned, otherwise an error is returned.
type Migrator ¶ added in v1.3.0
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶ added in v1.3.0
type OperatorsHooks ¶ added in v1.3.0
type OperatorsHooks struct {
*Keeper
}
func (*OperatorsHooks) AfterOperatorDeleted ¶ added in v1.3.0
func (o *OperatorsHooks) AfterOperatorDeleted(ctx sdk.Context, operatorID uint32) error
AfterOperatorDeleted implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorInactivatingCompleted ¶ added in v1.3.0
func (o *OperatorsHooks) AfterOperatorInactivatingCompleted(ctx sdk.Context, operatorID uint32) error
AfterOperatorInactivatingCompleted implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorInactivatingStarted ¶ added in v1.3.0
func (o *OperatorsHooks) AfterOperatorInactivatingStarted(ctx sdk.Context, operatorID uint32) error
AfterOperatorInactivatingStarted implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorRegistered ¶ added in v1.3.0
func (o *OperatorsHooks) AfterOperatorRegistered(ctx sdk.Context, operatorID uint32) error
AfterOperatorRegistered implements types.OperatorsHooks.
type Querier ¶
type Querier struct {
*Keeper
}
func NewQuerier ¶
func (Querier) DelegatorOperator ¶
func (k Querier) DelegatorOperator(goCtx context.Context, req *types.QueryDelegatorOperatorRequest) (*types.QueryDelegatorOperatorResponse, error)
DelegatorOperator queries the operator for the given delegator address and operator id
func (Querier) DelegatorOperatorDelegations ¶
func (k Querier) DelegatorOperatorDelegations(goCtx context.Context, req *types.QueryDelegatorOperatorDelegationsRequest) (*types.QueryDelegatorOperatorDelegationsResponse, error)
DelegatorOperatorDelegations queries the operator delegations for the given delegator address
func (Querier) DelegatorOperatorUnbondingDelegations ¶
func (k Querier) DelegatorOperatorUnbondingDelegations(goCtx context.Context, req *types.QueryDelegatorOperatorUnbondingDelegationsRequest) (*types.QueryDelegatorOperatorUnbondingDelegationsResponse, error)
DelegatorOperatorUnbondingDelegations queries the operator unbonding delegations for the given delegator address
func (Querier) DelegatorOperators ¶
func (k Querier) DelegatorOperators(goCtx context.Context, req *types.QueryDelegatorOperatorsRequest) (*types.QueryDelegatorOperatorsResponse, error)
DelegatorOperators queries the operators for the given delegator address
func (Querier) DelegatorPool ¶
func (k Querier) DelegatorPool(goCtx context.Context, req *types.QueryDelegatorPoolRequest) (*types.QueryDelegatorPoolResponse, error)
DelegatorPool queries the pool for the given delegator address and pool id
func (Querier) DelegatorPoolDelegations ¶
func (k Querier) DelegatorPoolDelegations(goCtx context.Context, req *types.QueryDelegatorPoolDelegationsRequest) (*types.QueryDelegatorPoolDelegationsResponse, error)
DelegatorPoolDelegations queries the pool delegations for the given delegator address
func (Querier) DelegatorPoolUnbondingDelegations ¶
func (k Querier) DelegatorPoolUnbondingDelegations(goCtx context.Context, req *types.QueryDelegatorPoolUnbondingDelegationsRequest) (*types.QueryDelegatorPoolUnbondingDelegationsResponse, error)
DelegatorPoolUnbondingDelegations queries the pool unbonding delegations for the given delegator address
func (Querier) DelegatorPools ¶
func (k Querier) DelegatorPools(goCtx context.Context, req *types.QueryDelegatorPoolsRequest) (*types.QueryDelegatorPoolsResponse, error)
DelegatorPools queries the pools for the given delegator address
func (Querier) DelegatorService ¶
func (k Querier) DelegatorService(goCtx context.Context, req *types.QueryDelegatorServiceRequest) (*types.QueryDelegatorServiceResponse, error)
DelegatorService queries the service for the given delegator address and service id
func (Querier) DelegatorServiceDelegations ¶
func (k Querier) DelegatorServiceDelegations(goCtx context.Context, req *types.QueryDelegatorServiceDelegationsRequest) (*types.QueryDelegatorServiceDelegationsResponse, error)
DelegatorServiceDelegations queries the service delegations for the given delegator address
func (Querier) DelegatorServiceUnbondingDelegations ¶
func (k Querier) DelegatorServiceUnbondingDelegations(goCtx context.Context, req *types.QueryDelegatorServiceUnbondingDelegationsRequest) (*types.QueryDelegatorServiceUnbondingDelegationsResponse, error)
DelegatorServiceUnbondingDelegations queries the service unbonding delegations for the given delegator address
func (Querier) DelegatorServices ¶
func (k Querier) DelegatorServices(goCtx context.Context, req *types.QueryDelegatorServicesRequest) (*types.QueryDelegatorServicesResponse, error)
DelegatorServices queries the services for the given delegator address
func (Querier) OperatorDelegation ¶
func (k Querier) OperatorDelegation(goCtx context.Context, req *types.QueryOperatorDelegationRequest) (*types.QueryOperatorDelegationResponse, error)
OperatorDelegation queries the operator delegation for the given operator id and user address
func (Querier) OperatorDelegations ¶
func (k Querier) OperatorDelegations(goCtx context.Context, req *types.QueryOperatorDelegationsRequest) (*types.QueryOperatorDelegationsResponse, error)
OperatorDelegations queries the operator delegations for the given operator id
func (Querier) OperatorJoinedServices ¶ added in v1.3.0
func (k Querier) OperatorJoinedServices(goCtx context.Context, req *types.QueryOperatorJoinedServicesRequest) (*types.QueryOperatorJoinedServicesResponse, error)
OperatorJoinedServices queries the services joined by the operator with the given ID
func (Querier) OperatorUnbondingDelegation ¶
func (k Querier) OperatorUnbondingDelegation(goCtx context.Context, req *types.QueryOperatorUnbondingDelegationRequest) (*types.QueryOperatorUnbondingDelegationResponse, error)
OperatorUnbondingDelegation queries the operator unbonding delegation for the given operator id and user address
func (Querier) OperatorUnbondingDelegations ¶
func (k Querier) OperatorUnbondingDelegations(goCtx context.Context, req *types.QueryOperatorUnbondingDelegationsRequest) (*types.QueryOperatorUnbondingDelegationsResponse, error)
OperatorUnbondingDelegations queries the operator unbonding delegations for the given operator id
func (Querier) Params ¶
func (k Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the restaking module parameters
func (Querier) PoolDelegation ¶
func (k Querier) PoolDelegation(goCtx context.Context, req *types.QueryPoolDelegationRequest) (*types.QueryPoolDelegationResponse, error)
PoolDelegation queries the pool delegation for the given pool id and user address
func (Querier) PoolDelegations ¶
func (k Querier) PoolDelegations(goCtx context.Context, req *types.QueryPoolDelegationsRequest) (*types.QueryPoolDelegationsResponse, error)
PoolDelegations queries the pool delegations for the given pool id
func (Querier) PoolUnbondingDelegation ¶
func (k Querier) PoolUnbondingDelegation(goCtx context.Context, req *types.QueryPoolUnbondingDelegationRequest) (*types.QueryPoolUnbondingDelegationResponse, error)
PoolUnbondingDelegation queries the pool unbonding delegation for the given pool id and user address
func (Querier) PoolUnbondingDelegations ¶
func (k Querier) PoolUnbondingDelegations(goCtx context.Context, req *types.QueryPoolUnbondingDelegationsRequest) (*types.QueryPoolUnbondingDelegationsResponse, error)
PoolUnbondingDelegations queries the pool unbonding delegations for the given pool id
func (Querier) ServiceAllowedOperators ¶ added in v1.3.0
func (k Querier) ServiceAllowedOperators( goCtx context.Context, req *types.QueryServiceAllowedOperatorsRequest, ) (*types.QueryServiceAllowedOperatorsResponse, error)
ServiceAllowedOperators queries the allowed operators for a given service.
func (Querier) ServiceDelegation ¶
func (k Querier) ServiceDelegation(goCtx context.Context, req *types.QueryServiceDelegationRequest) (*types.QueryServiceDelegationResponse, error)
ServiceDelegation queries the service delegation for the given service id and user address
func (Querier) ServiceDelegations ¶
func (k Querier) ServiceDelegations(goCtx context.Context, req *types.QueryServiceDelegationsRequest) (*types.QueryServiceDelegationsResponse, error)
ServiceDelegations queries the service delegations for the given service id
func (Querier) ServiceOperators ¶ added in v1.3.0
func (k Querier) ServiceOperators(goCtx context.Context, req *types.QueryServiceOperatorsRequest) (*types.QueryServiceOperatorsResponse, error)
func (Querier) ServiceSecuringPools ¶ added in v1.3.0
func (k Querier) ServiceSecuringPools( goCtx context.Context, req *types.QueryServiceSecuringPoolsRequest, ) (*types.QueryServiceSecuringPoolsResponse, error)
ServiceSecuringPools queries the pools that are securing a given service.
func (Querier) ServiceUnbondingDelegation ¶
func (k Querier) ServiceUnbondingDelegation(goCtx context.Context, req *types.QueryServiceUnbondingDelegationRequest) (*types.QueryServiceUnbondingDelegationResponse, error)
ServiceUnbondingDelegation queries the service unbonding delegation for the given service id and user address
func (Querier) ServiceUnbondingDelegations ¶
func (k Querier) ServiceUnbondingDelegations(goCtx context.Context, req *types.QueryServiceUnbondingDelegationsRequest) (*types.QueryServiceUnbondingDelegationsResponse, error)
ServiceUnbondingDelegations queries the service unbonding delegations for the given service id
type ServicesHooks ¶ added in v1.3.0
type ServicesHooks struct {
*Keeper
}
func (*ServicesHooks) AfterServiceActivated ¶ added in v1.3.0
func (h *ServicesHooks) AfterServiceActivated(ctx sdk.Context, serviceID uint32) error
AfterServiceActivated implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceCreated ¶ added in v1.3.0
func (h *ServicesHooks) AfterServiceCreated(ctx sdk.Context, serviceID uint32) error
AfterServiceCreated implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceDeactivated ¶ added in v1.3.0
func (h *ServicesHooks) AfterServiceDeactivated(ctx sdk.Context, serviceID uint32) error
AfterServiceDeactivated implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceDeleted ¶ added in v1.3.0
func (h *ServicesHooks) AfterServiceDeleted(ctx sdk.Context, serviceID uint32) error
AfterServiceDeactivated implements types.ServicesHooks.