infra

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ModuleKey is the name of the module
	ModuleName = "infra"

	// RouterKey is the message route for gov
	RouterKey = ModuleName

	// QuerierRoute is the querier route for gov
	QuerierRoute = ModuleName

	QueryInfraProvider = "infra"
	QueryInfraList     = "infraList"
)

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 ErrQueryFailed added in v0.2.0

func ErrQueryFailed() sdk.Error

ErrQueryFailed - error when query infra store failed

func NewHandler

func NewHandler(im InfraManager) sdk.Handler

NewHandler - Handle all "infra" type messages.

func NewQuerier added in v0.2.0

func NewQuerier(im InfraManager) sdk.Querier

creates a querier for infra REST endpoints

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) Export added in v0.2.0

func (im *InfraManager) Export(ctx sdk.Context) *model.InfraTables

Export state of infra.

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.Dec, sdk.Error)

GetUsageWeight - get the usage percentage of given infra provider

func (*InfraManager) Import added in v0.2.0

func (im *InfraManager) Import(ctx sdk.Context, tb *model.InfraTablesIR)

Import state of infra.

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) Route added in v0.2.0

func (msg ProviderReportMsg) Route() string

Route - 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