Documentation
¶
Index ¶
- type Keeper
- func (k *Keeper) ActiveDuration(ctx sdk.Context) time.Duration
- func (k *Keeper) AddDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) BeginBlock(ctx sdk.Context)
- func (k *Keeper) DeleteActiveNode(ctx sdk.Context, addr base.NodeAddress)
- func (k *Keeper) DeleteInactiveNode(ctx sdk.Context, addr base.NodeAddress)
- func (k *Keeper) DeleteNodeForInactiveAt(ctx sdk.Context, at time.Time, addr base.NodeAddress)
- func (k *Keeper) DeleteNodeForPlan(ctx sdk.Context, id uint64, addr base.NodeAddress)
- func (k *Keeper) DeleteSession(ctx sdk.Context, id uint64)
- func (k *Keeper) DeleteSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) DeleteSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)
- func (k *Keeper) Deposit(ctx sdk.Context) sdk.Coin
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState
- func (k *Keeper) FundCommunityPool(ctx sdk.Context, fromAddr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) GetActiveNode(ctx sdk.Context, addr base.NodeAddress) (v v3.Node, found bool)
- func (k *Keeper) GetInactiveAt(ctx sdk.Context) time.Time
- func (k *Keeper) GetInactiveNode(ctx sdk.Context, addr base.NodeAddress) (v v3.Node, found bool)
- func (k *Keeper) GetNode(ctx sdk.Context, addr base.NodeAddress) (node v3.Node, found bool)
- func (k *Keeper) GetNodes(ctx sdk.Context) (items []v3.Node)
- func (k *Keeper) GetNodesForPlan(ctx sdk.Context, id uint64) (items []v3.Node)
- func (k *Keeper) GetParams(ctx sdk.Context) (v v3.Params)
- 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) HandleMsgRegisterNode(ctx sdk.Context, msg *v3.MsgRegisterNodeRequest) (*v3.MsgRegisterNodeResponse, error)
- func (k *Keeper) HandleMsgStartSession(ctx sdk.Context, msg *v3.MsgStartSessionRequest) (*v3.MsgStartSessionResponse, error)
- func (k *Keeper) HandleMsgUpdateNodeDetails(ctx sdk.Context, msg *v3.MsgUpdateNodeDetailsRequest) (*v3.MsgUpdateNodeDetailsResponse, error)
- func (k *Keeper) HandleMsgUpdateNodeStatus(ctx sdk.Context, msg *v3.MsgUpdateNodeStatusRequest) (*v3.MsgUpdateNodeStatusResponse, error)
- func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
- func (k *Keeper) HandleQueryNode(ctx sdk.Context, req *v3.QueryNodeRequest) (*v3.QueryNodeResponse, error)
- func (k *Keeper) HandleQueryNodes(ctx sdk.Context, req *v3.QueryNodesRequest) (res *v3.QueryNodesResponse, err error)
- func (k *Keeper) HandleQueryNodesForPlan(ctx sdk.Context, req *v3.QueryNodesForPlanRequest) (*v3.QueryNodesForPlanResponse, error)
- func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v3.QueryParamsRequest) (*v3.QueryParamsResponse, error)
- func (k *Keeper) HasActiveNode(ctx sdk.Context, addr base.NodeAddress) bool
- func (k *Keeper) HasInactiveNode(ctx sdk.Context, addr base.NodeAddress) bool
- func (k *Keeper) HasNode(ctx sdk.Context, addr base.NodeAddress) bool
- func (k *Keeper) HasNodeForPlan(ctx sdk.Context, id uint64, addr base.NodeAddress) bool
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
- func (k *Keeper) IsValidGigabytePrices(ctx sdk.Context, prices v1base.Prices) bool
- func (k *Keeper) IsValidHourlyPrices(ctx sdk.Context, prices v1base.Prices) bool
- func (k *Keeper) IsValidSessionGigabytes(ctx sdk.Context, gigabytes int64) bool
- func (k *Keeper) IsValidSessionHours(ctx sdk.Context, hours int64) bool
- func (k *Keeper) IterateNodes(ctx sdk.Context, fn func(index int, item v3.Node) (stop bool))
- func (k *Keeper) IterateNodesForInactiveAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Node) (stop bool))
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) MaxSessionGigabytes(ctx sdk.Context) int64
- func (k *Keeper) MaxSessionHours(ctx sdk.Context) int64
- func (k *Keeper) MinGigabytePrices(ctx sdk.Context) v1base.Prices
- func (k *Keeper) MinHourlyPrices(ctx sdk.Context) v1base.Prices
- func (k *Keeper) MinSessionGigabytes(ctx sdk.Context) int64
- func (k *Keeper) MinSessionHours(ctx sdk.Context) int64
- func (k *Keeper) NodeInactivePreHook(ctx sdk.Context, addr base.NodeAddress) error
- func (k *Keeper) QuotePriceFunc(ctx sdk.Context, price sdk.DecCoin) (sdk.Coin, error)
- func (k *Keeper) SendCoinFromDepositToAccount(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) SendCoinFromDepositToModule(ctx sdk.Context, fromAddr sdk.AccAddress, toModule string, coin sdk.Coin) error
- func (k *Keeper) SessionInactivePreHook(ctx sdk.Context, id uint64) error
- func (k *Keeper) SetActiveNode(ctx sdk.Context, node v3.Node)
- func (k *Keeper) SetInactiveNode(ctx sdk.Context, node v3.Node)
- func (k *Keeper) SetNode(ctx sdk.Context, node v3.Node)
- func (k *Keeper) SetNodeForInactiveAt(ctx sdk.Context, at time.Time, addr base.NodeAddress)
- func (k *Keeper) SetNodeForPlan(ctx sdk.Context, id uint64, addr base.NodeAddress)
- func (k *Keeper) SetParams(ctx sdk.Context, params v3.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) SetSessionForInactiveAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) SetSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64)
- func (k *Keeper) StakingShare(ctx sdk.Context) sdkmath.LegacyDec
- func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore
- func (k *Keeper) SubtractDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) UpdateSessionMaxValues(_ sdk.Context, session sessiontypes.Session) error
- func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
- func (k *Keeper) WithDistributionKeeper(keeper expected.DistributionKeeper)
- func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper)
- func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper)
- 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) ActiveDuration ¶
ActiveDuration retrieves the active duration parameter from the module's parameters.
func (*Keeper) AddDeposit ¶
func (*Keeper) BeginBlock ¶
BeginBlock is called at the beginning of each block to handle node-related operations.
func (*Keeper) DeleteActiveNode ¶
func (k *Keeper) DeleteActiveNode(ctx sdk.Context, addr base.NodeAddress)
DeleteActiveNode removes an active node from the module's KVStore based on the node address.
func (*Keeper) DeleteInactiveNode ¶
func (k *Keeper) DeleteInactiveNode(ctx sdk.Context, addr base.NodeAddress)
DeleteInactiveNode removes an inactive node from the module's KVStore based on the node address.
func (*Keeper) DeleteNodeForInactiveAt ¶
DeleteNodeForInactiveAt removes a node's inactivity timestamp from the module's KVStore.
func (*Keeper) DeleteNodeForPlan ¶
DeleteNodeForPlan removes a node associated with a plan from the module's KVStore based on the plan ID and node address.
func (*Keeper) DeleteSessionForAccount ¶
func (*Keeper) DeleteSessionForNode ¶
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState
func (*Keeper) FundCommunityPool ¶
func (*Keeper) GetActiveNode ¶
GetActiveNode retrieves an active node from the module's KVStore based on the node address. If the active node exists, it returns the node and 'found' as true; otherwise, it returns 'found' as false.
func (*Keeper) GetInactiveAt ¶
GetInactiveAt returns the inactive time by adding ActiveDuration to the current block time.
func (*Keeper) GetInactiveNode ¶
GetInactiveNode retrieves an inactive node from the module's KVStore based on the node address. If the inactive node exists, it returns the node and 'found' as true; otherwise, it returns 'found' as false.
func (*Keeper) GetNode ¶
GetNode retrieves a node from the module's KVStore based on the node address. It checks both active and inactive nodes and returns the node if found.
func (*Keeper) GetNodesForPlan ¶
GetNodesForPlan retrieves all nodes associated with a plan stored in the module's KVStore based on the plan ID.
func (*Keeper) GetParams ¶
GetParams retrieves the node module parameters from the module's KVStore.
func (*Keeper) GetSession ¶
func (*Keeper) GetSessionInactiveAt ¶
func (*Keeper) HandleMsgRegisterNode ¶
func (k *Keeper) HandleMsgRegisterNode(ctx sdk.Context, msg *v3.MsgRegisterNodeRequest) (*v3.MsgRegisterNodeResponse, error)
func (*Keeper) HandleMsgStartSession ¶
func (k *Keeper) HandleMsgStartSession(ctx sdk.Context, msg *v3.MsgStartSessionRequest) (*v3.MsgStartSessionResponse, error)
func (*Keeper) HandleMsgUpdateNodeDetails ¶
func (k *Keeper) HandleMsgUpdateNodeDetails(ctx sdk.Context, msg *v3.MsgUpdateNodeDetailsRequest) (*v3.MsgUpdateNodeDetailsResponse, error)
func (*Keeper) HandleMsgUpdateNodeStatus ¶
func (k *Keeper) HandleMsgUpdateNodeStatus(ctx sdk.Context, msg *v3.MsgUpdateNodeStatusRequest) (*v3.MsgUpdateNodeStatusResponse, error)
func (*Keeper) HandleMsgUpdateParams ¶
func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v3.MsgUpdateParamsRequest) (*v3.MsgUpdateParamsResponse, error)
func (*Keeper) HandleQueryNode ¶
func (k *Keeper) HandleQueryNode(ctx sdk.Context, req *v3.QueryNodeRequest) (*v3.QueryNodeResponse, error)
func (*Keeper) HandleQueryNodes ¶
func (k *Keeper) HandleQueryNodes(ctx sdk.Context, req *v3.QueryNodesRequest) (res *v3.QueryNodesResponse, err error)
func (*Keeper) HandleQueryNodesForPlan ¶
func (k *Keeper) HandleQueryNodesForPlan(ctx sdk.Context, req *v3.QueryNodesForPlanRequest) (*v3.QueryNodesForPlanResponse, error)
func (*Keeper) HandleQueryParams ¶
func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v3.QueryParamsRequest) (*v3.QueryParamsResponse, error)
func (*Keeper) HasActiveNode ¶
HasActiveNode checks if an active node exists in the module's KVStore based on the node address.
func (*Keeper) HasInactiveNode ¶
HasInactiveNode checks if an inactive node exists in the module's KVStore based on the node address.
func (*Keeper) HasNode ¶
HasNode checks if a node exists in the module's KVStore based on the node address.
func (*Keeper) HasNodeForPlan ¶
HasNodeForPlan checks if a node associated with a plan exists in the module's KVStore based on the plan ID and node address.
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)
func (*Keeper) IsValidGigabytePrices ¶
IsValidGigabytePrices checks if the provided gigabyte prices are valid based on the minimum prices defined in the module's parameters.
func (*Keeper) IsValidHourlyPrices ¶
IsValidHourlyPrices checks if the provided hourly prices are valid based on the minimum prices defined in the module's parameters.
func (*Keeper) IsValidSessionGigabytes ¶
IsValidSessionGigabytes checks if the provided session gigabytes are within the valid range defined by the module's parameters.
func (*Keeper) IsValidSessionHours ¶
IsValidSessionHours checks if the provided session hours are within the valid range defined by the module's parameters.
func (*Keeper) IterateNodes ¶
IterateNodes iterates over all nodes stored in the module's KVStore and calls the provided function for each node. The iteration stops when the provided function returns 'true'.
func (*Keeper) IterateNodesForInactiveAt ¶
func (k *Keeper) IterateNodesForInactiveAt(ctx sdk.Context, at time.Time, fn func(index int, item v3.Node) (stop bool))
IterateNodesForInactiveAt iterates over all nodes with inactivity timestamps stored in the module's KVStore and calls the provided function for each node. The iteration stops when the provided function returns 'true'.
func (*Keeper) MaxSessionGigabytes ¶
MaxSessionGigabytes retrieves the maximum session gigabytes parameter from the module's parameters.
func (*Keeper) MaxSessionHours ¶
MaxSessionHours retrieves the maximum session hours parameter from the module's parameters.
func (*Keeper) MinGigabytePrices ¶
MinGigabytePrices retrieves the minimum gigabyte prices parameter from the module's parameters.
func (*Keeper) MinHourlyPrices ¶
MinHourlyPrices retrieves the minimum hourly prices parameter from the module's parameters.
func (*Keeper) MinSessionGigabytes ¶
MinSessionGigabytes retrieves the minimum session gigabytes parameter from the module's parameters.
func (*Keeper) MinSessionHours ¶
MinSessionHours retrieves the minimum session hours parameter from the module's parameters.
func (*Keeper) NodeInactivePreHook ¶
func (*Keeper) QuotePriceFunc ¶
func (*Keeper) SendCoinFromDepositToAccount ¶
func (*Keeper) SendCoinFromDepositToModule ¶
func (*Keeper) SessionInactivePreHook ¶
SessionInactivePreHook handles operations when a session transitions to the inactive state.
func (*Keeper) SetActiveNode ¶
SetActiveNode stores an active node in the module's KVStore.
func (*Keeper) SetInactiveNode ¶
SetInactiveNode stores an inactive node in the module's KVStore.
func (*Keeper) SetNode ¶
SetNode stores a node in the module's KVStore based on its status (active or inactive).
func (*Keeper) SetNodeForInactiveAt ¶
SetNodeForInactiveAt stores a node's inactivity timestamp in the module's KVStore.
func (*Keeper) SetNodeForPlan ¶
SetNodeForPlan stores a node associated with a plan in the module's KVStore.
func (*Keeper) SetSession ¶
func (k *Keeper) SetSession(ctx sdk.Context, session sessiontypes.Session)
func (*Keeper) SetSessionForAccount ¶
func (*Keeper) SetSessionForInactiveAt ¶
func (*Keeper) SetSessionForNode ¶
func (*Keeper) StakingShare ¶
StakingShare retrieves the staking share parameter from the module's parameters.
func (*Keeper) SubtractDeposit ¶
func (*Keeper) UpdateSessionMaxValues ¶
UpdateSessionMaxValues checks the session type and updates its values if needed.
func (*Keeper) WithDepositKeeper ¶
func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
func (*Keeper) WithDistributionKeeper ¶
func (k *Keeper) WithDistributionKeeper(keeper expected.DistributionKeeper)
func (*Keeper) WithLeaseKeeper ¶
func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper)
func (*Keeper) WithOracleKeeper ¶
func (k *Keeper) WithOracleKeeper(keeper expected.OracleKeeper)
func (*Keeper) WithSessionKeeper ¶
func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)