types

package
v0.8.1-rc4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ModuleName is the module name constant used in many places
	ModuleName = "provider"

	// StoreKey is the store key string for provider
	StoreKey = ModuleName

	// RouterKey is the message route for provider
	RouterKey = ModuleName
)

Variables

View Source
var (
	// ErrInvalidProviderURI register error code for invalid provider uri
	ErrInvalidProviderURI = sdkerrors.Register(ModuleName, errInvalidProviderURI, "invalid provider: invalid host uri")

	// ErrNotAbsProviderURI register error code for not absolute provider uri
	ErrNotAbsProviderURI = sdkerrors.Register(ModuleName, errNotAbsProviderURI, "invalid provider: not absolute host uri")

	// ErrProviderNotFound provider not found
	ErrProviderNotFound = sdkerrors.Register(ModuleName, errProviderNotFound, "invalid provider: address not found")

	// ErrProviderExists provider already exists
	ErrProviderExists = sdkerrors.Register(ModuleName, errProviderExists, "invalid provider: already exists")

	// ErrInvalidAddress invalid provider address
	ErrInvalidAddress = sdkerrors.Register(ModuleName, errInvalidAddress, "invalid address")

	// ErrAttributes error code for provider attribute problems
	ErrAttributes = sdkerrors.Register(ModuleName, errAttributes, "attribute specification error")

	// ErrIncompatibleAttributes error code for attributes update
	ErrIncompatibleAttributes = sdkerrors.Register(ModuleName, errIncompatibleAttributes, "attributes cannot be changed")

	// ErrDuplicateAttributes duplicates are prohibited
	ErrDuplicateAttributes = sdkerrors.Register(ModuleName, errDuplicateAttributes, "attributes cannot have duplicates")
)

Functions

func MustMarshalJSON

func MustMarshalJSON(o interface{}) []byte

MustMarshalJSON panics if an error occurs. Besides that it behaves exactly like MarshalJSON i.e., encodes json to byte array

func MustUnmarshalJSON

func MustUnmarshalJSON(bz []byte, ptr interface{})

MustUnmarshalJSON panics if an error occurs. Besides that it behaves exactly like UnmarshalJSON.

func ParseEVProvider added in v0.7.4

func ParseEVProvider(attrs []sdk.Attribute) (sdk.AccAddress, error)

ParseEVProvider returns provider details for given event attributes

func ParseEvent added in v0.7.4

func ParseEvent(ev sdkutil.Event) (sdkutil.ModuleEvent, error)

ParseEvent parses event and returns details of event and error if occurred TODO: Enable returning actual events.

func ProviderEVAttributes added in v0.7.4

func ProviderEVAttributes(owner sdk.AccAddress) []sdk.Attribute

ProviderEVAttributes returns event attribues for given Provider

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec register concrete types on codec

func UnmarshalJSON

func UnmarshalJSON(bz []byte, ptr interface{}) error

UnmarshalJSON decodes bytes into json

Types

type Attributes added in v0.7.5

type Attributes []sdk.Attribute

func (Attributes) Validate added in v0.7.5

func (attr Attributes) Validate() error

type EventProviderCreated added in v0.7.6

type EventProviderCreated struct {
	Context sdkutil.BaseModuleEvent `json:"context"`
	Owner   sdk.AccAddress          `json:"owner"`
}

EventProviderCreated struct

func NewEventProviderCreated added in v0.7.6

func NewEventProviderCreated(owner sdk.AccAddress) EventProviderCreated

func (EventProviderCreated) ToSDKEvent added in v0.7.6

func (ev EventProviderCreated) ToSDKEvent() sdk.Event

ToSDKEvent method creates new sdk event for EventProviderCreated struct

type EventProviderDeleted added in v0.7.6

type EventProviderDeleted struct {
	Context sdkutil.BaseModuleEvent `json:"context"`
	Owner   sdk.AccAddress          `json:"owner"`
}

EventProviderDeleted struct

func NewEventProviderDeleted added in v0.7.6

func NewEventProviderDeleted(owner sdk.AccAddress) EventProviderDeleted

func (EventProviderDeleted) ToSDKEvent added in v0.7.6

func (ev EventProviderDeleted) ToSDKEvent() sdk.Event

ToSDKEvent method creates new sdk event for EventProviderDeleted struct

type EventProviderUpdated added in v0.7.6

type EventProviderUpdated struct {
	Context sdkutil.BaseModuleEvent `json:"context"`
	Owner   sdk.AccAddress          `json:"owner"`
}

EventProviderUpdated struct

func NewEventProviderUpdated added in v0.7.6

func NewEventProviderUpdated(owner sdk.AccAddress) EventProviderUpdated

func (EventProviderUpdated) ToSDKEvent added in v0.7.6

func (ev EventProviderUpdated) ToSDKEvent() sdk.Event

ToSDKEvent method creates new sdk event for EventProviderUpdated struct

type MsgCreateProvider added in v0.6.5

type MsgCreateProvider Provider

MsgCreateProvider defines an SDK message for creating a provider

func (MsgCreateProvider) GetSignBytes added in v0.6.5

func (msg MsgCreateProvider) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCreateProvider) GetSigners added in v0.6.5

func (msg MsgCreateProvider) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCreateProvider) Route added in v0.6.5

func (msg MsgCreateProvider) Route() string

Route implements the sdk.Msg interface

func (MsgCreateProvider) Type added in v0.6.5

func (msg MsgCreateProvider) Type() string

Type implements the sdk.Msg interface

func (MsgCreateProvider) ValidateBasic added in v0.6.5

func (msg MsgCreateProvider) ValidateBasic() error

ValidateBasic does basic validation of a HostURI

type MsgDeleteProvider added in v0.6.5

type MsgDeleteProvider struct {
	Owner sdk.AccAddress `json:"owner"`
}

MsgDeleteProvider defines an SDK message for deleting a provider

func (MsgDeleteProvider) GetSignBytes added in v0.6.5

func (msg MsgDeleteProvider) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgDeleteProvider) GetSigners added in v0.6.5

func (msg MsgDeleteProvider) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgDeleteProvider) Route added in v0.6.5

func (msg MsgDeleteProvider) Route() string

Route implements the sdk.Msg interface

func (MsgDeleteProvider) Type added in v0.6.5

func (msg MsgDeleteProvider) Type() string

Type implements the sdk.Msg interface

func (MsgDeleteProvider) ValidateBasic added in v0.6.5

func (msg MsgDeleteProvider) ValidateBasic() error

ValidateBasic does basic validation

type MsgUpdateProvider added in v0.6.5

type MsgUpdateProvider Provider

MsgUpdateProvider defines an SDK message for updating a provider

func (MsgUpdateProvider) GetSignBytes added in v0.6.5

func (msg MsgUpdateProvider) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUpdateProvider) GetSigners added in v0.6.5

func (msg MsgUpdateProvider) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUpdateProvider) Route added in v0.6.5

func (msg MsgUpdateProvider) Route() string

Route implements the sdk.Msg interface

func (MsgUpdateProvider) Type added in v0.6.5

func (msg MsgUpdateProvider) Type() string

Type implements the sdk.Msg interface

func (MsgUpdateProvider) ValidateBasic added in v0.6.5

func (msg MsgUpdateProvider) ValidateBasic() error

ValidateBasic does basic validation of a ProviderURI

type Provider

type Provider struct {
	Owner      sdk.AccAddress `json:"owner"`
	HostURI    string         `json:"host-uri"`
	Attributes Attributes     `json:"attributes"`
}

Provider stores owner and host details

Jump to

Keyboard shortcuts

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