keeper

package
v12.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServiceServer

func NewMsgServiceServer(k Keeper) types.MsgServiceServer

NewMsgServiceServer creates a new instance of `types.MsgServiceServer` using the provided Keeper.

func NewQueryServiceServer

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 storetypes.StoreKey, params paramstypes.Subspace, feeCollectorName string) Keeper

func (*Keeper) AddDeposit

func (k *Keeper) AddDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error

func (*Keeper) BeginBlock

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

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

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

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

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

func (*Keeper) DeletePayout

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

func (*Keeper) DeletePayoutForAccount

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

func (*Keeper) DeletePayoutForAccountByNode

func (k *Keeper) DeletePayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64)

func (*Keeper) DeletePayoutForNextAt

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

func (*Keeper) DeletePayoutForNode

func (k *Keeper) DeletePayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)

func (*Keeper) DeleteSubscription

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

func (*Keeper) DeleteSubscriptionForAccount

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

func (*Keeper) DeleteSubscriptionForInactiveAt

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

func (*Keeper) DeleteSubscriptionForNode

func (k *Keeper) DeleteSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)

func (*Keeper) DeleteSubscriptionForPlan

func (k *Keeper) DeleteSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)

func (*Keeper) EndBlock

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

func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (alloc types.Allocation, found bool)

func (*Keeper) GetAllocationsForSubscription

func (k *Keeper) GetAllocationsForSubscription(ctx sdk.Context, id uint64) (items types.Allocations)

func (*Keeper) GetCount

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

func (*Keeper) GetLatestPayoutForAccountByNode

func (k *Keeper) GetLatestPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress) (payout types.Payout, found bool)

func (*Keeper) GetNode

func (k *Keeper) GetNode(ctx sdk.Context, address hubtypes.NodeAddress) (nodetypes.Node, bool)

func (*Keeper) GetParams

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

func (*Keeper) GetPayout

func (k *Keeper) GetPayout(ctx sdk.Context, id uint64) (payout types.Payout, found bool)

func (*Keeper) GetPayouts

func (k *Keeper) GetPayouts(ctx sdk.Context) (items types.Payouts)

func (*Keeper) GetPlan

func (k *Keeper) GetPlan(ctx sdk.Context, id uint64) (plantypes.Plan, bool)

func (*Keeper) GetSession

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

func (*Keeper) GetSubscription

func (k *Keeper) GetSubscription(ctx sdk.Context, id uint64) (subscription types.Subscription, found bool)

func (*Keeper) GetSubscriptions

func (k *Keeper) GetSubscriptions(ctx sdk.Context) (items types.Subscriptions)

func (*Keeper) GetSubscriptionsForAccount

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 (k *Keeper) GetSubscriptionsForPlan(ctx sdk.Context, id uint64) (items types.Subscriptions)

func (*Keeper) HasAllocation

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

func (*Keeper) HasPayout

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

func (*Keeper) HasSubscriptionForAccount

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

func (*Keeper) HashPayoutForAccount

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

func (*Keeper) HashPayoutForAccountByNode

func (k *Keeper) HashPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64) bool

func (*Keeper) HashPayoutForNode

func (k *Keeper) HashPayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64) bool

func (*Keeper) HashSubscriptionForNode

func (k *Keeper) HashSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64) bool

func (*Keeper) HashSubscriptionForPlan

func (k *Keeper) HashSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64) bool

func (*Keeper) IterateAllocationsForSubscription

func (k *Keeper) IterateAllocationsForSubscription(ctx sdk.Context, id uint64, fn func(index int, item types.Allocation) (stop bool))

func (*Keeper) IteratePayouts

func (k *Keeper) IteratePayouts(ctx sdk.Context, fn func(index int, item types.Payout) (stop bool))

func (*Keeper) IteratePayoutsForNextAt

func (k *Keeper) IteratePayoutsForNextAt(ctx sdk.Context, at time.Time, fn func(index int, item types.Payout) (stop bool))

func (*Keeper) IterateSubscriptions

func (k *Keeper) IterateSubscriptions(ctx sdk.Context, fn func(index int, item types.Subscription) (stop bool))

func (*Keeper) IterateSubscriptionsForInactiveAt

func (k *Keeper) IterateSubscriptionsForInactiveAt(ctx sdk.Context, endTime time.Time, fn func(index int, item types.Subscription) (stop bool))

func (*Keeper) Logger

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

func (*Keeper) SendCoin

func (k *Keeper) SendCoin(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, coin sdk.Coin) error

func (*Keeper) SendCoinFromAccountToModule

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

func (*Keeper) SendCoinFromDepositToAccount

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

func (*Keeper) SendCoinFromDepositToModule

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

func (*Keeper) SessionInactiveHook

func (k *Keeper) SessionInactiveHook(ctx sdk.Context, id uint64, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, utilisedBytes sdkmath.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

func (k *Keeper) SetAllocation(ctx sdk.Context, alloc types.Allocation)

func (*Keeper) SetCount

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

func (*Keeper) SetParams

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

func (*Keeper) SetPayout

func (k *Keeper) SetPayout(ctx sdk.Context, payout types.Payout)

func (*Keeper) SetPayoutForAccount

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

func (*Keeper) SetPayoutForAccountByNode

func (k *Keeper) SetPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress, id uint64)

func (*Keeper) SetPayoutForNextAt

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

func (*Keeper) SetPayoutForNode

func (k *Keeper) SetPayoutForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)

func (*Keeper) SetSubscription

func (k *Keeper) SetSubscription(ctx sdk.Context, subscription types.Subscription)

func (*Keeper) SetSubscriptionForAccount

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

func (*Keeper) SetSubscriptionForInactiveAt

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

func (*Keeper) SetSubscriptionForNode

func (k *Keeper) SetSubscriptionForNode(ctx sdk.Context, addr hubtypes.NodeAddress, id uint64)

func (*Keeper) SetSubscriptionForPlan

func (k *Keeper) SetSubscriptionForPlan(ctx sdk.Context, planID, subscriptionID uint64)

func (*Keeper) StatusChangeDelay

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

func (*Keeper) Store

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

func (*Keeper) SubscriptionInactivePendingHook

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

func (*Keeper) SubtractDeposit

func (k *Keeper) SubtractDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error

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

func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)

func (*Keeper) WithSessionKeeper

func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)

Jump to

Keyboard shortcuts

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