Documentation
¶
Index ¶
- type Keeper
- func (k *Keeper) BeginBlock(ctx sdk.Context)
- 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) DeleteSessionForInactiveAt(ctx sdk.Context, at time.Time, id 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) ExportGenesis(ctx sdk.Context) *v3.GenesisState
- func (k *Keeper) GetInactiveAt(ctx sdk.Context) time.Time
- func (k *Keeper) GetLatestSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress) (session v3.Session, found bool)
- func (k *Keeper) GetParams(ctx sdk.Context) (v v2.Params)
- func (k *Keeper) GetSession(ctx sdk.Context, id uint64) (session v3.Session, found bool)
- func (k *Keeper) GetSessionCount(ctx sdk.Context) uint64
- func (k *Keeper) GetSessions(ctx sdk.Context) (items []v3.Session)
- func (k *Keeper) GetSessionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items []v3.Session)
- func (k *Keeper) GetSessionsForNode(ctx sdk.Context, addr base.NodeAddress) (items []v3.Session)
- func (k *Keeper) GetSessionsForSubscription(ctx sdk.Context, id uint64) (items []v3.Session)
- func (k *Keeper) HandleMsgCancelSession(ctx sdk.Context, msg *v3.MsgCancelSessionRequest) (*v3.MsgCancelSessionResponse, error)
- func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
- func (k *Keeper) HandleMsgUpdateSession(ctx sdk.Context, msg *v3.MsgUpdateSessionRequest) (*v3.MsgUpdateSessionResponse, error)
- func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v2.QueryParamsRequest) (*v2.QueryParamsResponse, error)
- func (k *Keeper) HandleQuerySession(ctx sdk.Context, req *v3.QuerySessionRequest) (*v3.QuerySessionResponse, error)
- func (k *Keeper) HandleQuerySessions(ctx sdk.Context, req *v3.QuerySessionsRequest) (*v3.QuerySessionsResponse, error)
- func (k *Keeper) HandleQuerySessionsForAccount(ctx sdk.Context, req *v3.QuerySessionsForAccountRequest) (*v3.QuerySessionsForAccountResponse, error)
- func (k *Keeper) HandleQuerySessionsForAllocation(ctx sdk.Context, req *v3.QuerySessionsForAllocationRequest) (*v3.QuerySessionsForAllocationResponse, error)
- func (k *Keeper) HandleQuerySessionsForNode(ctx sdk.Context, req *v3.QuerySessionsForNodeRequest) (*v3.QuerySessionsForNodeResponse, error)
- func (k *Keeper) HandleQuerySessionsForSubscription(ctx sdk.Context, req *v3.QuerySessionsForSubscriptionRequest) (*v3.QuerySessionsForSubscriptionResponse, error)
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
- func (k *Keeper) IterateSessions(ctx sdk.Context, fn func(index int, item v3.Session) (stop bool))
- func (k *Keeper) IterateSessionsForAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress, ...)
- func (k *Keeper) IterateSessionsForInactiveAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Session) (stop bool))
- func (k *Keeper) IterateSessionsForNode(ctx sdk.Context, addr base.NodeAddress, fn func(int, v3.Session) (bool, error)) error
- func (k *Keeper) IterateSessionsForPlanByNode(ctx sdk.Context, id uint64, addr base.NodeAddress, ...) error
- func (k *Keeper) IterateSessionsForSubscription(ctx sdk.Context, id uint64, fn func(int, v3.Session) (bool, error)) error
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) NodeInactivePreHook(ctx sdk.Context, addr base.NodeAddress) error
- func (k *Keeper) PlanUnlinkNodePreHook(ctx sdk.Context, id uint64, addr base.NodeAddress) error
- func (k *Keeper) ProofVerificationEnabled(ctx sdk.Context) bool
- func (k *Keeper) SendCoinFromDepositToAccount(ctx sdk.Context, from, to sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) SendCoinFromDepositToModule(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) SetParams(ctx sdk.Context, params v2.Params)
- func (k *Keeper) SetSession(ctx sdk.Context, session v3.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) 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) VerifySignature(ctx sdk.Context, addr sdk.AccAddress, proof *v3.Proof, signature []byte) error
- func (k *Keeper) WithAccountKeeper(keeper expected.AccountKeeper)
- func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
- func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
- func (k *Keeper) WithSubscriptionKeeper(keeper expected.SubscriptionKeeper)
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 session-related operations.
func (*Keeper) DeleteSession ¶
DeleteSession removes a session from the module's KVStore based on the session ID.
func (*Keeper) DeleteSessionForAccount ¶
DeleteSessionForAccount removes the association between a session ID and an account address from the module's KVStore.
func (*Keeper) DeleteSessionForAllocation ¶
func (k *Keeper) DeleteSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress, sessionID uint64)
DeleteSessionForAllocation removes the association between a session ID, a subscription ID, and an account address from the module's KVStore.
func (*Keeper) DeleteSessionForInactiveAt ¶
DeleteSessionForInactiveAt removes the inactive session record from the module's KVStore based on the specified time and session ID.
func (*Keeper) DeleteSessionForNode ¶
DeleteSessionForNode removes the association between a session ID and a node address from the module's KVStore.
func (*Keeper) DeleteSessionForPlanByNode ¶
func (k *Keeper) DeleteSessionForPlanByNode(ctx sdk.Context, planID uint64, addr base.NodeAddress, sessionID uint64)
DeleteSessionForPlanByNode removes the association between a session ID, a plan ID, and a node address from the module's KVStore.
func (*Keeper) DeleteSessionForSubscription ¶
DeleteSessionForSubscription removes the association between a session ID and a subscription ID from the module's KVStore.
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState
func (*Keeper) GetInactiveAt ¶
GetInactiveAt returns the inactive time by adding StatusChangeDelay to the current block time.
func (*Keeper) GetLatestSessionForAllocation ¶
func (k *Keeper) GetLatestSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress) (session v3.Session, found bool)
GetLatestSessionForAllocation retrieves the latest session for a given subscription ID and account address.
func (*Keeper) GetSession ¶
GetSession retrieves a session from the module's KVStore based on the session ID. If the session exists, it returns the session and 'found' as true; otherwise, it returns 'found' as false.
func (*Keeper) GetSessionCount ¶
GetSessionCount retrieves the count value from the KVStore. If the count value does not exist, it returns 0 as the default.
func (*Keeper) GetSessions ¶
GetSessions retrieves all sessions stored in the module's KVStore.
func (*Keeper) GetSessionsForAccount ¶
GetSessionsForAccount retrieves all sessions associated with a specific account address.
func (*Keeper) GetSessionsForNode ¶
GetSessionsForNode retrieves all sessions associated with a specific node address.
func (*Keeper) GetSessionsForSubscription ¶
GetSessionsForSubscription retrieves all sessions associated with a specific subscription ID.
func (*Keeper) HandleMsgCancelSession ¶
func (k *Keeper) HandleMsgCancelSession(ctx sdk.Context, msg *v3.MsgCancelSessionRequest) (*v3.MsgCancelSessionResponse, error)
func (*Keeper) HandleMsgUpdateParams ¶
func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
func (*Keeper) HandleMsgUpdateSession ¶
func (k *Keeper) HandleMsgUpdateSession(ctx sdk.Context, msg *v3.MsgUpdateSessionRequest) (*v3.MsgUpdateSessionResponse, error)
func (*Keeper) HandleQueryParams ¶
func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v2.QueryParamsRequest) (*v2.QueryParamsResponse, error)
func (*Keeper) HandleQuerySession ¶
func (k *Keeper) HandleQuerySession(ctx sdk.Context, req *v3.QuerySessionRequest) (*v3.QuerySessionResponse, error)
func (*Keeper) HandleQuerySessions ¶
func (k *Keeper) HandleQuerySessions(ctx sdk.Context, req *v3.QuerySessionsRequest) (*v3.QuerySessionsResponse, error)
func (*Keeper) HandleQuerySessionsForAccount ¶
func (k *Keeper) HandleQuerySessionsForAccount(ctx sdk.Context, req *v3.QuerySessionsForAccountRequest) (*v3.QuerySessionsForAccountResponse, error)
func (*Keeper) HandleQuerySessionsForAllocation ¶
func (k *Keeper) HandleQuerySessionsForAllocation(ctx sdk.Context, req *v3.QuerySessionsForAllocationRequest) (*v3.QuerySessionsForAllocationResponse, error)
func (*Keeper) HandleQuerySessionsForNode ¶
func (k *Keeper) HandleQuerySessionsForNode(ctx sdk.Context, req *v3.QuerySessionsForNodeRequest) (*v3.QuerySessionsForNodeResponse, error)
func (*Keeper) HandleQuerySessionsForSubscription ¶
func (k *Keeper) HandleQuerySessionsForSubscription(ctx sdk.Context, req *v3.QuerySessionsForSubscriptionRequest) (*v3.QuerySessionsForSubscriptionResponse, error)
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
func (*Keeper) IterateSessions ¶
IterateSessions iterates over all sessions stored in the module's KVStore and calls the provided function for each session. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateSessionsForAllocation ¶
func (k *Keeper) IterateSessionsForAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress, fn func(index int, item v3.Session) (stop bool))
IterateSessionsForAllocation iterates over all sessions associated with a specific subscription ID and account address and calls the provided function for each session. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateSessionsForInactiveAt ¶
func (k *Keeper) IterateSessionsForInactiveAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Session) (stop bool))
IterateSessionsForInactiveAt iterates over all sessions that will be inactive before a specified time and calls the provided function for each session. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateSessionsForNode ¶
func (k *Keeper) IterateSessionsForNode(ctx sdk.Context, addr base.NodeAddress, fn func(int, v3.Session) (bool, error)) error
IterateSessionsForNode iterates over all sessions for a specific node and calls the provided function for each session. The iteration stops when the provided function returns 'true' or an error occurs.
func (*Keeper) IterateSessionsForPlanByNode ¶
func (k *Keeper) IterateSessionsForPlanByNode(ctx sdk.Context, id uint64, addr base.NodeAddress, fn func(int, v3.Session) (bool, error)) error
IterateSessionsForPlanByNode iterates over all sessions for a specific plan ID and node address, calling the provided function for each session. The iteration stops when the provided function returns 'true' or an error occurs.
func (*Keeper) IterateSessionsForSubscription ¶
func (k *Keeper) IterateSessionsForSubscription(ctx sdk.Context, id uint64, fn func(int, v3.Session) (bool, error)) error
IterateSessionsForSubscription iterates over all sessions associated with a specific subscription ID and calls the provided function for each session. The iteration stops when the provided function returns 'true' or an error occurs.
func (*Keeper) NodeInactivePreHook ¶
NodeInactivePreHook handles the necessary operations when a node becomes inactive.
func (*Keeper) PlanUnlinkNodePreHook ¶
PlanUnlinkNodePreHook handles the necessary operations when unlinking a node from a plan.
func (*Keeper) ProofVerificationEnabled ¶
ProofVerificationEnabled returns whether proof verification is enabled from the module's parameters.
func (*Keeper) SendCoinFromDepositToAccount ¶
func (*Keeper) SendCoinFromDepositToModule ¶
func (*Keeper) SessionInactivePreHook ¶
func (*Keeper) SetSession ¶
SetSession stores a session in the module's KVStore.
func (*Keeper) SetSessionCount ¶
SetSessionCount sets the count value in the KVStore.
func (*Keeper) SetSessionForAccount ¶
SetSessionForAccount links a session ID to an account address in the module's KVStore.
func (*Keeper) SetSessionForAllocation ¶
func (k *Keeper) SetSessionForAllocation(ctx sdk.Context, subscriptionID uint64, addr sdk.AccAddress, sessionID uint64)
SetSessionForAllocation links a session ID to a subscription ID and an account address in the module's KVStore.
func (*Keeper) SetSessionForInactiveAt ¶
SetSessionForInactiveAt sets a session to be inactive at a specified time in the module's KVStore.
func (*Keeper) SetSessionForNode ¶
SetSessionForNode links a session ID to a node address in the module's KVStore.
func (*Keeper) SetSessionForPlanByNode ¶
func (k *Keeper) SetSessionForPlanByNode(ctx sdk.Context, planID uint64, addr base.NodeAddress, sessionID uint64)
SetSessionForPlanByNode links a session ID to a plan ID and node address in the module's KVStore.
func (*Keeper) SetSessionForSubscription ¶
SetSessionForSubscription links a session ID to a subscription ID in the module's KVStore.
func (*Keeper) StatusChangeDelay ¶
StatusChangeDelay returns the delay for status changes from the module's parameters.
func (*Keeper) SubscriptionInactivePendingPreHook ¶
SubscriptionInactivePendingPreHook handles the necessary operations when a subscription becomes inactive pending.
func (*Keeper) VerifySignature ¶
func (*Keeper) WithAccountKeeper ¶
func (k *Keeper) WithAccountKeeper(keeper expected.AccountKeeper)
func (*Keeper) WithDepositKeeper ¶
func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
func (*Keeper) WithNodeKeeper ¶
func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
func (*Keeper) WithSubscriptionKeeper ¶
func (k *Keeper) WithSubscriptionKeeper(keeper expected.SubscriptionKeeper)