Documentation ¶
Index ¶
- Variables
- type BandwidthManager
- func (bm BandwidthManager) AddMsgSignedByApp(ctx sdk.Context, accKey linotypes.AccountKey, num int64) sdk.Error
- func (bm BandwidthManager) AddMsgSignedByUser(ctx sdk.Context, num int64) sdk.Error
- func (bm BandwidthManager) BeginBlocker(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) CalculateCurMsgFee(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) CalculateCurU(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) CheckBandwidth(ctx sdk.Context, addr sdk.AccAddress, fee auth.StdFee) sdk.Error
- func (bm BandwidthManager) ClearBlockInfo(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) ConsumeBandwidthCredit(ctx sdk.Context, u sdk.Dec, p sdk.Dec, accKey linotypes.AccountKey) sdk.Error
- func (bm BandwidthManager) DecayMaxMPS(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) EndBlocker(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) GetAllAppInfo(ctx sdk.Context) ([]*model.AppBandwidthInfo, sdk.Error)
- func (bm BandwidthManager) GetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey) (*model.AppBandwidthInfo, sdk.Error)
- func (bm BandwidthManager) GetBandwidthCostPerMsg(ctx sdk.Context, u sdk.Dec, p sdk.Dec) sdk.Dec
- func (bm BandwidthManager) GetBandwidthInfo(ctx sdk.Context) (*model.BandwidthInfo, sdk.Error)
- func (bm BandwidthManager) GetBlockInfo(ctx sdk.Context) (*model.BlockInfo, sdk.Error)
- func (bm BandwidthManager) GetPunishmentCoeff(ctx sdk.Context, accKey linotypes.AccountKey) (sdk.Dec, sdk.Error)
- func (bm BandwidthManager) InitGenesis(ctx sdk.Context) error
- func (bm BandwidthManager) IsUserMsgFeeEnough(ctx sdk.Context, fee auth.StdFee) bool
- func (bm BandwidthManager) PrecheckAndConsumeBandwidthCredit(ctx sdk.Context, accKey linotypes.AccountKey) sdk.Error
- func (bm BandwidthManager) ReCalculateAppBandwidthInfo(ctx sdk.Context) sdk.Error
- func (bm BandwidthManager) RefillAppBandwidthCredit(ctx sdk.Context, accKey linotypes.AccountKey) sdk.Error
- func (bm BandwidthManager) UpdateMaxMPSAndEMA(ctx sdk.Context) sdk.Error
Constants ¶
This section is empty.
Variables ¶
View Source
var BandwidthManagerTestMode bool = false
Functions ¶
This section is empty.
Types ¶
type BandwidthManager ¶
type BandwidthManager struct {
// contains filtered or unexported fields
}
BandwidthManager - bandwidth manager
func NewBandwidthManager ¶
func NewBandwidthManager(key sdk.StoreKey, holder param.ParamKeeper, gm global.GlobalKeeper, vm vote.VoteKeeper, dm developer.DeveloperKeeper, am account.AccountKeeper) *BandwidthManager
func (BandwidthManager) AddMsgSignedByApp ¶
func (bm BandwidthManager) AddMsgSignedByApp(ctx sdk.Context, accKey linotypes.AccountKey, num int64) sdk.Error
func (BandwidthManager) AddMsgSignedByUser ¶
func (BandwidthManager) BeginBlocker ¶
func (bm BandwidthManager) BeginBlocker(ctx sdk.Context) sdk.Error
func (BandwidthManager) CalculateCurMsgFee ¶
func (bm BandwidthManager) CalculateCurMsgFee(ctx sdk.Context) sdk.Error
calcuate the current msg fee based on last block info at the beginning of each block
func (BandwidthManager) CalculateCurU ¶
func (bm BandwidthManager) CalculateCurU(ctx sdk.Context) sdk.Error
calcuate the current vacancy coeef u based on last block info at the beginning of each block
func (BandwidthManager) CheckBandwidth ¶
func (bm BandwidthManager) CheckBandwidth(ctx sdk.Context, addr sdk.AccAddress, fee auth.StdFee) sdk.Error
func (BandwidthManager) ClearBlockInfo ¶
func (bm BandwidthManager) ClearBlockInfo(ctx sdk.Context) sdk.Error
func (BandwidthManager) ConsumeBandwidthCredit ¶
func (BandwidthManager) DecayMaxMPS ¶
func (bm BandwidthManager) DecayMaxMPS(ctx sdk.Context) sdk.Error
func (BandwidthManager) EndBlocker ¶
func (bm BandwidthManager) EndBlocker(ctx sdk.Context) sdk.Error
func (BandwidthManager) GetAllAppInfo ¶
func (bm BandwidthManager) GetAllAppInfo(ctx sdk.Context) ([]*model.AppBandwidthInfo, sdk.Error)
func (BandwidthManager) GetAppBandwidthInfo ¶
func (bm BandwidthManager) GetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey) (*model.AppBandwidthInfo, sdk.Error)
func (BandwidthManager) GetBandwidthCostPerMsg ¶
func (BandwidthManager) GetBandwidthInfo ¶
func (bm BandwidthManager) GetBandwidthInfo(ctx sdk.Context) (*model.BandwidthInfo, sdk.Error)
getter
func (BandwidthManager) GetBlockInfo ¶
func (BandwidthManager) GetPunishmentCoeff ¶
func (bm BandwidthManager) GetPunishmentCoeff(ctx sdk.Context, accKey linotypes.AccountKey) (sdk.Dec, sdk.Error)
func (BandwidthManager) InitGenesis ¶
func (bm BandwidthManager) InitGenesis(ctx sdk.Context) error
InitGenesis - initialize KV Store
func (BandwidthManager) IsUserMsgFeeEnough ¶
func (BandwidthManager) PrecheckAndConsumeBandwidthCredit ¶
func (bm BandwidthManager) PrecheckAndConsumeBandwidthCredit(ctx sdk.Context, accKey linotypes.AccountKey) sdk.Error
func (BandwidthManager) ReCalculateAppBandwidthInfo ¶
func (bm BandwidthManager) ReCalculateAppBandwidthInfo(ctx sdk.Context) sdk.Error
func (BandwidthManager) RefillAppBandwidthCredit ¶
func (bm BandwidthManager) RefillAppBandwidthCredit(ctx sdk.Context, accKey linotypes.AccountKey) sdk.Error
func (BandwidthManager) UpdateMaxMPSAndEMA ¶
func (bm BandwidthManager) UpdateMaxMPSAndEMA(ctx sdk.Context) sdk.Error
calcuate the new EMA at the end of each block
Click to show internal directories.
Click to hide internal directories.