keeper

package
v12.0.0-rc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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

func (k *Keeper) BeginBlock(ctx sdk.Context)

func (*Keeper) DeleteSession

func (k *Keeper) DeleteSession(ctx sdk.Context, id uint64)

DeleteSession removes a session from the module's KVStore based on the session ID.

func (*Keeper) DeleteSessionForAccount

func (k *Keeper) DeleteSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)

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

func (k *Keeper) DeleteSessionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)

DeleteSessionForInactiveAt removes the inactive session record from the module's KVStore based on the specified time and session ID.

func (*Keeper) DeleteSessionForNode

func (k *Keeper) DeleteSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)

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

func (k *Keeper) DeleteSessionForSubscription(ctx sdk.Context, subscriptionID, sessionID uint64)

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) GetCount

func (k *Keeper) GetCount(ctx sdk.Context) uint64

GetCount retrieves the count value from the KVStore. If the count value does not exist, it returns 0 as the default.

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) GetParams

func (k *Keeper) GetParams(ctx sdk.Context) (v v2.Params)

GetParams retrieves the parameters from the module's KVStore.

func (*Keeper) GetSession

func (k *Keeper) GetSession(ctx sdk.Context, id uint64) (session v3.Session, found bool)

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) GetSessions

func (k *Keeper) GetSessions(ctx sdk.Context) (items []v3.Session)

GetSessions retrieves all sessions stored in the module's KVStore.

func (*Keeper) GetSessionsForAccount

func (k *Keeper) GetSessionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items []v3.Session)

GetSessionsForAccount retrieves all sessions associated with a specific account address.

func (*Keeper) GetSessionsForNode

func (k *Keeper) GetSessionsForNode(ctx sdk.Context, addr base.NodeAddress) (items []v3.Session)

GetSessionsForNode retrieves all sessions associated with a specific node address.

func (*Keeper) GetSessionsForSubscription

func (k *Keeper) GetSessionsForSubscription(ctx sdk.Context, id uint64) (items []v3.Session)

GetSessionsForSubscription retrieves all sessions associated with a specific subscription ID.

func (*Keeper) HandleInactiveSession

func (k *Keeper) HandleInactiveSession(ctx sdk.Context, id uint64) error

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) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)

func (*Keeper) IterateSessions

func (k *Keeper) IterateSessions(ctx sdk.Context, fn func(index int, item v3.Session) (stop bool))

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(index int, item v3.Session) (stop bool))

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'.

func (*Keeper) IterateSessionsForPlanByNode

func (k *Keeper) IterateSessionsForPlanByNode(ctx sdk.Context, id uint64, addr base.NodeAddress, fn func(index int, item v3.Session) (stop bool))

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'.

func (*Keeper) IterateSessionsForSubscription

func (k *Keeper) IterateSessionsForSubscription(ctx sdk.Context, id uint64, fn func(index int, item v3.Session) (stop bool))

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'.

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.Context) log.Logger

func (*Keeper) NodeInactivePreHook

func (k *Keeper) NodeInactivePreHook(ctx sdk.Context, addr base.NodeAddress) error

func (*Keeper) PlanUnlinkNodePreHook

func (k *Keeper) PlanUnlinkNodePreHook(ctx sdk.Context, id uint64, addr base.NodeAddress) error

func (*Keeper) ProofVerificationEnabled

func (k *Keeper) ProofVerificationEnabled(ctx sdk.Context) bool

ProofVerificationEnabled returns whether proof verification is enabled from the module's parameters.

func (*Keeper) SendCoinFromDepositToAccount

func (k *Keeper) SendCoinFromDepositToAccount(ctx sdk.Context, from, to sdk.AccAddress, coin sdk.Coin) error

func (*Keeper) SendCoinFromDepositToModule

func (k *Keeper) SendCoinFromDepositToModule(ctx sdk.Context, from sdk.AccAddress, to string, coin sdk.Coin) error

func (*Keeper) SetCount

func (k *Keeper) SetCount(ctx sdk.Context, count uint64)

SetCount sets the count value in the KVStore.

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx sdk.Context, params v2.Params)

SetParams stores the parameters for the module in the KVStore.

func (*Keeper) SetSession

func (k *Keeper) SetSession(ctx sdk.Context, session v3.Session)

SetSession stores a session in the module's KVStore.

func (*Keeper) SetSessionForAccount

func (k *Keeper) SetSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)

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

func (k *Keeper) SetSessionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)

SetSessionForInactiveAt sets a session to be inactive at a specified time in the module's KVStore.

func (*Keeper) SetSessionForNode

func (k *Keeper) SetSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)

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

func (k *Keeper) SetSessionForSubscription(ctx sdk.Context, subscriptionID, sessionID uint64)

SetSessionForSubscription links a session ID to a subscription ID in the module's KVStore.

func (*Keeper) StatusChangeDelay

func (k *Keeper) StatusChangeDelay(ctx sdk.Context) time.Duration

StatusChangeDelay returns the delay for status changes from the module's parameters.

func (*Keeper) Store

func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore

func (*Keeper) SubscriptionInactivePendingPreHook

func (k *Keeper) SubscriptionInactivePendingPreHook(ctx sdk.Context, id uint64) error

func (*Keeper) VerifySignature

func (k *Keeper) VerifySignature(ctx sdk.Context, addr sdk.AccAddress, proof *v3.Proof, signature []byte) error

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL