Documentation
¶
Index ¶
- Constants
- Variables
- func ActivePlanForProviderKey(address hub.ProvAddress, id uint64) []byte
- func ActivePlanKey(i uint64) []byte
- func AddressFromNodeForPlanKey(key []byte) hub.NodeAddress
- func GetActivePlanForProviderKeyPrefix(address hub.ProvAddress) []byte
- func GetInactivePlanForProviderKeyPrefix(address hub.ProvAddress) []byte
- func GetNodeForPlanKeyPrefix(id uint64) []byte
- func IDFromStatusPlanForProviderKey(key []byte) uint64
- func IDFromStatusPlanKey(key []byte) uint64
- func InactivePlanForProviderKey(address hub.ProvAddress, id uint64) []byte
- func InactivePlanKey(i uint64) []byte
- func NodeForPlanKey(id uint64, address hub.NodeAddress) []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 ( AttributeKeyAddress = "address" AttributeKeyID = "id" AttributeKeyCount = "count" AttributeKeyStatus = "status" )
View Source
const ( ModuleName = "plan" QuerierRoute = ModuleName )
View Source
const ( QueryPlan = "Plan" QueryPlans = "Plans" QueryPlansForProvider = "PlansForProvider" QueryNodesForPlan = "NodesForPlan" )
Variables ¶
View Source
var ( ErrorMarshal = errors.Register(ModuleName, 101, "error occurred while marshalling") ErrorUnmarshal = errors.Register(ModuleName, 102, "error occurred while unmarshalling") ErrorUnknownMsgType = errors.Register(ModuleName, 103, "unknown message type") ErrorUnknownQueryType = errors.Register(ModuleName, 104, "unknown query type") ErrorInvalidField = errors.Register(ModuleName, 105, "invalid field") ErrorProviderDoesNotExist = errors.Register(ModuleName, 106, "provider does not exist") ErrorPlanDoesNotExist = errors.Register(ModuleName, 107, "plan does not exist") ErrorNodeDoesNotExist = errors.Register(ModuleName, 108, "node does not exist") )
View Source
var ( EventTypeSetCount = fmt.Sprintf("%s:set_count", ModuleName) EventTypeSet = fmt.Sprintf("%s:set", ModuleName) EventTypeSetStatus = fmt.Sprintf("%s:set_status", ModuleName) EventTypeAddNode = fmt.Sprintf("%s:add_node", ModuleName) EventTypeRemoveNode = fmt.Sprintf("%s:remove_node", ModuleName) )
View Source
var ( RouterKey = ModuleName StoreKey = ModuleName )
View Source
var ( CountKey = []byte{0x00} PlanKeyPrefix = []byte{0x10} ActivePlanKeyPrefix = []byte{0x20} InactivePlanKeyPrefix = []byte{0x21} ActivePlanForProviderKeyPrefix = []byte{0x30} InactivePlanForProviderKeyPrefix = []byte{0x31} NodeForPlanKeyPrefix = []byte{0x40} )
View Source
var ( EventModuleName = sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), ) )
View Source
var (
ModuleCdc *codec.Codec
)
Functions ¶
func ActivePlanForProviderKey ¶ added in v0.4.0
func ActivePlanForProviderKey(address hub.ProvAddress, id uint64) []byte
func ActivePlanKey ¶ added in v0.4.0
func AddressFromNodeForPlanKey ¶ added in v0.4.0
func AddressFromNodeForPlanKey(key []byte) hub.NodeAddress
func GetActivePlanForProviderKeyPrefix ¶ added in v0.4.0
func GetActivePlanForProviderKeyPrefix(address hub.ProvAddress) []byte
func GetInactivePlanForProviderKeyPrefix ¶ added in v0.4.0
func GetInactivePlanForProviderKeyPrefix(address hub.ProvAddress) []byte
func GetNodeForPlanKeyPrefix ¶
func IDFromStatusPlanForProviderKey ¶ added in v0.4.0
func IDFromStatusPlanKey ¶ added in v0.4.0
func InactivePlanForProviderKey ¶ added in v0.4.0
func InactivePlanForProviderKey(address hub.ProvAddress, id uint64) []byte
func InactivePlanKey ¶ added in v0.4.0
func NodeForPlanKey ¶
func NodeForPlanKey(id uint64, address hub.NodeAddress) []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 for 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() 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() 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() error
type Plan ¶
type QueryNodesForPlanParams ¶
type QueryNodesForPlanParams struct { ID uint64 `json:"id"` Skip int `json:"skip"` Limit int `json:"limit"` }
func NewQueryNodesForPlanParams ¶
func NewQueryNodesForPlanParams(id uint64, skip, 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"` Status hub.Status `json:"status"` Skip int `json:"skip"` Limit int `json:"limit"` }
func NewQueryPlansForProviderParams ¶
func NewQueryPlansForProviderParams(address hub.ProvAddress, status hub.Status, skip, limit int) QueryPlansForProviderParams
type QueryPlansParams ¶
type QueryPlansParams struct { Status hub.Status `json:"status"` Skip int `json:"skip"` Limit int `json:"limit"` }
func NewQueryPlansParams ¶
func NewQueryPlansParams(status hub.Status, skip, limit int) QueryPlansParams
Source Files
¶
Click to show internal directories.
Click to hide internal directories.