Documentation ¶
Index ¶
- func ErrInvalidUsage() sdk.Error
- func ErrInvalidUsername() sdk.Error
- func ErrProviderNotFound() sdk.Error
- func NewHandler(im InfraManager) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type InfraManager
- func (im InfraManager) AddToInfraProviderList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (im *InfraManager) ClearUsage(ctx sdk.Context) sdk.Error
- func (im InfraManager) DoesInfraProviderExist(ctx sdk.Context, username types.AccountKey) bool
- func (im *InfraManager) GetInfraProviderList(ctx sdk.Context) (*model.InfraProviderList, sdk.Error)
- func (im *InfraManager) GetUsageWeight(ctx sdk.Context, username types.AccountKey) (sdk.Rat, sdk.Error)
- func (im InfraManager) InitGenesis(ctx sdk.Context) error
- func (im InfraManager) RegisterInfraProvider(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (im InfraManager) RemoveFromProviderList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (im *InfraManager) ReportUsage(ctx sdk.Context, username types.AccountKey, usage int64) sdk.Error
- type ProviderReportMsg
- func (msg ProviderReportMsg) GetConsumeAmount() types.Coin
- func (msg ProviderReportMsg) GetPermission() types.Permission
- func (msg ProviderReportMsg) GetSignBytes() []byte
- func (msg ProviderReportMsg) GetSigners() []sdk.AccAddress
- func (msg ProviderReportMsg) String() string
- func (msg ProviderReportMsg) Type() string
- func (msg ProviderReportMsg) ValidateBasic() sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidUsage ¶
ErrInvalidUsage - error if report usgae is invalid
func ErrInvalidUsername ¶
ErrInvalidUsername - error if username is invalid
func ErrProviderNotFound ¶
ErrProviderNotFound - error if infra provider is not found
func NewHandler ¶
func NewHandler(im InfraManager) sdk.Handler
NewHandler - Handle all "infra" type messages.
func RegisterWire ¶
RegisterWire - register concrete types on wire codec
Types ¶
type InfraManager ¶
type InfraManager struct {
// contains filtered or unexported fields
}
InfraManager - infra manager
func NewInfraManager ¶
func NewInfraManager(key sdk.StoreKey, holder param.ParamHolder) InfraManager
NewInfraManager - create NewInfraManager
func (InfraManager) AddToInfraProviderList ¶
func (im InfraManager) AddToInfraProviderList(ctx sdk.Context, username types.AccountKey) sdk.Error
AddToInfraProviderList - add infra provider to list
func (*InfraManager) ClearUsage ¶
func (im *InfraManager) ClearUsage(ctx sdk.Context) sdk.Error
ClearUsage - clear all infra provider report usage
func (InfraManager) DoesInfraProviderExist ¶
func (im InfraManager) DoesInfraProviderExist(ctx sdk.Context, username types.AccountKey) bool
DoesInfraProviderExist - check if infra provide exists in KVStore or not
func (*InfraManager) GetInfraProviderList ¶
func (im *InfraManager) GetInfraProviderList(ctx sdk.Context) (*model.InfraProviderList, sdk.Error)
GetInfraProviderList - get the infra provider list
func (*InfraManager) GetUsageWeight ¶
func (im *InfraManager) GetUsageWeight(ctx sdk.Context, username types.AccountKey) (sdk.Rat, sdk.Error)
GetUsageWeight - get the usage percentage of given infra provider
func (InfraManager) InitGenesis ¶
func (im InfraManager) InitGenesis(ctx sdk.Context) error
InitGenesis - initialize infra manager
func (InfraManager) RegisterInfraProvider ¶
func (im InfraManager) RegisterInfraProvider(ctx sdk.Context, username types.AccountKey) sdk.Error
RegisterInfraProvider - register infra provider on KVStore
func (InfraManager) RemoveFromProviderList ¶
func (im InfraManager) RemoveFromProviderList(ctx sdk.Context, username types.AccountKey) sdk.Error
RemoveFromProviderList - remove infra provider from list
func (*InfraManager) ReportUsage ¶
func (im *InfraManager) ReportUsage(ctx sdk.Context, username types.AccountKey, usage int64) sdk.Error
ReportUsage - infra provider report usage and get reward
type ProviderReportMsg ¶
type ProviderReportMsg struct { Username types.AccountKey `json:"username"` Usage int64 `json:"usage"` }
ProviderReportMsg - infra provider report infra usage to blockchain
func NewProviderReportMsg ¶
func NewProviderReportMsg(provider string, usage int64) ProviderReportMsg
---------------------------------------- ReportMsg Msg Implementations NewProviderReportMsg - new ProviderReportMsg
func (ProviderReportMsg) GetConsumeAmount ¶
func (msg ProviderReportMsg) GetConsumeAmount() types.Coin
GetConsumeAmount - implements types.Msg
func (ProviderReportMsg) GetPermission ¶
func (msg ProviderReportMsg) GetPermission() types.Permission
GetPermission - implements types.Msg
func (ProviderReportMsg) GetSignBytes ¶
func (msg ProviderReportMsg) GetSignBytes() []byte
GetSignBytes - implements sdk.Msg
func (ProviderReportMsg) GetSigners ¶
func (msg ProviderReportMsg) GetSigners() []sdk.AccAddress
GetSigners - implements sdk.Msg
func (ProviderReportMsg) String ¶
func (msg ProviderReportMsg) String() string
func (ProviderReportMsg) Type ¶
func (msg ProviderReportMsg) Type() string
Type - implements sdk.Msg
func (ProviderReportMsg) ValidateBasic ¶
func (msg ProviderReportMsg) ValidateBasic() sdk.Error
ValidateBasic - implements sdk.Msg