infra

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInvalidUsage

func ErrInvalidUsage() sdk.Error

ErrInvalidUsage - error if report usgae is invalid

func ErrInvalidUsername

func ErrInvalidUsername() sdk.Error

ErrInvalidUsername - error if username is invalid

func ErrProviderNotFound

func ErrProviderNotFound() sdk.Error

ErrProviderNotFound - error if infra provider is not found

func NewHandler

func NewHandler(im InfraManager) sdk.Handler

NewHandler - Handle all "infra" type messages.

func RegisterWire

func RegisterWire(cdc *wire.Codec)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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