types

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const (
	EventTypeSetCount   = "plan:set_count"
	EventTypeSet        = "plan:set"
	EventTypeSetStatus  = "plan:set_status"
	EventTypeAddNode    = "plan:add_node"
	EventTypeRemoveNode = "plan:remove_node"
)
View Source
const (
	AttributeKeyAddress = "address"
	AttributeKeyID      = "id"
	AttributeKeyCount   = "count"
	AttributeKeyStatus  = "status"
)
View Source
const (
	ModuleName   = "plan"
	QuerierRoute = ModuleName
)
View Source
const (
	QueryPlan             = "plan"
	QueryPlans            = "plans"
	QueryPlansForProvider = "plans_for_provider"

	QueryNodesForPlan = "nodes_for_plan"
)
View Source
const (
	Codespace = sdk.CodespaceType(ModuleName)
)

Variables

View Source
var (
	RouterKey = ModuleName
	StoreKey  = ModuleName
)
View Source
var (
	CountKey                 = []byte{0x00}
	PlanKeyPrefix            = []byte{0x01}
	PlanForProviderKeyPrefix = []byte{0x02}
	NodeForPlanKeyPrefix     = []byte{0x03}
)
View Source
var (
	ModuleCdc *codec.Codec
)

Functions

func ErrorInvalidField

func ErrorInvalidField(v string) sdk.Error

func ErrorMarshal

func ErrorMarshal() sdk.Error

func ErrorNodeDoesNotExist

func ErrorNodeDoesNotExist() sdk.Error

func ErrorPlanDoesNotExist

func ErrorPlanDoesNotExist() sdk.Error

func ErrorProviderDoesNotExist

func ErrorProviderDoesNotExist() sdk.Error

func ErrorUnauthorized

func ErrorUnauthorized() sdk.Error

func ErrorUnknownMsgType

func ErrorUnknownMsgType(v string) sdk.Error

func ErrorUnknownQueryType

func ErrorUnknownQueryType(v string) sdk.Error

func ErrorUnmarshal

func ErrorUnmarshal() sdk.Error

func GetNodeForPlanKeyPrefix

func GetNodeForPlanKeyPrefix(id uint64) []byte

func GetPlanForProviderKeyPrefix

func GetPlanForProviderKeyPrefix(address hub.ProvAddress) []byte

func NodeForPlanKey

func NodeForPlanKey(id uint64, address hub.NodeAddress) []byte

func PlanForProviderKey

func PlanForProviderKey(address hub.ProvAddress, id uint64) []byte

func PlanKey

func PlanKey(i uint64) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type GenesisPlan

type GenesisPlan struct {
	Plan  Plan              `json:"_"`
	Nodes []hub.NodeAddress `json:"nodes"`
}

type GenesisPlans

type GenesisPlans []GenesisPlan

type GenesisState

type GenesisState = GenesisPlans

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(plans GenesisPlans) GenesisState

type MsgAdd

type MsgAdd struct {
	From      hub.ProvAddress `json:"from"`
	Price     sdk.Coins       `json:"price"`
	Validity  time.Duration   `json:"validity"`
	Bandwidth hub.Bandwidth   `json:"bandwidth"`
}

MsgAdd is adding a subscription plan.

func NewMsgAdd

func NewMsgAdd(from hub.ProvAddress, price sdk.Coins, validity time.Duration, bandwidth hub.Bandwidth) MsgAdd

func (MsgAdd) GetSignBytes

func (m MsgAdd) GetSignBytes() []byte

func (MsgAdd) GetSigners

func (m MsgAdd) GetSigners() []sdk.AccAddress

func (MsgAdd) Route

func (m MsgAdd) Route() string

func (MsgAdd) Type

func (m MsgAdd) Type() string

func (MsgAdd) ValidateBasic

func (m MsgAdd) ValidateBasic() sdk.Error

type MsgAddNode

type MsgAddNode struct {
	From    hub.ProvAddress `json:"from"`
	ID      uint64          `json:"id"`
	Address hub.NodeAddress `json:"address"`
}

MsgAddNode is for adding a node for a plan.

func NewMsgAddNode

func NewMsgAddNode(from hub.ProvAddress, id uint64, address hub.NodeAddress) MsgAddNode

func (MsgAddNode) GetSignBytes

func (m MsgAddNode) GetSignBytes() []byte

func (MsgAddNode) GetSigners

func (m MsgAddNode) GetSigners() []sdk.AccAddress

func (MsgAddNode) Route

func (m MsgAddNode) Route() string

func (MsgAddNode) Type

func (m MsgAddNode) Type() string

func (MsgAddNode) ValidateBasic

func (m MsgAddNode) ValidateBasic() sdk.Error

type MsgRemoveNode

type MsgRemoveNode struct {
	From    hub.ProvAddress `json:"from"`
	ID      uint64          `json:"id"`
	Address hub.NodeAddress `json:"address"`
}

MsgRemoveNode is for removing a node for a plan.

func NewMsgRemoveNode

func NewMsgRemoveNode(from hub.ProvAddress, id uint64, address hub.NodeAddress) MsgRemoveNode

func (MsgRemoveNode) GetSignBytes

func (m MsgRemoveNode) GetSignBytes() []byte

func (MsgRemoveNode) GetSigners

func (m MsgRemoveNode) GetSigners() []sdk.AccAddress

func (MsgRemoveNode) Route

func (m MsgRemoveNode) Route() string

func (MsgRemoveNode) Type

func (m MsgRemoveNode) Type() string

func (MsgRemoveNode) ValidateBasic

func (m MsgRemoveNode) ValidateBasic() sdk.Error

type MsgSetStatus

type MsgSetStatus struct {
	From   hub.ProvAddress `json:"from"`
	ID     uint64          `json:"id"`
	Status hub.Status      `json:"status"`
}

MsgSetStatus is for updating the status of a plan.

func NewMsgSetStatus

func NewMsgSetStatus(from hub.ProvAddress, id uint64, status hub.Status) MsgSetStatus

func (MsgSetStatus) GetSignBytes

func (m MsgSetStatus) GetSignBytes() []byte

func (MsgSetStatus) GetSigners

func (m MsgSetStatus) GetSigners() []sdk.AccAddress

func (MsgSetStatus) Route

func (m MsgSetStatus) Route() string

func (MsgSetStatus) Type

func (m MsgSetStatus) Type() string

func (MsgSetStatus) ValidateBasic

func (m MsgSetStatus) ValidateBasic() sdk.Error

type Plan

type Plan struct {
	ID        uint64          `json:"id"`
	Provider  hub.ProvAddress `json:"provider"`
	Price     sdk.Coins       `json:"price"`
	Validity  time.Duration   `json:"validity"`
	Bandwidth hub.Bandwidth   `json:"bandwidth"`
	Status    hub.Status      `json:"status"`
	StatusAt  time.Time       `json:"status_at"`
}

func (Plan) PriceForDenom

func (p Plan) PriceForDenom(d string) (sdk.Coin, bool)

func (Plan) String

func (p Plan) String() string

func (Plan) Validate

func (p Plan) Validate() error

type Plans

type Plans []Plan

type QueryNodesForPlanParams

type QueryNodesForPlanParams struct {
	ID    uint64 `json:"id"`
	Page  int    `json:"page"`
	Limit int    `json:"limit"`
}

func NewQueryNodesForPlanParams

func NewQueryNodesForPlanParams(id uint64, page, limit int) QueryNodesForPlanParams

type QueryPlanParams

type QueryPlanParams struct {
	ID uint64 `json:"id"`
}

func NewQueryPlanParams

func NewQueryPlanParams(id uint64) QueryPlanParams

type QueryPlansForProviderParams

type QueryPlansForProviderParams struct {
	Address hub.ProvAddress `json:"address"`
	Page    int             `json:"page"`
	Limit   int             `json:"limit"`
}

func NewQueryPlansForProviderParams

func NewQueryPlansForProviderParams(address hub.ProvAddress, page, limit int) QueryPlansForProviderParams

type QueryPlansParams

type QueryPlansParams struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

func NewQueryPlansParams

func NewQueryPlansParams(page, limit int) QueryPlansParams

Jump to

Keyboard shortcuts

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