Documentation ¶
Index ¶
- func ErrAppBandwidthInfoNotFound() sdk.Error
- func ErrBandwidthInfoNotFound() sdk.Error
- func ErrBlockInfoNotFound() sdk.Error
- func GetAppBandwidthInfoKey(accKey linotypes.AccountKey) []byte
- func GetBandwidthInfoKey() []byte
- func GetBlockInfoKey() []byte
- type AppBandwidthInfo
- type BandwidthInfo
- type BandwidthStorage
- func (bs BandwidthStorage) DoesAppBandwidthInfoExist(ctx sdk.Context, accKey linotypes.AccountKey) bool
- func (bs BandwidthStorage) GetAllAppBandwidthInfo(ctx sdk.Context) ([]*AppBandwidthInfo, sdk.Error)
- func (bs BandwidthStorage) GetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey) (*AppBandwidthInfo, sdk.Error)
- func (bs BandwidthStorage) GetBandwidthInfo(ctx sdk.Context) (*BandwidthInfo, sdk.Error)
- func (bs BandwidthStorage) GetBlockInfo(ctx sdk.Context) (*BlockInfo, sdk.Error)
- func (bs BandwidthStorage) SetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey, info *AppBandwidthInfo) sdk.Error
- func (bs BandwidthStorage) SetBandwidthInfo(ctx sdk.Context, info *BandwidthInfo) sdk.Error
- func (bs BandwidthStorage) SetBlockInfo(ctx sdk.Context, info *BlockInfo) sdk.Error
- type BlockInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrAppBandwidthInfoNotFound ¶
ErrAppBandwidthInfoNotFound - error if app bandwidth info is not found
func ErrBandwidthInfoNotFound ¶
ErrBandwidthInfoNotFound - error if bandwidth info is not found
func ErrBlockInfoNotFound ¶
ErrBlockInfoNotFound - error if last block info is not found
func GetAppBandwidthInfoKey ¶
func GetAppBandwidthInfoKey(accKey linotypes.AccountKey) []byte
GetAppBandwidthInfoKey - "app bandwidth substore" + "username"
func GetBandwidthInfoKey ¶
func GetBandwidthInfoKey() []byte
func GetBlockInfoKey ¶
func GetBlockInfoKey() []byte
Types ¶
type AppBandwidthInfo ¶
type AppBandwidthInfo struct { Username linotypes.AccountKey `json:"username"` MaxBandwidthCredit sdk.Dec `json:"max_bandwidth_credit"` CurBandwidthCredit sdk.Dec `json:"cur_bandwidth_credit"` MessagesInCurBlock int64 `json:"messages_in_cur_block"` ExpectedMPS sdk.Dec `json:"expected_mps"` LastRefilledAt int64 `json:"last_refilled_at"` }
AppBandwidthInfo - stores info about each app's bandwidth
type BandwidthInfo ¶
type BandwidthInfo struct { GeneralMsgEMA sdk.Dec `json:"general_msg_ema"` AppMsgEMA sdk.Dec `json:"app_msg_ema"` MaxMPS sdk.Dec `json:"max_mps"` }
BandwidthInfo - stores info about the moving average of mps and max mps
type BandwidthStorage ¶
type BandwidthStorage struct {
// contains filtered or unexported fields
}
BandwidthStorage - bandwidth storage
func NewBandwidthStorage ¶
func NewBandwidthStorage(key sdk.StoreKey) BandwidthStorage
func (BandwidthStorage) DoesAppBandwidthInfoExist ¶
func (bs BandwidthStorage) DoesAppBandwidthInfoExist(ctx sdk.Context, accKey linotypes.AccountKey) bool
func (BandwidthStorage) GetAllAppBandwidthInfo ¶
func (bs BandwidthStorage) GetAllAppBandwidthInfo(ctx sdk.Context) ([]*AppBandwidthInfo, sdk.Error)
GetAllAppBandwidthInfo
func (BandwidthStorage) GetAppBandwidthInfo ¶
func (bs BandwidthStorage) GetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey) (*AppBandwidthInfo, sdk.Error)
func (BandwidthStorage) GetBandwidthInfo ¶
func (bs BandwidthStorage) GetBandwidthInfo(ctx sdk.Context) (*BandwidthInfo, sdk.Error)
GetBandwidthInfo - returns bandwidth info, returns error otherwise.
func (BandwidthStorage) GetBlockInfo ¶
GetBlockInfo - returns cur block info, returns error otherwise.
func (BandwidthStorage) SetAppBandwidthInfo ¶
func (bs BandwidthStorage) SetAppBandwidthInfo(ctx sdk.Context, accKey linotypes.AccountKey, info *AppBandwidthInfo) sdk.Error
func (BandwidthStorage) SetBandwidthInfo ¶
func (bs BandwidthStorage) SetBandwidthInfo(ctx sdk.Context, info *BandwidthInfo) sdk.Error
SetBandwidthInfo - sets bandwidth info, returns error if any.
func (BandwidthStorage) SetBlockInfo ¶
SetBlockInfo - sets cur block info, returns error if any.