github.com/lino-network/lino@v0.6.11/x/bandwidth/model/bandwidth.go (about)

     1  package model
     2  
     3  import (
     4  	sdk "github.com/cosmos/cosmos-sdk/types"
     5  	linotypes "github.com/lino-network/lino/types"
     6  )
     7  
     8  // BandwidthInfo - stores info about the moving average of mps and max mps
     9  type BandwidthInfo struct {
    10  	GeneralMsgEMA sdk.Dec `json:"general_msg_ema"`
    11  	AppMsgEMA     sdk.Dec `json:"app_msg_ema"`
    12  	MaxMPS        sdk.Dec `json:"max_mps"`
    13  }
    14  
    15  // BlockInfo - stores info about number of tx in last block
    16  type BlockInfo struct {
    17  	TotalMsgSignedByApp  int64          `json:"total_tx_signed_by_app"`
    18  	TotalMsgSignedByUser int64          `json:"total_tx_signed_by_user"`
    19  	CurMsgFee            linotypes.Coin `json:"cur_msg_fee"`
    20  	CurU                 sdk.Dec        `json:"cur_u"`
    21  }
    22  
    23  // AppBandwidthInfo - stores info about each app's bandwidth
    24  type AppBandwidthInfo struct {
    25  	Username           linotypes.AccountKey `json:"username"`
    26  	MaxBandwidthCredit sdk.Dec              `json:"max_bandwidth_credit"`
    27  	CurBandwidthCredit sdk.Dec              `json:"cur_bandwidth_credit"`
    28  	MessagesInCurBlock int64                `json:"messages_in_cur_block"`
    29  	ExpectedMPS        sdk.Dec              `json:"expected_mps"`
    30  	LastRefilledAt     int64                `json:"last_refilled_at"`
    31  }