Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorInvalidField(v string) sdk.Error
- func ErrorMarshal() sdk.Error
- func ErrorNodeDoesNotExist() sdk.Error
- func ErrorPlanDoesNotExist() sdk.Error
- func ErrorProviderDoesNotExist() sdk.Error
- func ErrorUnauthorized() sdk.Error
- func ErrorUnknownMsgType(v string) sdk.Error
- func ErrorUnknownQueryType(v string) sdk.Error
- func ErrorUnmarshal() sdk.Error
- func GetNodeForPlanKeyPrefix(id uint64) []byte
- func GetPlanForProviderKeyPrefix(address hub.ProvAddress) []byte
- func NodeForPlanKey(id uint64, address hub.NodeAddress) []byte
- func PlanForProviderKey(address hub.ProvAddress, id uint64) []byte
- func PlanKey(i uint64) []byte
- func RegisterCodec(cdc *codec.Codec)
- type GenesisPlan
- type GenesisPlans
- type GenesisState
- type MsgAdd
- type MsgAddNode
- type MsgRemoveNode
- type MsgSetStatus
- type Plan
- type Plans
- type QueryNodesForPlanParams
- type QueryPlanParams
- type QueryPlansForProviderParams
- type QueryPlansParams
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 ( EventModuleName = sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), ) )
View Source
var (
ModuleCdc *codec.Codec
)
Functions ¶
func ErrorInvalidField ¶
func ErrorMarshal ¶
func ErrorNodeDoesNotExist ¶
func ErrorPlanDoesNotExist ¶
func ErrorUnauthorized ¶
func ErrorUnknownMsgType ¶
func ErrorUnknownQueryType ¶
func ErrorUnmarshal ¶
func GetNodeForPlanKeyPrefix ¶
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 RegisterCodec ¶
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"` Bytes sdk.Int `json:"bytes"` }
MsgAdd is adding a subscription plan.
func (MsgAdd) GetSignBytes ¶
func (MsgAdd) GetSigners ¶
func (m MsgAdd) GetSigners() []sdk.AccAddress
func (MsgAdd) ValidateBasic ¶
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 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 ¶
func NewQueryPlansParams ¶
func NewQueryPlansParams(page, limit int) QueryPlansParams
Source Files ¶
Click to show internal directories.
Click to hide internal directories.