manager

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 (BandwidthManager) AddMsgSignedByApp

func (bm BandwidthManager) AddMsgSignedByApp(ctx sdk.Context, accKey linotypes.AccountKey, num int64) sdk.Error

func (BandwidthManager) AddMsgSignedByUser

func (bm BandwidthManager) AddMsgSignedByUser(ctx sdk.Context, num int64) sdk.Error

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 (bm BandwidthManager) ConsumeBandwidthCredit(ctx sdk.Context, u sdk.Dec, p sdk.Dec, accKey linotypes.AccountKey) sdk.Error

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 (bm BandwidthManager) GetBandwidthCostPerMsg(ctx sdk.Context, u sdk.Dec, p sdk.Dec) sdk.Dec

func (BandwidthManager) GetBandwidthInfo

func (bm BandwidthManager) GetBandwidthInfo(ctx sdk.Context) (*model.BandwidthInfo, sdk.Error)

getter

func (BandwidthManager) GetBlockInfo

func (bm BandwidthManager) GetBlockInfo(ctx sdk.Context) (*model.BlockInfo, sdk.Error)

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 (bm BandwidthManager) IsUserMsgFeeEnough(ctx sdk.Context, fee auth.StdFee) bool

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

Jump to

Keyboard shortcuts

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