func (bs BandwidthStorage) GetBlockInfo(ctx sdk.Context) (*BlockInfo, sdk.Error) {
	store := ctx.KVStore(bs.key)
	infoByte := store.Get(GetBlockInfoKey())
	if infoByte == nil {
		return nil, ErrBlockInfoNotFound()
	}
	info := new(BlockInfo)
	bs.cdc.MustUnmarshalBinaryLengthPrefixed(infoByte, info)
	return info, nil
}
GetBlockInfo - returns cur block info, returns error otherwise.
package model
import (
	wire "github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	linotypes "github.com/lino-network/lino/types"
)
var (
	bandwidthInfoSubstore = []byte{0x00}
	blockInfoSubstore     = []byte{0x01}
	appBandwidthSubstore  = []byte{0x02}
)
type BandwidthStorage struct {
	key sdk.StoreKey
	cdc *wire.Codec
}
func NewBandwidthStorage(key sdk.StoreKey) BandwidthStorage {
	cdc := wire.New()
	wire.RegisterCrypto(cdc)
	return BandwidthStorage{
		key: key,
		cdc: cdc,
	}
}
func (bs BandwidthStorage) GetBandwidthInfo(ctx sdk.Context) (*BandwidthInfo, sdk.Error) {
	store := ctx.KVStore(bs.key)
	infoByte := store.Get(GetBandwidthInfoKey())
	if infoByte == nil {
		return nil, ErrBandwidthInfoNotFound()
	}
	info := new(BandwidthInfo)
	bs.cdc.MustUnmarshalBinaryLengthPrefixed(infoByte, info)
	return info, nil
}
func (bs BandwidthStorage) SetBandwidthInfo(ctx sdk.Context, info *BandwidthInfo) sdk.Error {
	store := ctx.KVStore(bs.key)
	infoByte := bs.cdc.MustMarshalBinaryLengthPrefixed(*info)
	store.Set(GetBandwidthInfoKey(), infoByte)
	return nil
}