Documentation
¶
Index ¶
- Constants
- func ErrDuplicateTags(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidAuthor(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidBroadcastEnum(codespace sdk.CodespaceType, value BroadcastEnum) sdk.Error
- func ErrInvalidChainId(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidIDL(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidMethodName(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidOutputCachedEnum(codespace sdk.CodespaceType, value string) sdk.Error
- func ErrInvalidOutputPrivacyEnum(codespace sdk.CodespaceType, value string) sdk.Error
- func ErrInvalidServiceName(codespace sdk.CodespaceType) sdk.Error
- func ErrMoreTags(codespace sdk.CodespaceType) sdk.Error
- func ErrSvcDefExists(codespace sdk.CodespaceType, svcDefName string) sdk.Error
- func GetMethodPropertyKey(chainId, serviceName, methodName string) []byte
- func GetMethodsSubspaceKey(chainId, serviceName string) []byte
- func GetServiceDefinitionKey(chainId, name string) []byte
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type BroadcastEnum
- type Keeper
- func (k Keeper) AddMethods(ctx sdk.Context, serviceDef MsgSvcDef) sdk.Error
- func (k Keeper) AddServiceDefinition(ctx sdk.Context, serviceDef MsgSvcDef)
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) GetMethods(ctx sdk.Context, chainId, name string) sdk.Iterator
- func (k Keeper) GetServiceDefinition(ctx sdk.Context, chainId, name string) (msgSvcDef MsgSvcDef, found bool)
- type MethodProperty
- type MsgSvcDef
- type OutputCachedEnum
- type OutputPrivacyEnum
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = 6 CodeInvalidIDL sdk.CodeType = 100 CodeSvcDefExists sdk.CodeType = 101 CodeInvalidOutputPrivacyEnum sdk.CodeType = 102 CodeInvalidOutputCachedEnum sdk.CodeType = 103 CodeInvalidServiceName sdk.CodeType = 104 CodeInvalidChainId sdk.CodeType = 105 CodeInvalidAuthor sdk.CodeType = 106 CodeInvalidMethodName sdk.CodeType = 107 CodeInvalidBroadcastEnum sdk.CodeType = 108 CodeMoreTags sdk.CodeType = 109 CodeDuplicateTags sdk.CodeType = 110 )
const (
MsgType = "iservice"
)
name to idetify transaction types
Variables ¶
This section is empty.
Functions ¶
func ErrDuplicateTags ¶
func ErrDuplicateTags(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidAuthor ¶
func ErrInvalidAuthor(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidBroadcastEnum ¶
func ErrInvalidBroadcastEnum(codespace sdk.CodespaceType, value BroadcastEnum) sdk.Error
func ErrInvalidChainId ¶
func ErrInvalidChainId(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidIDL ¶
func ErrInvalidIDL(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidMethodName ¶
func ErrInvalidMethodName(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidOutputCachedEnum ¶
func ErrInvalidOutputCachedEnum(codespace sdk.CodespaceType, value string) sdk.Error
func ErrInvalidOutputPrivacyEnum ¶
func ErrInvalidOutputPrivacyEnum(codespace sdk.CodespaceType, value string) sdk.Error
func ErrInvalidServiceName ¶
func ErrInvalidServiceName(codespace sdk.CodespaceType) sdk.Error
func ErrMoreTags ¶
func ErrMoreTags(codespace sdk.CodespaceType) sdk.Error
func ErrSvcDefExists ¶
func ErrSvcDefExists(codespace sdk.CodespaceType, svcDefName string) sdk.Error
func GetMethodPropertyKey ¶
func GetMethodsSubspaceKey ¶
Key for getting all methods on a service from the store
func GetServiceDefinitionKey ¶
Types ¶
type BroadcastEnum ¶
type BroadcastEnum byte
const ( Broadcast BroadcastEnum = 0x01 Unicast BroadcastEnum = 0x02 )
func BroadcastEnumFromString ¶
func BroadcastEnumFromString(str string) (BroadcastEnum, error)
String to broadcastEnum byte, Returns ff if invalid.
func (BroadcastEnum) Format ¶
func (be BroadcastEnum) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (BroadcastEnum) MarshalJSON ¶
func (be BroadcastEnum) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (BroadcastEnum) String ¶
func (be BroadcastEnum) String() string
Turns BroadcastEnum byte to String
func (*BroadcastEnum) UnmarshalJSON ¶
func (be *BroadcastEnum) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AddMethods ¶
func (Keeper) AddServiceDefinition ¶
func (Keeper) GetMethods ¶
Gets all the methods in a specific service
type MethodProperty ¶
type MethodProperty struct {
Name string `json:"name"`
Description string `json:"description"`
OutputPrivacy OutputPrivacyEnum `json:"output_privacy"`
OutputCached OutputCachedEnum `json:"output_cached"`
}
type MsgSvcDef ¶
type MsgSvcDef struct {
Name string `json:"name"`
ChainId string `json:"chain_id"`
Description string `json:"description"`
Tags []string `json:"tags"`
Author sdk.AccAddress `json:"author"`
AuthorDescription string `json:"author_description"`
IDLContent string `json:"idl_content"`
Broadcast BroadcastEnum `json:"broadcast"`
}
func NewMsgSvcDef ¶
func NewMsgSvcDef(name, chainId, description string, tags []string, author sdk.AccAddress, authorDescription, idlContent string, broadcast BroadcastEnum) MsgSvcDef
func (MsgSvcDef) GetSignBytes ¶
func (MsgSvcDef) GetSigners ¶
func (msg MsgSvcDef) GetSigners() []sdk.AccAddress
func (MsgSvcDef) ValidateBasic ¶
type OutputCachedEnum ¶
type OutputCachedEnum byte
const ( OffChainCached OutputCachedEnum = 0x01 NoCached OutputCachedEnum = 0x02 )
func OutputCachedEnumFromString ¶
func OutputCachedEnumFromString(str string) (OutputCachedEnum, error)
String to outputCachedEnum byte, Returns ff if invalid.
func (OutputCachedEnum) Format ¶
func (oe OutputCachedEnum) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (OutputCachedEnum) MarshalJSON ¶
func (oe OutputCachedEnum) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (OutputCachedEnum) String ¶
func (oe OutputCachedEnum) String() string
Turns OutputCachedEnum byte to String
func (*OutputCachedEnum) UnmarshalJSON ¶
func (oe *OutputCachedEnum) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type OutputPrivacyEnum ¶
type OutputPrivacyEnum byte
const ( NoPrivacy OutputPrivacyEnum = 0x01 PubKeyEncryption OutputPrivacyEnum = 0x02 )
func OutputPrivacyEnumFromString ¶
func OutputPrivacyEnumFromString(str string) (OutputPrivacyEnum, error)
String to outputPrivacyEnum byte, Returns ff if invalid.
func (OutputPrivacyEnum) Format ¶
func (oe OutputPrivacyEnum) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (OutputPrivacyEnum) MarshalJSON ¶
func (oe OutputPrivacyEnum) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (OutputPrivacyEnum) String ¶
func (oe OutputPrivacyEnum) String() string
Turns OutputCachedEnum byte to String
func (*OutputPrivacyEnum) UnmarshalJSON ¶
func (oe *OutputPrivacyEnum) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding