Documentation ¶
Index ¶
- func NewMsgServiceServer(k Keeper) types.MsgServiceServer
- func NewQueryServiceServer(keeper Keeper) types.QueryServiceServer
- type Keeper
- func (k *Keeper) AddDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) BeginBlock(ctx sdk.Context)
- func (k *Keeper) CreateSubscriptionForNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, ...) (*types.NodeSubscription, error)
- func (k *Keeper) CreateSubscriptionForPlan(ctx sdk.Context, accAddr sdk.AccAddress, id uint64, denom string) (*types.PlanSubscription, error)
- func (k *Keeper) DeleteAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress)
- func (k *Keeper) DeletePayout(ctx sdk.Context, id uint64)
- func (k *Keeper) DeletePayoutForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) DeletePayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, ...)
- func (k *Keeper) DeletePayoutForNextAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) DeletePayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id 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) DeleteSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)
- func (k *Keeper) DeleteSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)
- func (k *Keeper) EndBlock(ctx sdk.Context) []abcitypes.ValidatorUpdate
- func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (alloc types.Allocation, found bool)
- func (k *Keeper) GetAllocationsForSubscription(ctx sdk.Context, id uint64) (items types.Allocations)
- func (k *Keeper) GetCount(ctx sdk.Context) uint64
- func (k *Keeper) GetLatestPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress) (payout types.Payout, found bool)
- func (k *Keeper) GetNode(ctx sdk.Context, address hubtypes.NodeAddress) (nodetypes.Node, bool)
- func (k *Keeper) GetParams(ctx sdk.Context) types.Params
- func (k *Keeper) GetPayout(ctx sdk.Context, id uint64) (payout types.Payout, found bool)
- func (k *Keeper) GetPayouts(ctx sdk.Context) (items types.Payouts)
- 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) GetSubscription(ctx sdk.Context, id uint64) (subscription types.Subscription, found bool)
- func (k *Keeper) GetSubscriptions(ctx sdk.Context) (items types.Subscriptions)
- func (k *Keeper) GetSubscriptionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items types.Subscriptions)
- func (k *Keeper) GetSubscriptionsForNode(ctx sdk.Context, addr hubtypes.NodeAddress) (items types.Subscriptions)
- func (k *Keeper) GetSubscriptionsForPlan(ctx sdk.Context, id uint64) (items types.Subscriptions)
- func (k *Keeper) HasAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) bool
- func (k *Keeper) HasPayout(ctx sdk.Context, id uint64) bool
- func (k *Keeper) HasSubscriptionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64) bool
- func (k *Keeper) HashPayoutForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64) bool
- func (k *Keeper) HashPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, ...) bool
- func (k *Keeper) HashPayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64) bool
- func (k *Keeper) HashSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64) bool
- func (k *Keeper) HashSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64) bool
- func (k *Keeper) IterateAllocationsForSubscription(ctx sdk.Context, id uint64, ...)
- func (k *Keeper) IteratePayouts(ctx sdk.Context, fn func(index int, item types.Payout) (stop bool))
- func (k *Keeper) IteratePayoutsForNextAt(ctx sdk.Context, at time.Time, ...)
- func (k *Keeper) IterateSubscriptions(ctx sdk.Context, fn func(index int, item types.Subscription) (stop bool))
- func (k *Keeper) IterateSubscriptionsForInactiveAt(ctx sdk.Context, endTime time.Time, ...)
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- 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) 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) SessionInactiveHook(ctx sdk.Context, id uint64, accAddr sdk.AccAddress, ...) error
- func (k *Keeper) SetAllocation(ctx sdk.Context, alloc types.Allocation)
- func (k *Keeper) SetCount(ctx sdk.Context, count uint64)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetPayout(ctx sdk.Context, payout types.Payout)
- func (k *Keeper) SetPayoutForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64)
- func (k *Keeper) SetPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, ...)
- func (k *Keeper) SetPayoutForNextAt(ctx sdk.Context, at time.Time, id uint64)
- func (k *Keeper) SetPayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)
- func (k *Keeper) SetSubscription(ctx sdk.Context, subscription types.Subscription)
- 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) SetSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)
- func (k *Keeper) SetSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)
- func (k *Keeper) StatusChangeDelay(ctx sdk.Context) (duration time.Duration)
- func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore
- func (k *Keeper) SubscriptionInactivePendingHook(ctx sdk.Context, id uint64) error
- func (k *Keeper) SubtractDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error
- func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)
- func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
- func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
- func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper)
- func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)
- func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServiceServer ¶ added in v0.6.0
func NewMsgServiceServer(k Keeper) types.MsgServiceServer
NewMsgServiceServer creates a new instance of `types.MsgServiceServer` using the provided Keeper.
func NewQueryServiceServer ¶ added in v0.6.0
func NewQueryServiceServer(keeper Keeper) types.QueryServiceServer
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, params paramstypes.Subspace, feeCollectorName string) Keeper
func (*Keeper) AddDeposit ¶
func (*Keeper) BeginBlock ¶ added in v0.11.0
BeginBlock is a function that gets called at the beginning of every block. It processes the payouts scheduled to be made and performs the necessary actions accordingly.
func (*Keeper) CreateSubscriptionForNode ¶ added in v0.11.0
func (k *Keeper) CreateSubscriptionForNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, gigabytes, hours int64, denom string) (*types.NodeSubscription, error)
CreateSubscriptionForNode creates a new NodeSubscription for a specific node and account.
func (*Keeper) CreateSubscriptionForPlan ¶ added in v0.11.0
func (k *Keeper) CreateSubscriptionForPlan(ctx sdk.Context, accAddr sdk.AccAddress, id uint64, denom string) (*types.PlanSubscription, error)
CreateSubscriptionForPlan creates a new PlanSubscription for a specific plan and account.
func (*Keeper) DeleteAllocation ¶ added in v0.11.0
func (*Keeper) DeletePayout ¶ added in v0.11.0
func (*Keeper) DeletePayoutForAccount ¶ added in v0.11.0
func (*Keeper) DeletePayoutForAccountByNode ¶ added in v0.11.0
func (k *Keeper) DeletePayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64)
func (*Keeper) DeletePayoutForNextAt ¶ added in v0.11.0
func (*Keeper) DeletePayoutForNode ¶ added in v0.11.0
func (*Keeper) DeleteSubscription ¶ added in v0.9.0
func (*Keeper) DeleteSubscriptionForAccount ¶ added in v0.11.0
func (*Keeper) DeleteSubscriptionForInactiveAt ¶ added in v0.11.0
func (*Keeper) DeleteSubscriptionForNode ¶ added in v0.11.0
func (*Keeper) DeleteSubscriptionForPlan ¶ added in v0.11.0
func (*Keeper) EndBlock ¶ added in v0.11.0
func (k *Keeper) EndBlock(ctx sdk.Context) []abcitypes.ValidatorUpdate
EndBlock is a function that gets called at the end of every block. It processes the subscriptions that have become inactive and performs the necessary actions accordingly.
func (*Keeper) GetAllocation ¶ added in v0.11.0
func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (alloc types.Allocation, found bool)
func (*Keeper) GetAllocationsForSubscription ¶ added in v0.11.0
func (*Keeper) GetLatestPayoutForAccountByNode ¶ added in v0.11.0
func (k *Keeper) GetLatestPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress) (payout types.Payout, found bool)
func (*Keeper) GetPayouts ¶ added in v0.11.0
func (*Keeper) GetSession ¶ added in v0.11.1
func (*Keeper) GetSubscription ¶
func (*Keeper) GetSubscriptions ¶
func (k *Keeper) GetSubscriptions(ctx sdk.Context) (items types.Subscriptions)
func (*Keeper) GetSubscriptionsForAccount ¶ added in v0.11.0
func (k *Keeper) GetSubscriptionsForAccount(ctx sdk.Context, addr sdk.AccAddress) (items types.Subscriptions)
func (*Keeper) GetSubscriptionsForNode ¶
func (k *Keeper) GetSubscriptionsForNode(ctx sdk.Context, addr hubtypes.NodeAddress) (items types.Subscriptions)
func (*Keeper) GetSubscriptionsForPlan ¶
func (*Keeper) HasAllocation ¶ added in v0.11.0
func (*Keeper) HasSubscriptionForAccount ¶ added in v0.11.0
func (*Keeper) HashPayoutForAccount ¶ added in v0.11.0
func (*Keeper) HashPayoutForAccountByNode ¶ added in v0.11.0
func (k *Keeper) HashPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64) bool
func (*Keeper) HashPayoutForNode ¶ added in v0.11.0
func (*Keeper) HashSubscriptionForNode ¶ added in v0.11.0
func (*Keeper) HashSubscriptionForPlan ¶ added in v0.11.0
func (*Keeper) IterateAllocationsForSubscription ¶ added in v0.11.0
func (*Keeper) IteratePayouts ¶ added in v0.11.0
func (*Keeper) IteratePayoutsForNextAt ¶ added in v0.11.0
func (*Keeper) IterateSubscriptions ¶ added in v0.11.0
func (*Keeper) IterateSubscriptionsForInactiveAt ¶ added in v0.11.0
func (*Keeper) SendCoin ¶
func (k *Keeper) SendCoin(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, coin sdk.Coin) error
func (*Keeper) SendCoinFromAccountToModule ¶ added in v0.10.0
func (*Keeper) SendCoinFromDepositToAccount ¶ added in v0.11.0
func (*Keeper) SendCoinFromDepositToModule ¶ added in v0.11.0
func (*Keeper) SessionInactiveHook ¶ added in v0.11.0
func (k *Keeper) SessionInactiveHook(ctx sdk.Context, id uint64, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, utilisedBytes sdk.Int) error
SessionInactiveHook is a function that handles the end of a session. It updates the allocation's utilized bytes, calculates and sends payments, and staking rewards.
func (*Keeper) SetAllocation ¶ added in v0.11.0
func (k *Keeper) SetAllocation(ctx sdk.Context, alloc types.Allocation)
func (*Keeper) SetPayoutForAccount ¶ added in v0.11.0
func (*Keeper) SetPayoutForAccountByNode ¶ added in v0.11.0
func (k *Keeper) SetPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64)
func (*Keeper) SetPayoutForNextAt ¶ added in v0.11.0
func (*Keeper) SetPayoutForNode ¶ added in v0.11.0
func (*Keeper) SetSubscription ¶
func (k *Keeper) SetSubscription(ctx sdk.Context, subscription types.Subscription)
func (*Keeper) SetSubscriptionForAccount ¶ added in v0.11.0
func (*Keeper) SetSubscriptionForInactiveAt ¶ added in v0.11.0
func (*Keeper) SetSubscriptionForNode ¶
func (*Keeper) SetSubscriptionForPlan ¶
func (*Keeper) StatusChangeDelay ¶ added in v0.11.0
func (*Keeper) SubscriptionInactivePendingHook ¶ added in v0.11.0
func (*Keeper) SubtractDeposit ¶
func (*Keeper) WithBankKeeper ¶
func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)
func (*Keeper) WithDepositKeeper ¶
func (k *Keeper) WithDepositKeeper(keeper expected.DepositKeeper)
func (*Keeper) WithNodeKeeper ¶
func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)
func (*Keeper) WithPlanKeeper ¶
func (k *Keeper) WithPlanKeeper(keeper expected.PlanKeeper)
func (*Keeper) WithProviderKeeper ¶ added in v0.10.0
func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)
func (*Keeper) WithSessionKeeper ¶ added in v0.8.0
func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)