Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- 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) AdjustmentIndex(consumer string, provider string) string
- func (k Keeper) AppendAdjustment(ctx sdk.Context, consumer string, provider string, totalConsumerUsage uint64, ...)
- func (k Keeper) CalcTotalMonthlyReward(ctx sdk.Context, totalAmount math.Int, trackedCu uint64, ...) math.Int
- func (k Keeper) CalculateParticipationFees(ctx sdk.Context, reward sdk.Coin) (sdk.Coins, sdk.Coins, error)
- func (k Keeper) ChargeComputeUnitsToSubscription(ctx sdk.Context, consumer string, block, cuAmount uint64) (types.Subscription, error)
- func (k Keeper) CreateFutureSubscription(ctx sdk.Context, creator string, consumer string, planIndex string, ...) 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) EstimatedProviderRewards(goCtx context.Context, req *types.QueryEstimatedProviderRewardsRequest) (*types.QueryEstimatedRewardsResponse, error)
- func (k Keeper) EstimatedRewards(goCtx context.Context, req *types.QueryEstimatedRewardsRequest) (*types.QueryEstimatedRewardsResponse, error)deprecated
- func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.QueryEstimatedValidatorRewardsRequest) (*types.QueryEstimatedValidatorRewardsResponse, error)
- func (k Keeper) ExportCuTrackerTimers(ctx sdk.Context) timerstoretypes.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) timerstoretypes.GenesisState
- func (k Keeper) GetAdjustment(ctx sdk.Context, index string) (val types.Adjustment, found bool)
- func (k Keeper) GetAdjustmentFactorProvider(ctx sdk.Context, adjustments []types.Adjustment) map[string]sdk.Dec
- func (k Keeper) GetAllAdjustment(ctx sdk.Context) (list []types.Adjustment)
- func (k Keeper) GetAllClusters(ctx sdk.Context) []string
- func (k Keeper) GetAllSubTrackedCuIndices(ctx sdk.Context, sub string) []string
- func (k Keeper) GetAllSubscriptionsIndices(ctx sdk.Context) []string
- func (k Keeper) GetConsumerAdjustments(ctx sdk.Context, consumer string) (list []types.Adjustment)
- 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) GetProviderFromAdjustment(adjustment *types.Adjustment) (string, error)
- func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) (trackedCuList []*types.TrackedCuInfo, totalCuTracked uint64)
- func (k Keeper) GetSubTrackedCuInfoForProvider(ctx sdk.Context, sub string, provider string, block uint64) []*types.TrackedCuInfo
- func (k Keeper) GetSubscription(ctx sdk.Context, consumer string) (val types.Subscription, found bool)
- func (k Keeper) GetSubscriptionForBlock(ctx sdk.Context, consumer string, block uint64) (val types.Subscription, entryBlock uint64, 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 timerstoretypes.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 timerstoretypes.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) RemoveAdjustment(ctx sdk.Context, index string)
- func (k Keeper) RemoveConsumerAdjustments(ctx sdk.Context, consumer string)
- func (k Keeper) RemoveExpiredSubscription(ctx sdk.Context, consumer string, block uint64, planIndex string, ...)
- func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes []byte, cuTrackerTimerData []byte)
- func (k Keeper) SetAdjustment(ctx sdk.Context, adjustment types.Adjustment)
- func (k Keeper) SetAllAdjustment(ctx sdk.Context, list []types.Adjustment)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) TrackedUsage(goCtx context.Context, req *types.QuerySubscriptionTrackedUsageRequest) (*types.QuerySubscriptionTrackedUsageResponse, error)
- type Migrator
Constants ¶
const LIMIT_TOKEN_PER_CU = 100
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, rewardsKeeper types.RewardsKeeper, specKeeper types.SpecKeeper, fixationStoreKeeper types.FixationStoreKeeper, timerStoreKeeper types.TimerStoreKeeper, stakingKeeper types.StakingKeeper, ) *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 Also, it counts the IPRPC CU if the subscription is IPRPC eligible
func (Keeper) AdjustmentIndex ¶
func (Keeper) AppendAdjustment ¶
func (Keeper) CalcTotalMonthlyReward ¶
func (Keeper) CalculateParticipationFees ¶
func (k Keeper) CalculateParticipationFees(ctx sdk.Context, reward sdk.Coin) (sdk.Coins, sdk.Coins, error)
wrapper function for calculating the validators and community participation fees
func (Keeper) ChargeComputeUnitsToSubscription ¶
func (Keeper) CreateFutureSubscription ¶
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) EstimatedProviderRewards ¶
func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.QueryEstimatedProviderRewardsRequest) (*types.QueryEstimatedRewardsResponse, error)
func (Keeper) EstimatedRewards
deprecated
func (k Keeper) EstimatedRewards(goCtx context.Context, req *types.QueryEstimatedRewardsRequest) (*types.QueryEstimatedRewardsResponse, error)
Deprecated: backwards compatibility support for the old deprecated version of the EstimatedProviderRewards query
func (Keeper) EstimatedValidatorRewards ¶
func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.QueryEstimatedValidatorRewardsRequest) (*types.QueryEstimatedValidatorRewardsResponse, error)
func (Keeper) ExportCuTrackerTimers ¶
func (k Keeper) ExportCuTrackerTimers(ctx sdk.Context) timerstoretypes.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) timerstoretypes.GenesisState
ExportSubscriptionsTimers exports subscriptions timers data (for genesis)
func (Keeper) GetAdjustment ¶
GetAdjustment returns a Adjustment from its index
func (Keeper) GetAdjustmentFactorProvider ¶
func (Keeper) GetAllAdjustment ¶
func (k Keeper) GetAllAdjustment(ctx sdk.Context) (list []types.Adjustment)
GetAllAdjustment returns all Adjustment
func (Keeper) GetAllSubTrackedCuIndices ¶
GetAllSubTrackedCuIndices gets all the trackedCu entries that are related to a specific subscription
func (Keeper) GetAllSubscriptionsIndices ¶
func (Keeper) GetConsumerAdjustments ¶
func (Keeper) GetPlanFromSubscription ¶
func (Keeper) GetProviderFromAdjustment ¶
func (k Keeper) GetProviderFromAdjustment(adjustment *types.Adjustment) (string, error)
func (Keeper) GetSubTrackedCuInfo ¶
func (Keeper) GetSubTrackedCuInfoForProvider ¶
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) GetSubscriptionForBlock ¶
func (k Keeper) GetSubscriptionForBlock(ctx sdk.Context, consumer string, block uint64) (val types.Subscription, entryBlock uint64, found bool)
GetSubscription returns the subscription of a given consumer in a specific block
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 timerstoretypes.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 timerstoretypes.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) RemoveAdjustment ¶
RemoveAdjustment removes a Adjustment from the store
func (Keeper) RemoveConsumerAdjustments ¶
assumes consumer comes first in the key, when querying by subscription it will catch all
func (Keeper) RemoveExpiredSubscription ¶
func (Keeper) RewardAndResetCuTracker ¶
func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes []byte, cuTrackerTimerData []byte)
remove only before the sub is deleted
func (Keeper) SetAdjustment ¶
func (k Keeper) SetAdjustment(ctx sdk.Context, adjustment types.Adjustment)
SetAdjustment set a specific Adjustment in the store from its index
func (Keeper) SetAllAdjustment ¶
func (k Keeper) SetAllAdjustment(ctx sdk.Context, list []types.Adjustment)
SetAllAdjustment sets all adjustments to the store
func (Keeper) TrackedUsage ¶
func (k Keeper) TrackedUsage(goCtx context.Context, req *types.QuerySubscriptionTrackedUsageRequest) (*types.QuerySubscriptionTrackedUsageResponse, error)
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
Source Files ¶
- adjustment.go
- cluster.go
- cu_tracker.go
- grpc_query.go
- grpc_query_current.go
- grpc_query_estimated_rewards.go
- grpc_query_estimated_validator_rewards.go
- grpc_query_list.go
- grpc_query_list_projects.go
- grpc_query_next_to_month_expiry.go
- grpc_query_params.go
- grpc_query_tracked_usage.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