Documentation ¶
Index ¶
- func AccountsBalancesInvariants(k *Keeper) sdk.Invariant
- func AllowedOperatorsExistInvariant(k *Keeper) sdk.Invariant
- func NewMsgServer(keeper *Keeper) types.MsgServer
- func OperatorDelegationToOperatorDelegationResponse(ctx context.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
- func OperatorsDelegatorsSharesInvariant(k *Keeper) sdk.Invariant
- func OperatorsJoinedServicesExistInvariant(k *Keeper) sdk.Invariant
- func PoolDelegationToPoolDelegationResponse(ctx context.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 context.Context, k *Keeper, delegation types.Delegation) (types.DelegationResponse, error)
- func ServicesDelegatorsSharesInvariant(k *Keeper) sdk.Invariant
- type Keeper
- func (k *Keeper) AddOperatorToServiceAllowList(ctx context.Context, serviceID uint32, operatorID uint32) error
- func (k *Keeper) AddOperatorTokensAndShares(ctx context.Context, operator operatorstypes.Operator, tokensToAdd sdk.Coins) (operatorOut operatorstypes.Operator, addedShares sdk.DecCoins, err error)
- func (k *Keeper) AddPoolToServiceSecuringPools(ctx context.Context, serviceID uint32, poolID uint32) error
- func (k *Keeper) AddPoolTokensAndShares(ctx context.Context, pool poolstypes.Pool, tokensToAdd sdk.Coin) (poolOut poolstypes.Pool, addedShares sdk.DecCoin, err error)
- func (k *Keeper) AddServiceToOperatorJoinedServices(ctx context.Context, operatorID uint32, serviceID uint32) error
- func (k *Keeper) AddServiceTokensAndShares(ctx context.Context, service servicestypes.Service, tokensToAdd sdk.Coins) (serviceOut servicestypes.Service, addedShares sdk.DecCoins, err error)
- func (k *Keeper) AfterOperatorDelegationModified(ctx context.Context, operatorID uint32, delegator string) error
- func (k *Keeper) AfterPoolDelegationModified(ctx context.Context, poolID uint32, delegator string) error
- func (k *Keeper) AfterServiceDelegationModified(ctx context.Context, serviceID uint32, delegator string) error
- func (k *Keeper) AfterUnbondingInitiated(ctx context.Context, unbondingDelegationID uint64) error
- func (k *Keeper) AfterUserPreferencesModified(ctx context.Context, userAddress string, ...) error
- func (k *Keeper) BeforeOperatorDelegationCreated(ctx context.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforeOperatorDelegationRemoved(ctx context.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforeOperatorDelegationSharesModified(ctx context.Context, operatorID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationCreated(ctx context.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationRemoved(ctx context.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforePoolDelegationSharesModified(ctx context.Context, poolID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationCreated(ctx context.Context, serviceID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationRemoved(ctx context.Context, serviceID uint32, delegator string) error
- func (k *Keeper) BeforeServiceDelegationSharesModified(ctx context.Context, serviceID uint32, delegator string) error
- func (k *Keeper) CanOperatorValidateService(ctx context.Context, serviceID uint32, operatorID uint32) (bool, error)
- func (k *Keeper) CompleteMatureUnbondingDelegations(ctx sdk.Context) error
- func (k *Keeper) CompleteUnbonding(ctx context.Context, data types.DTData) (sdk.Coins, error)
- func (k *Keeper) DelegateToOperator(ctx context.Context, operatorID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DelegateToPool(ctx context.Context, amount sdk.Coin, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DelegateToService(ctx context.Context, serviceID uint32, amount sdk.Coins, delegator string) (sdk.DecCoins, error)
- func (k *Keeper) DeleteUnbondingIndex(ctx context.Context, id uint64) error
- func (k *Keeper) DequeueAllMatureUBDQueue(ctx context.Context, currTime time.Time) (matureUnbonds []types.DTData, err error)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetAllDelegations(ctx context.Context) ([]types.Delegation, error)
- func (k *Keeper) GetAllOperatorDelegations(ctx context.Context) ([]types.Delegation, error)
- func (k *Keeper) GetAllOperatorUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
- func (k *Keeper) GetAllOperatorsJoinedServices(ctx context.Context) ([]types.OperatorJoinedServices, error)
- func (k *Keeper) GetAllPoolDelegations(ctx context.Context) ([]types.Delegation, error)
- func (k *Keeper) GetAllPoolUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
- func (k *Keeper) GetAllServiceAllowedOperators(ctx context.Context, serviceID uint32) ([]uint32, error)
- func (k *Keeper) GetAllServiceDelegations(ctx context.Context) ([]types.Delegation, error)
- func (k *Keeper) GetAllServiceSecuringPools(ctx context.Context, serviceID uint32) ([]uint32, error)
- func (k *Keeper) GetAllServiceUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
- func (k *Keeper) GetAllServicesAllowedOperators(ctx context.Context) ([]types.ServiceAllowedOperators, error)
- func (k *Keeper) GetAllServicesSecuringPools(ctx context.Context) ([]types.ServiceSecuringPools, error)
- func (k *Keeper) GetAllUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
- func (k *Keeper) GetAllUserOperatorUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserPoolUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserRestakedCoins(ctx context.Context, userAddress string) (sdk.DecCoins, error)
- func (k *Keeper) GetAllUserServiceUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetAllUserUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
- func (k *Keeper) GetDelegationForTarget(ctx context.Context, target types.DelegationTarget, delegator string) (types.Delegation, bool, error)
- func (k *Keeper) GetDelegationTargetFromDelegation(ctx context.Context, delegation types.Delegation) (types.DelegationTarget, bool, error)
- func (k *Keeper) GetOperatorDelegation(ctx context.Context, operatorID uint32, userAddress string) (types.Delegation, bool, error)
- func (k *Keeper) GetOperatorUnbondingDelegation(ctx context.Context, operatorID uint32, delegatorAddress string) (types.UnbondingDelegation, bool, error)
- func (k *Keeper) GetParams(ctx context.Context) (p types.Params, err error)
- func (k *Keeper) GetPoolDelegation(ctx context.Context, poolID uint32, userAddress string) (types.Delegation, bool, error)
- func (k *Keeper) GetPoolUnbondingDelegation(ctx context.Context, poolID uint32, delegator string) (types.UnbondingDelegation, bool, error)
- func (k *Keeper) GetRestakableDenoms(ctx context.Context) ([]string, error)
- func (k *Keeper) GetServiceDelegation(ctx context.Context, serviceID uint32, userAddress string) (types.Delegation, bool, error)
- func (k *Keeper) GetServiceUnbondingDelegation(ctx context.Context, serviceID uint32, delegator string) (types.UnbondingDelegation, bool, error)
- func (k *Keeper) GetUBDQueueTimeSlice(ctx context.Context, timestamp time.Time) (dvPairs []types.DTData, err error)
- func (k *Keeper) GetUnbondingDelegation(ctx context.Context, delegatorAddress string, ubdType types.DelegationType, ...) (types.UnbondingDelegation, bool, error)
- func (k *Keeper) GetUserPreferences(ctx context.Context, userAddress string) (types.UserPreferences, error)
- func (k *Keeper) GetUserPreferencesEntries(ctx context.Context) ([]types.UserPreferencesEntry, error)
- func (k *Keeper) GetUserTrustedServicesIDs(ctx context.Context, userAddress string) ([]uint32, error)
- func (k *Keeper) HasOperatorJoinedService(ctx context.Context, operatorID uint32, serviceID uint32) (bool, error)
- func (k *Keeper) IncrementUnbondingID(ctx context.Context) (unbondingID uint64, err error)
- func (k *Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) error
- func (k *Keeper) InsertUBDQueue(ctx context.Context, ubd types.UnbondingDelegation, completionTime time.Time) error
- func (k *Keeper) IsDenomRestakable(ctx context.Context, denom string) (bool, error)
- func (k *Keeper) IsOperatorInServiceAllowList(ctx context.Context, serviceID uint32, operatorID uint32) (bool, error)
- func (k *Keeper) IsPoolInServiceSecuringPools(ctx context.Context, serviceID uint32, poolID uint32) (bool, error)
- func (k *Keeper) IsServiceOperatorsAllowListConfigured(ctx context.Context, serviceID uint32) (bool, error)
- func (k *Keeper) IsServiceSecuredByPool(ctx context.Context, serviceID uint32, poolID uint32) (bool, error)
- func (k *Keeper) IsServiceSecuringPoolsConfigured(ctx context.Context, serviceID uint32) (bool, error)
- func (k *Keeper) IterateAllOperatorDelegations(ctx context.Context, cb func(del types.Delegation) (stop bool, err error)) error
- func (k *Keeper) IterateAllOperatorsJoinedServices(ctx context.Context, ...) error
- func (k *Keeper) IterateAllPoolDelegations(ctx context.Context, cb func(del types.Delegation) (stop bool, err error)) error
- func (k *Keeper) IterateAllServiceDelegations(ctx context.Context, cb func(del types.Delegation) (stop bool, err error)) error
- func (k *Keeper) IterateAllServicesAllowedOperators(ctx context.Context, ...) error
- func (k *Keeper) IterateServiceDelegations(ctx context.Context, serviceID uint32, ...) error
- func (k *Keeper) IterateUserDelegations(ctx context.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserOperatorDelegations(ctx context.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserPoolDelegations(ctx context.Context, userAddress string, ...) error
- func (k *Keeper) IterateUserServiceDelegations(ctx context.Context, userAddress string, ...) error
- func (k *Keeper) Logger(ctx context.Context) log.Logger
- func (k *Keeper) OperatorsHooks() operatorstypes.OperatorsHooks
- func (k *Keeper) PerformDelegation(ctx context.Context, data types.DelegationData) (sdk.DecCoins, error)
- func (k *Keeper) PerformUndelegation(ctx context.Context, data types.UndelegationData) (time.Time, error)
- func (k *Keeper) RemoveDelegation(ctx context.Context, delegation types.Delegation) error
- func (k *Keeper) RemoveOperatorDelegation(ctx context.Context, delegation types.Delegation) error
- func (k *Keeper) RemoveOperatorFromServiceAllowList(ctx context.Context, serviceID uint32, operatorID uint32) error
- func (k *Keeper) RemovePoolDelegation(ctx context.Context, delegation types.Delegation) error
- func (k *Keeper) RemovePoolFromServiceSecuringPools(ctx context.Context, serviceID uint32, poolID uint32) error
- func (k *Keeper) RemoveServiceDelegation(ctx context.Context, delegation types.Delegation) error
- func (k *Keeper) RemoveServiceFromOperatorJoinedServices(ctx context.Context, operatorID uint32, serviceID uint32) error
- func (k *Keeper) RemoveTargetTokensAndShares(ctx context.Context, data types.UndelegationData) (sdk.Coins, error)
- func (k *Keeper) RemoveUnbondingDelegation(ctx context.Context, ubd types.UnbondingDelegation) error
- func (k *Keeper) ServiceAllowedOperatorsIterator(ctx context.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
- func (k *Keeper) ServiceSecuringPoolsIterator(ctx context.Context, serviceID uint32) (collections.KeySetIterator[collections.Pair[uint32, uint32]], error)
- func (k *Keeper) ServicesHooks() servicestypes.ServicesHooks
- func (k *Keeper) SetDelegation(ctx context.Context, delegation types.Delegation) error
- func (k *Keeper) SetHooks(rs types.RestakingHooks) *Keeper
- func (k *Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k *Keeper) SetRestakableDenoms(ctx context.Context, denoms []string) error
- func (k *Keeper) SetRestakeRestriction(restriction types.RestakeRestrictionFn)
- func (k *Keeper) SetUBDQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.DTData) error
- func (k *Keeper) SetUnbondingDelegation(ctx context.Context, ud types.UnbondingDelegation) ([]byte, error)
- func (k *Keeper) SetUnbondingDelegationByUnbondingID(ctx context.Context, ubd types.UnbondingDelegation, ubdKey []byte, id uint64) error
- func (k *Keeper) SetUnbondingDelegationEntry(ctx context.Context, data types.UndelegationData, creationHeight int64, ...) (types.UnbondingDelegation, error)
- func (k *Keeper) SetUserPreferences(ctx context.Context, userAddress string, preferences types.UserPreferences) error
- func (k *Keeper) UBDQueueIterator(ctx context.Context, endTime time.Time) (storetypes.Iterator, error)
- func (k *Keeper) Unbond(ctx context.Context, data types.UndelegationData) (amount sdk.Coins, err error)
- func (k *Keeper) UnbondRestakedAssets(ctx context.Context, user sdk.AccAddress, amount sdk.Coins) (time.Time, error)
- func (k *Keeper) UnbondingTime(ctx context.Context) (time.Duration, error)
- func (k *Keeper) UndelegateFromOperator(ctx context.Context, operatorID uint32, amount sdk.Coins, delegator string) (time.Time, error)
- func (k *Keeper) UndelegateFromPool(ctx context.Context, amount sdk.Coin, delegator string) (time.Time, error)
- func (k *Keeper) UndelegateFromService(ctx context.Context, serviceID uint32, amount sdk.Coins, delegator string) (time.Time, error)
- func (k *Keeper) ValidateRestake(ctx context.Context, restakerAddress string, restakedAmount sdk.Coins, ...) error
- func (k *Keeper) ValidateUnbondAmount(ctx context.Context, delAddr string, target types.DelegationTarget, ...) (shares sdk.DecCoins, err error)
- type OperatorsHooks
- func (o *OperatorsHooks) AfterOperatorInactivatingCompleted(ctx context.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorInactivatingStarted(ctx context.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorReactivated(ctx context.Context, operatorID uint32) error
- func (o *OperatorsHooks) AfterOperatorRegistered(ctx context.Context, operatorID uint32) error
- func (o *OperatorsHooks) BeforeOperatorDeleted(ctx context.Context, operatorID uint32) error
- type Querier
- func (k Querier) DelegatorOperator(ctx context.Context, req *types.QueryDelegatorOperatorRequest) (*types.QueryDelegatorOperatorResponse, error)
- func (k Querier) DelegatorOperatorDelegations(ctx context.Context, req *types.QueryDelegatorOperatorDelegationsRequest) (*types.QueryDelegatorOperatorDelegationsResponse, error)
- func (k Querier) DelegatorOperatorUnbondingDelegations(ctx context.Context, ...) (*types.QueryDelegatorOperatorUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorOperators(ctx context.Context, req *types.QueryDelegatorOperatorsRequest) (*types.QueryDelegatorOperatorsResponse, error)
- func (k Querier) DelegatorPool(ctx context.Context, req *types.QueryDelegatorPoolRequest) (*types.QueryDelegatorPoolResponse, error)
- func (k Querier) DelegatorPoolDelegations(ctx context.Context, req *types.QueryDelegatorPoolDelegationsRequest) (*types.QueryDelegatorPoolDelegationsResponse, error)
- func (k Querier) DelegatorPoolUnbondingDelegations(ctx context.Context, req *types.QueryDelegatorPoolUnbondingDelegationsRequest) (*types.QueryDelegatorPoolUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorPools(ctx context.Context, req *types.QueryDelegatorPoolsRequest) (*types.QueryDelegatorPoolsResponse, error)
- func (k Querier) DelegatorService(ctx context.Context, req *types.QueryDelegatorServiceRequest) (*types.QueryDelegatorServiceResponse, error)
- func (k Querier) DelegatorServiceDelegations(ctx context.Context, req *types.QueryDelegatorServiceDelegationsRequest) (*types.QueryDelegatorServiceDelegationsResponse, error)
- func (k Querier) DelegatorServiceUnbondingDelegations(ctx context.Context, ...) (*types.QueryDelegatorServiceUnbondingDelegationsResponse, error)
- func (k Querier) DelegatorServices(ctx context.Context, req *types.QueryDelegatorServicesRequest) (*types.QueryDelegatorServicesResponse, error)
- func (k Querier) OperatorDelegation(ctx context.Context, req *types.QueryOperatorDelegationRequest) (*types.QueryOperatorDelegationResponse, error)
- func (k Querier) OperatorDelegations(ctx context.Context, req *types.QueryOperatorDelegationsRequest) (*types.QueryOperatorDelegationsResponse, error)
- func (k Querier) OperatorJoinedServices(ctx context.Context, req *types.QueryOperatorJoinedServicesRequest) (*types.QueryOperatorJoinedServicesResponse, error)
- func (k Querier) OperatorUnbondingDelegation(ctx context.Context, req *types.QueryOperatorUnbondingDelegationRequest) (*types.QueryOperatorUnbondingDelegationResponse, error)
- func (k Querier) OperatorUnbondingDelegations(ctx context.Context, req *types.QueryOperatorUnbondingDelegationsRequest) (*types.QueryOperatorUnbondingDelegationsResponse, error)
- func (k Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PoolDelegation(ctx context.Context, req *types.QueryPoolDelegationRequest) (*types.QueryPoolDelegationResponse, error)
- func (k Querier) PoolDelegations(ctx context.Context, req *types.QueryPoolDelegationsRequest) (*types.QueryPoolDelegationsResponse, error)
- func (k Querier) PoolUnbondingDelegation(ctx context.Context, req *types.QueryPoolUnbondingDelegationRequest) (*types.QueryPoolUnbondingDelegationResponse, error)
- func (k Querier) PoolUnbondingDelegations(ctx context.Context, req *types.QueryPoolUnbondingDelegationsRequest) (*types.QueryPoolUnbondingDelegationsResponse, error)
- func (k Querier) ServiceAllowedOperators(ctx context.Context, req *types.QueryServiceAllowedOperatorsRequest) (*types.QueryServiceAllowedOperatorsResponse, error)
- func (k Querier) ServiceDelegation(ctx context.Context, req *types.QueryServiceDelegationRequest) (*types.QueryServiceDelegationResponse, error)
- func (k Querier) ServiceDelegations(ctx context.Context, req *types.QueryServiceDelegationsRequest) (*types.QueryServiceDelegationsResponse, error)
- func (k Querier) ServiceOperators(ctx context.Context, req *types.QueryServiceOperatorsRequest) (*types.QueryServiceOperatorsResponse, error)
- func (k Querier) ServiceSecuringPools(ctx context.Context, req *types.QueryServiceSecuringPoolsRequest) (*types.QueryServiceSecuringPoolsResponse, error)
- func (k Querier) ServiceUnbondingDelegation(ctx context.Context, req *types.QueryServiceUnbondingDelegationRequest) (*types.QueryServiceUnbondingDelegationResponse, error)
- func (k Querier) ServiceUnbondingDelegations(ctx context.Context, req *types.QueryServiceUnbondingDelegationsRequest) (*types.QueryServiceUnbondingDelegationsResponse, error)
- func (k Querier) UserPreferences(ctx context.Context, req *types.QueryUserPreferencesRequest) (*types.QueryUserPreferencesResponse, error)
- type ServicesHooks
- func (h *ServicesHooks) AfterServiceAccreditationModified(ctx context.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceActivated(ctx context.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceCreated(ctx context.Context, serviceID uint32) error
- func (h *ServicesHooks) AfterServiceDeactivated(ctx context.Context, serviceID uint32) error
- func (h *ServicesHooks) BeforeServiceDeleted(ctx context.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 ¶
AllowedOperatorsExistInvariant checks that all the operators that are allowed to join a service exist
func NewMsgServer ¶
func OperatorDelegationToOperatorDelegationResponse ¶
func OperatorDelegationToOperatorDelegationResponse(ctx context.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 ¶
OperatorsJoinedServicesExistInvariant checks that all the services that are joined by operators exist
func PoolDelegationToPoolDelegationResponse ¶
func PoolDelegationToPoolDelegationResponse(ctx context.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 context.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, storeService corestoretypes.KVStoreService, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, poolsKeeper types.PoolsKeeper, operatorsKeeper types.OperatorsKeeper, servicesKeeper types.ServicesKeeper, authority string, ) *Keeper
func (*Keeper) AddOperatorToServiceAllowList ¶
func (k *Keeper) AddOperatorToServiceAllowList(ctx context.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 context.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 ¶
func (k *Keeper) AddPoolToServiceSecuringPools(ctx context.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 context.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 ¶
func (k *Keeper) AddServiceToOperatorJoinedServices(ctx context.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 context.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 context.Context, operatorID uint32, delegator string) error
AfterOperatorDelegationModified implements types.RestakingHooks
func (*Keeper) AfterPoolDelegationModified ¶
func (k *Keeper) AfterPoolDelegationModified(ctx context.Context, poolID uint32, delegator string) error
AfterPoolDelegationModified implements types.RestakingHooks
func (*Keeper) AfterServiceDelegationModified ¶
func (k *Keeper) AfterServiceDelegationModified(ctx context.Context, serviceID uint32, delegator string) error
AfterServiceDelegationModified implements types.RestakingHooks
func (*Keeper) AfterUnbondingInitiated ¶
AfterUnbondingInitiated implements types.RestakingHooks
func (*Keeper) AfterUserPreferencesModified ¶
func (k *Keeper) AfterUserPreferencesModified(ctx context.Context, userAddress string, oldPreferences, newPreferences types.UserPreferences) error
AfterUserPreferencesModified implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationCreated ¶
func (k *Keeper) BeforeOperatorDelegationCreated(ctx context.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationRemoved ¶
func (k *Keeper) BeforeOperatorDelegationRemoved(ctx context.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforeOperatorDelegationSharesModified ¶
func (k *Keeper) BeforeOperatorDelegationSharesModified(ctx context.Context, operatorID uint32, delegator string) error
BeforeOperatorDelegationSharesModified implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationCreated ¶
func (k *Keeper) BeforePoolDelegationCreated(ctx context.Context, poolID uint32, delegator string) error
BeforePoolDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationRemoved ¶
func (k *Keeper) BeforePoolDelegationRemoved(ctx context.Context, poolID uint32, delegator string) error
BeforePoolDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforePoolDelegationSharesModified ¶
func (k *Keeper) BeforePoolDelegationSharesModified(ctx context.Context, poolID uint32, delegator string) error
BeforePoolDelegationSharesModified implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationCreated ¶
func (k *Keeper) BeforeServiceDelegationCreated(ctx context.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationCreated implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationRemoved ¶
func (k *Keeper) BeforeServiceDelegationRemoved(ctx context.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationRemoved implements types.RestakingHooks
func (*Keeper) BeforeServiceDelegationSharesModified ¶
func (k *Keeper) BeforeServiceDelegationSharesModified(ctx context.Context, serviceID uint32, delegator string) error
BeforeServiceDelegationSharesModified implements types.RestakingHooks
func (*Keeper) CanOperatorValidateService ¶
func (k *Keeper) CanOperatorValidateService(ctx context.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 context.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 context.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 context.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 context.Context, currTime time.Time) (matureUnbonds []types.DTData, err error)
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 ¶
GetAllDelegations returns all the delegations
func (*Keeper) GetAllOperatorDelegations ¶
GetAllOperatorDelegations returns all the operator delegations
func (*Keeper) GetAllOperatorUnbondingDelegations ¶
func (k *Keeper) GetAllOperatorUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
GetAllOperatorUnbondingDelegations returns all the operator unbonding delegations
func (*Keeper) GetAllOperatorsJoinedServices ¶
func (k *Keeper) GetAllOperatorsJoinedServices(ctx context.Context) ([]types.OperatorJoinedServices, error)
GetAllOperatorsJoinedServices returns all services that each operator has joined
func (*Keeper) GetAllPoolDelegations ¶
GetAllPoolDelegations returns all the pool delegations
func (*Keeper) GetAllPoolUnbondingDelegations ¶
func (k *Keeper) GetAllPoolUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
GetAllPoolUnbondingDelegations returns all the pool unbonding delegations
func (*Keeper) GetAllServiceAllowedOperators ¶
func (k *Keeper) GetAllServiceAllowedOperators(ctx context.Context, serviceID uint32) ([]uint32, error)
GetAllServiceAllowedOperators returns all operators that have been whitelisted by a service
func (*Keeper) GetAllServiceDelegations ¶
GetAllServiceDelegations returns all the service delegations
func (*Keeper) GetAllServiceSecuringPools ¶
func (k *Keeper) GetAllServiceSecuringPools(ctx context.Context, serviceID uint32) ([]uint32, error)
GetAllServiceSecuringPools returns all pools that have been allowed to secure the give service
func (*Keeper) GetAllServiceUnbondingDelegations ¶
func (k *Keeper) GetAllServiceUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
GetAllServiceUnbondingDelegations returns all the service unbonding delegations
func (*Keeper) GetAllServicesAllowedOperators ¶
func (k *Keeper) GetAllServicesAllowedOperators(ctx context.Context) ([]types.ServiceAllowedOperators, error)
GetAllServicesAllowedOperators returns all the operators that are allowed to secure a service for all the services
func (*Keeper) GetAllServicesSecuringPools ¶
func (k *Keeper) GetAllServicesSecuringPools(ctx context.Context) ([]types.ServiceSecuringPools, error)
GetAllServicesSecuringPools returns all the pools from which the services are allowed to borrow security
func (*Keeper) GetAllUnbondingDelegations ¶
func (k *Keeper) GetAllUnbondingDelegations(ctx context.Context) ([]types.UnbondingDelegation, error)
GetAllUnbondingDelegations returns all the unbonding delegations
func (*Keeper) GetAllUserOperatorUnbondingDelegations ¶
func (k *Keeper) GetAllUserOperatorUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
GetAllUserOperatorUnbondingDelegations returns all the user's unbonding delegations from an operator
func (*Keeper) GetAllUserPoolUnbondingDelegations ¶
func (k *Keeper) GetAllUserPoolUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
GetAllUserPoolUnbondingDelegations returns all the user's unbonding delegations from a pool
func (*Keeper) GetAllUserRestakedCoins ¶
func (k *Keeper) GetAllUserRestakedCoins(ctx context.Context, userAddress string) (sdk.DecCoins, error)
GetAllUserRestakedCoins returns all the user's restaked coins
func (*Keeper) GetAllUserServiceUnbondingDelegations ¶
func (k *Keeper) GetAllUserServiceUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
GetAllUserServiceUnbondingDelegations returns all the user's unbonding delegations from a service
func (*Keeper) GetAllUserUnbondingDelegations ¶
func (k *Keeper) GetAllUserUnbondingDelegations(ctx context.Context, userAddress string) []types.UnbondingDelegation
GetAllUserUnbondingDelegations returns all the user's unbonding delegations
func (*Keeper) GetDelegationForTarget ¶
func (k *Keeper) GetDelegationForTarget( ctx context.Context, target types.DelegationTarget, delegator string, ) (types.Delegation, bool, error)
GetDelegationForTarget returns the delegation for the given delegator and target.
func (*Keeper) GetDelegationTargetFromDelegation ¶
func (k *Keeper) GetDelegationTargetFromDelegation( ctx context.Context, delegation types.Delegation, ) (types.DelegationTarget, bool, error)
GetDelegationTargetFromDelegation returns the target of the given delegation.
func (*Keeper) GetOperatorDelegation ¶
func (k *Keeper) GetOperatorDelegation(ctx context.Context, operatorID uint32, userAddress string) (types.Delegation, bool, error)
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 context.Context, operatorID uint32, delegatorAddress string) (types.UnbondingDelegation, bool, error)
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 context.Context, poolID uint32, userAddress string) (types.Delegation, bool, error)
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 context.Context, poolID uint32, delegator string) (types.UnbondingDelegation, bool, error)
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) GetRestakableDenoms ¶
GetRestakableDenoms gets the list of denoms that are allowed to be restaked. If the list is empty, all denoms are allowed.
func (*Keeper) GetServiceDelegation ¶
func (k *Keeper) GetServiceDelegation(ctx context.Context, serviceID uint32, userAddress string) (types.Delegation, bool, error)
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 context.Context, serviceID uint32, delegator string) (types.UnbondingDelegation, bool, error)
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 context.Context, timestamp time.Time) (dvPairs []types.DTData, err error)
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 context.Context, delegatorAddress string, ubdType types.DelegationType, targetID uint32, ) (types.UnbondingDelegation, bool, error)
GetUnbondingDelegation returns the unbonding delegation for the given delegator and target.
func (*Keeper) GetUserPreferences ¶
func (k *Keeper) GetUserPreferences(ctx context.Context, userAddress string) (types.UserPreferences, error)
GetUserPreferences returns the preferences of the user having the given address. If no custom preferences have been previously set by a user, the default ones will be returned instead.
func (*Keeper) GetUserPreferencesEntries ¶
func (k *Keeper) GetUserPreferencesEntries(ctx context.Context) ([]types.UserPreferencesEntry, error)
GetUserPreferencesEntries returns all the user preferences entries
func (*Keeper) GetUserTrustedServicesIDs ¶
func (k *Keeper) GetUserTrustedServicesIDs(ctx context.Context, userAddress string) ([]uint32, error)
GetUserTrustedServicesIDs returns the IDs of the services that the user trusts based on the user preferences and the services' status.
func (*Keeper) HasOperatorJoinedService ¶
func (k *Keeper) HasOperatorJoinedService(ctx context.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 ¶
InitGenesis initializes the genesis store using the provided data
func (*Keeper) InsertUBDQueue ¶
func (k *Keeper) InsertUBDQueue(ctx context.Context, ubd types.UnbondingDelegation, completionTime time.Time) error
InsertUBDQueue inserts an unbonding delegation to the appropriate timeslice in the unbonding queue.
func (*Keeper) IsDenomRestakable ¶
IsDenomRestakable checks if the asset with the provided denom is allowed to be restaked.
func (*Keeper) IsOperatorInServiceAllowList ¶
func (k *Keeper) IsOperatorInServiceAllowList(ctx context.Context, serviceID uint32, operatorID uint32) (bool, error)
IsOperatorInServiceAllowList returns true if the given operator is in the service operators allow list
func (*Keeper) IsPoolInServiceSecuringPools ¶
func (k *Keeper) IsPoolInServiceSecuringPools(ctx context.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) IsServiceOperatorsAllowListConfigured ¶
func (k *Keeper) IsServiceOperatorsAllowListConfigured(ctx context.Context, serviceID uint32) (bool, error)
IsServiceOperatorsAllowListConfigured returns true if the operators allow list
func (*Keeper) IsServiceSecuredByPool ¶
func (k *Keeper) IsServiceSecuredByPool(ctx context.Context, serviceID uint32, poolID uint32) (bool, error)
IsServiceSecuredByPool returns true if the service is being secured by the given pool
func (*Keeper) IsServiceSecuringPoolsConfigured ¶
func (k *Keeper) IsServiceSecuringPoolsConfigured(ctx context.Context, serviceID uint32) (bool, error)
IsServiceSecuringPoolsConfigured returns true if the list of securing pools has been configured for the given service
func (*Keeper) IterateAllOperatorDelegations ¶
func (k *Keeper) IterateAllOperatorDelegations(ctx context.Context, cb func(del types.Delegation) (stop bool, err error)) error
IterateAllOperatorDelegations iterates all the operator delegations and performs the given callback function
func (*Keeper) IterateAllOperatorsJoinedServices ¶
func (k *Keeper) IterateAllOperatorsJoinedServices(ctx context.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 context.Context, cb func(del types.Delegation) (stop bool, err error)) error
IterateAllPoolDelegations iterates all the pool delegations and performs the given callback function
func (*Keeper) IterateAllServiceDelegations ¶
func (k *Keeper) IterateAllServiceDelegations(ctx context.Context, cb func(del types.Delegation) (stop bool, err error)) error
IterateAllServiceDelegations iterates all the service delegations and performs the given callback function
func (*Keeper) IterateAllServicesAllowedOperators ¶
func (k *Keeper) IterateAllServicesAllowedOperators(ctx context.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) IterateServiceDelegations ¶
func (k *Keeper) IterateServiceDelegations(ctx context.Context, serviceID uint32, cb func(del types.Delegation) (stop bool, err error)) error
IterateServiceDelegations iterates all the delegations of a service and performs the given callback function
func (*Keeper) IterateUserDelegations ¶
func (k *Keeper) IterateUserDelegations( ctx context.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 context.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 context.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 context.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 ¶
func (k *Keeper) OperatorsHooks() operatorstypes.OperatorsHooks
func (*Keeper) PerformDelegation ¶
func (k *Keeper) PerformDelegation(ctx context.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 context.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 ¶
RemoveDelegation removes the given delegation from the store
func (*Keeper) RemoveOperatorDelegation ¶
RemoveOperatorDelegation removes the given operator delegation from the store
func (*Keeper) RemoveOperatorFromServiceAllowList ¶
func (k *Keeper) RemoveOperatorFromServiceAllowList(ctx context.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 ¶
RemovePoolDelegation removes the given pool delegation from the store
func (*Keeper) RemovePoolFromServiceSecuringPools ¶
func (k *Keeper) RemovePoolFromServiceSecuringPools(ctx context.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 ¶
RemoveServiceDelegation removes the given service delegation from the store
func (*Keeper) RemoveServiceFromOperatorJoinedServices ¶
func (k *Keeper) RemoveServiceFromOperatorJoinedServices(ctx context.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 context.Context, data types.UndelegationData) (sdk.Coins, error)
RemoveTargetTokensAndShares removes the given amount of tokens and shares from the target.
func (*Keeper) RemoveUnbondingDelegation ¶
func (k *Keeper) RemoveUnbondingDelegation(ctx context.Context, ubd types.UnbondingDelegation) error
RemoveUnbondingDelegation removes the unbonding delegation object and associated index.
func (*Keeper) ServiceAllowedOperatorsIterator ¶
func (k *Keeper) ServiceAllowedOperatorsIterator(ctx context.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 ¶
func (k *Keeper) ServiceSecuringPoolsIterator(ctx context.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 ¶
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) SetRestakableDenoms ¶
SetRestakableDenoms sets the denoms that are allowed to be restaked.
func (*Keeper) SetRestakeRestriction ¶
func (k *Keeper) SetRestakeRestriction(restriction types.RestakeRestrictionFn)
SetRestakeRestriction sets a function that checks if a restake operation is allowed.
func (*Keeper) SetUBDQueueTimeSlice ¶
func (k *Keeper) SetUBDQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.DTData) error
SetUBDQueueTimeSlice sets a specific unbonding queue timeslice.
func (*Keeper) SetUnbondingDelegation ¶
func (k *Keeper) SetUnbondingDelegation(ctx context.Context, ud types.UnbondingDelegation) ([]byte, error)
SetUnbondingDelegation stores the given unbonding delegation in the store
func (*Keeper) SetUnbondingDelegationByUnbondingID ¶
func (k *Keeper) SetUnbondingDelegationByUnbondingID(ctx context.Context, ubd types.UnbondingDelegation, ubdKey []byte, id uint64) error
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 context.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) SetUserPreferences ¶
func (k *Keeper) SetUserPreferences(ctx context.Context, userAddress string, preferences types.UserPreferences) error
SetUserPreferences sets the given preferences for the user having the given address
func (*Keeper) UBDQueueIterator ¶
func (k *Keeper) UBDQueueIterator(ctx context.Context, endTime time.Time) (storetypes.Iterator, error)
UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.
func (*Keeper) Unbond ¶
func (k *Keeper) Unbond(ctx context.Context, data types.UndelegationData) (amount sdk.Coins, err error)
Unbond unbonds a particular delegation and perform associated store operations.
func (*Keeper) UnbondRestakedAssets ¶
func (k *Keeper) UnbondRestakedAssets(ctx context.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 context.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 context.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 context.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) ValidateRestake ¶
func (k *Keeper) ValidateRestake(ctx context.Context, restakerAddress string, restakedAmount sdk.Coins, target types.DelegationTarget) error
ValidateRestake returns nil if the restake operation is allowed, otherwise returns an error.
func (*Keeper) ValidateUnbondAmount ¶
func (k *Keeper) ValidateUnbondAmount( ctx context.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 OperatorsHooks ¶
type OperatorsHooks struct {
*Keeper
}
func (*OperatorsHooks) AfterOperatorInactivatingCompleted ¶
func (o *OperatorsHooks) AfterOperatorInactivatingCompleted(ctx context.Context, operatorID uint32) error
AfterOperatorInactivatingCompleted implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorInactivatingStarted ¶
func (o *OperatorsHooks) AfterOperatorInactivatingStarted(ctx context.Context, operatorID uint32) error
AfterOperatorInactivatingStarted implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorReactivated ¶
func (o *OperatorsHooks) AfterOperatorReactivated(ctx context.Context, operatorID uint32) error
AfterOperatorReactivated implements types.OperatorsHooks.
func (*OperatorsHooks) AfterOperatorRegistered ¶
func (o *OperatorsHooks) AfterOperatorRegistered(ctx context.Context, operatorID uint32) error
AfterOperatorRegistered implements types.OperatorsHooks.
func (*OperatorsHooks) BeforeOperatorDeleted ¶
func (o *OperatorsHooks) BeforeOperatorDeleted(ctx context.Context, operatorID uint32) error
BeforeOperatorDeleted implements types.OperatorsHooks.
type Querier ¶
type Querier struct {
*Keeper
}
func NewQuerier ¶
func (Querier) DelegatorOperator ¶
func (k Querier) DelegatorOperator(ctx 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(ctx 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(ctx 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(ctx context.Context, req *types.QueryDelegatorOperatorsRequest) (*types.QueryDelegatorOperatorsResponse, error)
DelegatorOperators queries the operators for the given delegator address
func (Querier) DelegatorPool ¶
func (k Querier) DelegatorPool(ctx 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(ctx 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(ctx 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(ctx context.Context, req *types.QueryDelegatorPoolsRequest) (*types.QueryDelegatorPoolsResponse, error)
DelegatorPools queries the pools for the given delegator address
func (Querier) DelegatorService ¶
func (k Querier) DelegatorService(ctx 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(ctx 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(ctx 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(ctx context.Context, req *types.QueryDelegatorServicesRequest) (*types.QueryDelegatorServicesResponse, error)
DelegatorServices queries the services for the given delegator address
func (Querier) OperatorDelegation ¶
func (k Querier) OperatorDelegation(ctx 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(ctx context.Context, req *types.QueryOperatorDelegationsRequest) (*types.QueryOperatorDelegationsResponse, error)
OperatorDelegations queries the operator delegations for the given operator id
func (Querier) OperatorJoinedServices ¶
func (k Querier) OperatorJoinedServices(ctx 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(ctx 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(ctx 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(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the restaking module parameters
func (Querier) PoolDelegation ¶
func (k Querier) PoolDelegation(ctx 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(ctx 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(ctx 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(ctx context.Context, req *types.QueryPoolUnbondingDelegationsRequest) (*types.QueryPoolUnbondingDelegationsResponse, error)
PoolUnbondingDelegations queries the pool unbonding delegations for the given pool id
func (Querier) ServiceAllowedOperators ¶
func (k Querier) ServiceAllowedOperators( ctx context.Context, req *types.QueryServiceAllowedOperatorsRequest, ) (*types.QueryServiceAllowedOperatorsResponse, error)
ServiceAllowedOperators queries the allowed operators for a given service.
func (Querier) ServiceDelegation ¶
func (k Querier) ServiceDelegation(ctx 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(ctx context.Context, req *types.QueryServiceDelegationsRequest) (*types.QueryServiceDelegationsResponse, error)
ServiceDelegations queries the service delegations for the given service id
func (Querier) ServiceOperators ¶
func (k Querier) ServiceOperators(ctx context.Context, req *types.QueryServiceOperatorsRequest) (*types.QueryServiceOperatorsResponse, error)
func (Querier) ServiceSecuringPools ¶
func (k Querier) ServiceSecuringPools( ctx 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(ctx 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(ctx context.Context, req *types.QueryServiceUnbondingDelegationsRequest) (*types.QueryServiceUnbondingDelegationsResponse, error)
ServiceUnbondingDelegations queries the service unbonding delegations for the given service id
func (Querier) UserPreferences ¶
func (k Querier) UserPreferences(ctx context.Context, req *types.QueryUserPreferencesRequest) (*types.QueryUserPreferencesResponse, error)
UserPreferences queries the user preferences for the given user address
type ServicesHooks ¶
type ServicesHooks struct {
*Keeper
}
func (*ServicesHooks) AfterServiceAccreditationModified ¶
func (h *ServicesHooks) AfterServiceAccreditationModified(ctx context.Context, serviceID uint32) error
AfterServiceAccreditationModified implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceActivated ¶
func (h *ServicesHooks) AfterServiceActivated(ctx context.Context, serviceID uint32) error
AfterServiceActivated implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceCreated ¶
func (h *ServicesHooks) AfterServiceCreated(ctx context.Context, serviceID uint32) error
AfterServiceCreated implements types.ServicesHooks.
func (*ServicesHooks) AfterServiceDeactivated ¶
func (h *ServicesHooks) AfterServiceDeactivated(ctx context.Context, serviceID uint32) error
AfterServiceDeactivated implements types.ServicesHooks.
func (*ServicesHooks) BeforeServiceDeleted ¶
func (h *ServicesHooks) BeforeServiceDeleted(ctx context.Context, serviceID uint32) error
BeforeServiceDeleted implements types.ServicesHooks.