Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NextMonth(date time.Time) time.Time
- type Keeper
- func (k Keeper) AddProjectToSubscription(ctx sdk.Context, consumer string, projectData projectstypes.ProjectData) error
- func (k Keeper) AddTrackedCu(ctx sdk.Context, sub string, provider string, chainID string, cuToAdd uint64, ...) error
- func (k Keeper) CalcTotalMonthlyReward(ctx sdk.Context, totalAmount math.Int, trackedCu uint64, ...) math.Int
- func (k Keeper) ChargeComputeUnitsToSubscription(ctx sdk.Context, consumer string, block, cuAmount uint64) (types.Subscription, error)
- func (k Keeper) CreateSubscription(ctx sdk.Context, creator string, consumer string, planIndex string, ...) error
- func (k Keeper) Current(goCtx context.Context, req *types.QueryCurrentRequest) (*types.QueryCurrentResponse, error)
- func (k Keeper) DelProjectFromSubscription(ctx sdk.Context, consumer, name string) error
- func (k Keeper) ExportCuTrackerTimers(ctx sdk.Context) timertypes.GenesisState
- func (k Keeper) ExportCuTrackers(ctx sdk.Context) fixationtypes.GenesisState
- func (k Keeper) ExportSubscriptions(ctx sdk.Context) fixationtypes.GenesisState
- func (k Keeper) ExportSubscriptionsTimers(ctx sdk.Context) timertypes.GenesisState
- func (k Keeper) GetAllSubTrackedCuIndices(ctx sdk.Context, sub string) []string
- func (k Keeper) GetAllSubscriptionsIndices(ctx sdk.Context) []string
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPlanFromSubscription(ctx sdk.Context, consumer string, block uint64) (planstypes.Plan, error)
- func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, subBlockStr string) (trackedCuList []trackedCuInfo, totalCuTracked uint64)
- func (k Keeper) GetSubscription(ctx sdk.Context, consumer string) (val types.Subscription, found bool)
- func (k Keeper) GetTrackedCu(ctx sdk.Context, sub string, provider string, chainID string, subBlock uint64) (cu uint64, found bool, key string)
- func (k Keeper) InitCuTrackerTimers(ctx sdk.Context, data timertypes.GenesisState)
- func (k Keeper) InitCuTrackers(ctx sdk.Context, gs fixationtypes.GenesisState)
- func (k Keeper) InitSubscriptions(ctx sdk.Context, gs fixationtypes.GenesisState)
- func (k Keeper) InitSubscriptionsTimers(ctx sdk.Context, data timertypes.GenesisState)
- func (k Keeper) List(goCtx context.Context, req *types.QueryListRequest) (*types.QueryListResponse, error)
- func (k Keeper) ListProjects(goCtx context.Context, req *types.QueryListProjectsRequest) (*types.QueryListProjectsResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NextToMonthExpiry(goCtx context.Context, req *types.QueryNextToMonthExpiryRequest) (*types.QueryNextToMonthExpiryResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveExpiredSubscription(ctx sdk.Context, consumer string, block uint64)
- func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes []byte, cuTrackerTimerData []byte)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type Migrator
Constants ¶
const LIMIT_TOKEN_PER_CU = 100
const MONTHS_IN_YEAR = 12
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, epochstorageKeeper types.EpochstorageKeeper, projectsKeeper types.ProjectsKeeper, plansKeeper types.PlansKeeper, dualstakingKeeper types.DualStakingKeeper, fixationStoreKeeper types.FixationStoreKeeper, timerStoreKeeper types.TimerStoreKeeper, ) *Keeper
func (Keeper) AddProjectToSubscription ¶
func (k Keeper) AddProjectToSubscription(ctx sdk.Context, consumer string, projectData projectstypes.ProjectData) error
func (Keeper) AddTrackedCu ¶
func (k Keeper) AddTrackedCu(ctx sdk.Context, sub string, provider string, chainID string, cuToAdd uint64, block uint64) error
AddTrackedCu adds CU to the CU counters in relevant trackedCu entry
func (Keeper) CalcTotalMonthlyReward ¶
func (Keeper) ChargeComputeUnitsToSubscription ¶
func (Keeper) CreateSubscription ¶
func (k Keeper) CreateSubscription( ctx sdk.Context, creator string, consumer string, planIndex string, duration uint64, autoRenewalFlag bool, ) error
CreateSubscription creates a subscription for a consumer
func (Keeper) Current ¶
func (k Keeper) Current(goCtx context.Context, req *types.QueryCurrentRequest) (*types.QueryCurrentResponse, error)
func (Keeper) DelProjectFromSubscription ¶
func (Keeper) ExportCuTrackerTimers ¶
func (k Keeper) ExportCuTrackerTimers(ctx sdk.Context) timertypes.GenesisState
ExportCuTrackerTimers exports CuTracker timers data (for genesis)
func (Keeper) ExportCuTrackers ¶
func (k Keeper) ExportCuTrackers(ctx sdk.Context) fixationtypes.GenesisState
ExportCuTrackers exports CuTrackers data (for genesis)
func (Keeper) ExportSubscriptions ¶
func (k Keeper) ExportSubscriptions(ctx sdk.Context) fixationtypes.GenesisState
ExportSubscriptions exports subscriptions data (for genesis)
func (Keeper) ExportSubscriptionsTimers ¶
func (k Keeper) ExportSubscriptionsTimers(ctx sdk.Context) timertypes.GenesisState
ExportSubscriptionsTimers exports subscriptions timers data (for genesis)
func (Keeper) GetAllSubTrackedCuIndices ¶
GetAllSubTrackedCuIndices gets all the trackedCu entries that are related to a specific subscription
func (Keeper) GetAllSubscriptionsIndices ¶
func (Keeper) GetPlanFromSubscription ¶
func (Keeper) GetSubTrackedCuInfo ¶
func (Keeper) GetSubscription ¶
func (k Keeper) GetSubscription(ctx sdk.Context, consumer string) (val types.Subscription, found bool)
GetSubscription returns the subscription of a given consumer
func (Keeper) GetTrackedCu ¶
func (k Keeper) GetTrackedCu(ctx sdk.Context, sub string, provider string, chainID string, subBlock uint64) (cu uint64, found bool, key string)
GetTrackedCu gets the tracked CU counter (with QoS influence) and the trackedCu entry's block
func (Keeper) InitCuTrackerTimers ¶
func (k Keeper) InitCuTrackerTimers(ctx sdk.Context, data timertypes.GenesisState)
InitCuTrackerTimers imports CuTrackers timers data (from genesis)
func (Keeper) InitCuTrackers ¶
func (k Keeper) InitCuTrackers(ctx sdk.Context, gs fixationtypes.GenesisState)
InitCuTrackers imports CuTracker data (from genesis)
func (Keeper) InitSubscriptions ¶
func (k Keeper) InitSubscriptions(ctx sdk.Context, gs fixationtypes.GenesisState)
InitSubscriptions imports subscriptions data (from genesis)
func (Keeper) InitSubscriptionsTimers ¶
func (k Keeper) InitSubscriptionsTimers(ctx sdk.Context, data timertypes.GenesisState)
InitSubscriptions imports subscriptions timers data (from genesis)
func (Keeper) List ¶
func (k Keeper) List(goCtx context.Context, req *types.QueryListRequest) (*types.QueryListResponse, error)
func (Keeper) ListProjects ¶
func (k Keeper) ListProjects(goCtx context.Context, req *types.QueryListProjectsRequest) (*types.QueryListProjectsResponse, error)
func (Keeper) NextToMonthExpiry ¶
func (k Keeper) NextToMonthExpiry(goCtx context.Context, req *types.QueryNextToMonthExpiryRequest) (*types.QueryNextToMonthExpiryResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveExpiredSubscription ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func (Migrator) Migrate2to3 ¶
Migrate2to3 implements store migration from v2 to v3:
- Convert subscription store to fixation store and use timers
func (Migrator) Migrate3to4 ¶
Migrate3to4 implements store migration from v3 to v4: -- trigger fixation migration (v4->v5), initialize IsLatest field
Source Files ¶
- cu_tracker.go
- grpc_query.go
- grpc_query_current.go
- grpc_query_list.go
- grpc_query_list_projects.go
- grpc_query_next_to_month_expiry.go
- grpc_query_params.go
- keeper.go
- migrations.go
- msg_server.go
- msg_server_add_project.go
- msg_server_auto_renewal.go
- msg_server_buy.go
- msg_server_del_project.go
- params.go
- subscription.go