Documentation ¶
Index ¶
- type Keeper
- func (k *Keeper) BeginBlock(ctx sdk.Context)
- func (k *Keeper) DeleteAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress)
- func (k *Keeper) DeleteSession(ctx sdk.Context, id uint64)
- func (k *Keeper) DeleteSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) DeleteSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress, sessionID uint64)
- func (k *Keeper) DeleteSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)
- func (k *Keeper) DeleteSessionForPlanByNode(ctx sdk.Context, planID uint64, addr base.NodeAddress, sessionID uint64)
- func (k *Keeper) DeleteSessionForSubscription(ctx sdk.Context, subscriptionID, sessionID uint64)
- func (k *Keeper) DeleteSubscription(ctx sdk.Context, id uint64)
- func (k *Keeper) DeleteSubscriptionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) DeleteSubscriptionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) DeleteSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)
- func (k *Keeper) DeleteSubscriptionForRenewalAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState
- func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (alloc v2.Allocation, found bool)
- func (k *Keeper) GetAllocationsForSubscription(ctx sdk.Context, id uint64) (items v2.Allocations)
- func (k *Keeper) GetInactiveAt(ctx sdk.Context) time.Time
- func (k *Keeper) GetNode(ctx sdk.Context, addr base.NodeAddress) (nodetypes.Node, bool)
- func (k *Keeper) GetParams(ctx sdk.Context) (v v2.Params)
- func (k *Keeper) GetPlan(ctx sdk.Context, id uint64) (plantypes.Plan, bool)
- func (k *Keeper) GetSession(ctx sdk.Context, id uint64) (sessiontypes.Session, bool)
- func (k *Keeper) GetSessionCount(ctx sdk.Context) uint64
- func (k *Keeper) GetSessionInactiveAt(ctx sdk.Context) time.Time
- func (k *Keeper) GetSubscription(ctx sdk.Context, id uint64) (subscription v3.Subscription, found bool)
- func (k *Keeper) GetSubscriptionCount(ctx sdk.Context) uint64
- func (k *Keeper) GetSubscriptions(ctx sdk.Context) (items []v3.Subscription)
- func (k *Keeper) GetSubscriptionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items []v3.Subscription)
- func (k *Keeper) GetSubscriptionsForPlan(ctx sdk.Context, id uint64) (items []v3.Subscription)
- func (k *Keeper) HandleMsgCancelSubscription(ctx sdk.Context, msg *v3.MsgCancelSubscriptionRequest) (*v3.MsgCancelSubscriptionResponse, error)
- func (k *Keeper) HandleMsgRenewSubscription(ctx sdk.Context, msg *v3.MsgRenewSubscriptionRequest) (*v3.MsgRenewSubscriptionResponse, error)
- func (k *Keeper) HandleMsgShareSubscription(ctx sdk.Context, msg *v3.MsgShareSubscriptionRequest) (*v3.MsgShareSubscriptionResponse, error)
- func (k *Keeper) HandleMsgStartSession(ctx sdk.Context, msg *v3.MsgStartSessionRequest) (*v3.MsgStartSessionResponse, error)
- func (k *Keeper) HandleMsgStartSubscription(ctx sdk.Context, msg *v3.MsgStartSubscriptionRequest) (*v3.MsgStartSubscriptionResponse, error)
- func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
- func (k *Keeper) HandleMsgUpdateSubscription(ctx sdk.Context, msg *v3.MsgUpdateSubscriptionRequest) (*v3.MsgUpdateSubscriptionResponse, error)
- func (k *Keeper) HandleQueryAllocation(ctx sdk.Context, req *v2.QueryAllocationRequest) (*v2.QueryAllocationResponse, error)
- func (k *Keeper) HandleQueryAllocations(ctx sdk.Context, req *v2.QueryAllocationsRequest) (*v2.QueryAllocationsResponse, error)
- func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v2.QueryParamsRequest) (*v2.QueryParamsResponse, error)
- func (k *Keeper) HandleQuerySubscription(ctx sdk.Context, req *v3.QuerySubscriptionRequest) (*v3.QuerySubscriptionResponse, error)
- func (k *Keeper) HandleQuerySubscriptions(ctx sdk.Context, req *v3.QuerySubscriptionsRequest) (*v3.QuerySubscriptionsResponse, error)
- func (k *Keeper) HandleQuerySubscriptionsForAccount(ctx sdk.Context, req *v3.QuerySubscriptionsForAccountRequest) (*v3.QuerySubscriptionsForAccountResponse, error)
- func (k *Keeper) HandleQuerySubscriptionsForPlan(ctx sdk.Context, req *v3.QuerySubscriptionsForPlanRequest) (*v3.QuerySubscriptionsForPlanResponse, error)
- func (k *Keeper) HasAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) bool
- func (k *Keeper) HasSubscriptionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64) bool
- func (k *Keeper) HasSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64) bool
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
- func (k *Keeper) IterateAllocationsForSubscription(ctx sdk.Context, id uint64, fn func(index int, item v2.Allocation) (stop bool))
- func (k *Keeper) IterateSubscriptions(ctx sdk.Context, fn func(index int, item v3.Subscription) (stop bool))
- func (k *Keeper) IterateSubscriptionsForInactiveAt(ctx sdk.Context, at time.Time, ...)
- func (k *Keeper) IterateSubscriptionsForRenewalAt(ctx sdk.Context, at time.Time, ...)
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) ProviderStakingShare(ctx sdk.Context) sdkmath.LegacyDec
- func (k *Keeper) QuotePriceFunc(ctx sdk.Context, price sdk.DecCoin) (sdk.Coin, error)
- func (k *Keeper) SendCoin(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) SendCoinFromAccountToModule(ctx sdk.Context, from sdk.AccAddress, to string, coin sdk.Coin) error
- func (k *Keeper) SessionInactivePreHook(ctx sdk.Context, id uint64) error
- func (k *Keeper) SetAllocation(ctx sdk.Context, alloc v2.Allocation)
- func (k *Keeper) SetParams(ctx sdk.Context, params v2.Params)
- func (k *Keeper) SetSession(ctx sdk.Context, session sessiontypes.Session)
- func (k *Keeper) SetSessionCount(ctx sdk.Context, count uint64)
- func (k *Keeper) SetSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) SetSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress, sessionID uint64)
- func (k *Keeper) SetSessionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) SetSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)
- func (k *Keeper) SetSessionForPlanByNode(ctx sdk.Context, planID uint64, addr base.NodeAddress, sessionID uint64)
- func (k *Keeper) SetSessionForSubscription(ctx sdk.Context, subscriptionID, sessionID uint64)
- func (k *Keeper) SetSubscription(ctx sdk.Context, subscription v3.Subscription)
- func (k *Keeper) SetSubscriptionCount(ctx sdk.Context, count uint64)
- func (k *Keeper) SetSubscriptionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) SetSubscriptionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) SetSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)
- func (k *Keeper) SetSubscriptionForRenewalAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) StatusChangeDelay(ctx sdk.Context) time.Duration
- func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore
- func (k *Keeper) SubscriptionInactivePendingPreHook(ctx sdk.Context, id uint64) error
- func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)
- func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
- func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper)
- func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper)
- func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)
- func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, router *baseapp.MsgServiceRouter, authority, feeCollectorName string) Keeper
func (*Keeper) BeginBlock ¶
BeginBlock is called at the beginning of each block to handle subscription-related operations.
func (*Keeper) DeleteAllocation ¶
DeleteAllocation removes the allocation for a given ID and address from the KVStore.
func (*Keeper) DeleteSessionForAccount ¶
func (*Keeper) DeleteSessionForAllocation ¶
func (*Keeper) DeleteSessionForNode ¶
func (*Keeper) DeleteSessionForPlanByNode ¶
func (*Keeper) DeleteSessionForSubscription ¶
func (*Keeper) DeleteSubscription ¶
DeleteSubscription removes a subscription from the module's KVStore based on the subscription ID.
func (*Keeper) DeleteSubscriptionForAccount ¶
DeleteSubscriptionForAccount removes the association between a subscription ID and an account address from the module's KVStore.
func (*Keeper) DeleteSubscriptionForInactiveAt ¶
DeleteSubscriptionForInactiveAt removes the inactive subscription record from the module's KVStore based on the specified time and subscription ID.
func (*Keeper) DeleteSubscriptionForPlan ¶
DeleteSubscriptionForPlan removes the association between a subscription ID and a plan ID from the module's KVStore.
func (*Keeper) DeleteSubscriptionForRenewalAt ¶
DeleteSubscriptionForRenewalAt removes the renewal subscription record from the module's KVStore based on the specified time and subscription ID.
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState
func (*Keeper) GetAllocation ¶
func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (alloc v2.Allocation, found bool)
GetAllocation retrieves the allocation for a given ID and address from the KVStore. It returns the allocation and a boolean indicating if the allocation was found.
func (*Keeper) GetAllocationsForSubscription ¶
GetAllocationsForSubscription retrieves all allocations for a given subscription ID.
func (*Keeper) GetInactiveAt ¶
GetInactiveAt returns the inactive time by adding StatusChangeDelay to the current block time.
func (*Keeper) GetSession ¶
func (*Keeper) GetSessionInactiveAt ¶
func (*Keeper) GetSubscription ¶
func (k *Keeper) GetSubscription(ctx sdk.Context, id uint64) (subscription v3.Subscription, found bool)
GetSubscription retrieves a subscription from the module's KVStore based on the subscription ID. Returns the subscription and a boolean indicating if it was found.
func (*Keeper) GetSubscriptionCount ¶
GetSubscriptionCount retrieves the count value from the KVStore. If the count value does not exist, it returns 0 as the default.
func (*Keeper) GetSubscriptions ¶
func (k *Keeper) GetSubscriptions(ctx sdk.Context) (items []v3.Subscription)
GetSubscriptions retrieves all subscriptions from the module's KVStore.
func (*Keeper) GetSubscriptionsForAccount ¶
func (k *Keeper) GetSubscriptionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items []v3.Subscription)
GetSubscriptionsForAccount retrieves all subscriptions associated with a specific account address.
func (*Keeper) GetSubscriptionsForPlan ¶
GetSubscriptionsForPlan retrieves all subscriptions associated with a specific plan ID.
func (*Keeper) HandleMsgCancelSubscription ¶
func (k *Keeper) HandleMsgCancelSubscription(ctx sdk.Context, msg *v3.MsgCancelSubscriptionRequest) (*v3.MsgCancelSubscriptionResponse, error)
func (*Keeper) HandleMsgRenewSubscription ¶
func (k *Keeper) HandleMsgRenewSubscription(ctx sdk.Context, msg *v3.MsgRenewSubscriptionRequest) (*v3.MsgRenewSubscriptionResponse, error)
func (*Keeper) HandleMsgShareSubscription ¶
func (k *Keeper) HandleMsgShareSubscription(ctx sdk.Context, msg *v3.MsgShareSubscriptionRequest) (*v3.MsgShareSubscriptionResponse, error)
func (*Keeper) HandleMsgStartSession ¶
func (k *Keeper) HandleMsgStartSession(ctx sdk.Context, msg *v3.MsgStartSessionRequest) (*v3.MsgStartSessionResponse, error)
func (*Keeper) HandleMsgStartSubscription ¶
func (k *Keeper) HandleMsgStartSubscription(ctx sdk.Context, msg *v3.MsgStartSubscriptionRequest) (*v3.MsgStartSubscriptionResponse, error)
func (*Keeper) HandleMsgUpdateParams ¶
func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
func (*Keeper) HandleMsgUpdateSubscription ¶
func (k *Keeper) HandleMsgUpdateSubscription(ctx sdk.Context, msg *v3.MsgUpdateSubscriptionRequest) (*v3.MsgUpdateSubscriptionResponse, error)
func (*Keeper) HandleQueryAllocation ¶
func (k *Keeper) HandleQueryAllocation(ctx sdk.Context, req *v2.QueryAllocationRequest) (*v2.QueryAllocationResponse, error)
func (*Keeper) HandleQueryAllocations ¶
func (k *Keeper) HandleQueryAllocations(ctx sdk.Context, req *v2.QueryAllocationsRequest) (*v2.QueryAllocationsResponse, error)
func (*Keeper) HandleQueryParams ¶
func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v2.QueryParamsRequest) (*v2.QueryParamsResponse, error)
func (*Keeper) HandleQuerySubscription ¶
func (k *Keeper) HandleQuerySubscription(ctx sdk.Context, req *v3.QuerySubscriptionRequest) (*v3.QuerySubscriptionResponse, error)
func (*Keeper) HandleQuerySubscriptions ¶
func (k *Keeper) HandleQuerySubscriptions(ctx sdk.Context, req *v3.QuerySubscriptionsRequest) (*v3.QuerySubscriptionsResponse, error)
func (*Keeper) HandleQuerySubscriptionsForAccount ¶
func (k *Keeper) HandleQuerySubscriptionsForAccount(ctx sdk.Context, req *v3.QuerySubscriptionsForAccountRequest) (*v3.QuerySubscriptionsForAccountResponse, error)
func (*Keeper) HandleQuerySubscriptionsForPlan ¶
func (k *Keeper) HandleQuerySubscriptionsForPlan(ctx sdk.Context, req *v3.QuerySubscriptionsForPlanRequest) (*v3.QuerySubscriptionsForPlanResponse, error)
func (*Keeper) HasAllocation ¶
HasAllocation checks if an allocation for a given ID and address exists in the KVStore.
func (*Keeper) HasSubscriptionForAccount ¶
HasSubscriptionForAccount checks if there is a subscription ID associated with a given account address.
func (*Keeper) HasSubscriptionForPlan ¶
HasSubscriptionForPlan checks if there is a subscription ID associated with a given plan ID.
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
func (*Keeper) IterateAllocationsForSubscription ¶
func (k *Keeper) IterateAllocationsForSubscription(ctx sdk.Context, id uint64, fn func(index int, item v2.Allocation) (stop bool))
IterateAllocationsForSubscription iterates over all allocations for a given subscription ID, calling the provided function for each allocation.
func (*Keeper) IterateSubscriptions ¶
func (k *Keeper) IterateSubscriptions(ctx sdk.Context, fn func(index int, item v3.Subscription) (stop bool))
IterateSubscriptions iterates over all subscriptions in the module's KVStore and calls the provided function for each subscription. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateSubscriptionsForInactiveAt ¶
func (k *Keeper) IterateSubscriptionsForInactiveAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Subscription) (stop bool))
IterateSubscriptionsForInactiveAt iterates over all subscriptions that will be inactive before a specified time and calls the provided function for each subscription. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateSubscriptionsForRenewalAt ¶
func (k *Keeper) IterateSubscriptionsForRenewalAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Subscription) (stop bool))
IterateSubscriptionsForRenewalAt iterates over all subscriptions that will be renewed before a specified time and calls the provided function for each subscription. The iteration stops when the provided function returns 'true'.
func (*Keeper) ProviderStakingShare ¶
func (*Keeper) QuotePriceFunc ¶
func (*Keeper) SendCoin ¶
func (k *Keeper) SendCoin(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, coin sdk.Coin) error
func (*Keeper) SendCoinFromAccountToModule ¶
func (*Keeper) SessionInactivePreHook ¶
SessionInactivePreHook handles the necessary operations when a session becomes inactive.
func (*Keeper) SetAllocation ¶
func (k *Keeper) SetAllocation(ctx sdk.Context, alloc v2.Allocation)
SetAllocation sets the allocation for a given ID and address in the KVStore.
func (*Keeper) SetSession ¶
func (k *Keeper) SetSession(ctx sdk.Context, session sessiontypes.Session)
func (*Keeper) SetSessionForAccount ¶
func (*Keeper) SetSessionForAllocation ¶
func (*Keeper) SetSessionForInactiveAt ¶
func (*Keeper) SetSessionForNode ¶
func (*Keeper) SetSessionForPlanByNode ¶
func (*Keeper) SetSessionForSubscription ¶
func (*Keeper) SetSubscription ¶
func (k *Keeper) SetSubscription(ctx sdk.Context, subscription v3.Subscription)
SetSubscription stores a subscription in the module's KVStore.
func (*Keeper) SetSubscriptionCount ¶
SetSubscriptionCount sets the count value in the KVStore.
func (*Keeper) SetSubscriptionForAccount ¶
SetSubscriptionForAccount links a subscription ID to an account address in the module's KVStore.
func (*Keeper) SetSubscriptionForInactiveAt ¶
SetSubscriptionForInactiveAt sets a subscription to be inactive at a specified time in the module's KVStore.
func (*Keeper) SetSubscriptionForPlan ¶
SetSubscriptionForPlan links a subscription ID to a plan ID in the module's KVStore.
func (*Keeper) SetSubscriptionForRenewalAt ¶
SetSubscriptionForRenewalAt sets a subscription to be renewed at a specified time in the module's KVStore.
func (*Keeper) StatusChangeDelay ¶
StatusChangeDelay returns the delay for status changes from the module's parameters.
func (*Keeper) SubscriptionInactivePendingPreHook ¶
func (*Keeper) WithBankKeeper ¶
func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)
func (*Keeper) WithNodeKeeper ¶
func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
func (*Keeper) WithOracleKeeper ¶
func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper)
func (*Keeper) WithPlanKeeper ¶
func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper)
func (*Keeper) WithProviderKeeper ¶
func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)
func (*Keeper) WithSessionKeeper ¶
func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)