Documentation
¶
Index ¶
- Constants
- func ErrDisable(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrEnable(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidAuthor(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidBindingType(codespace sdk.CodespaceType, bindingType BindingType) sdk.Error
- func ErrInvalidChainId(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidDefChainId(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidIDL(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidLevel(codespace sdk.CodespaceType, level Level) 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 ErrInvalidPriceCount(codespace sdk.CodespaceType, priceCount int, methodCount int) sdk.Error
- func ErrInvalidServiceName(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrLtMinProviderDeposit(codespace sdk.CodespaceType, coins sdk.Coins) sdk.Error
- func ErrRefundDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrSvcBindingExists(codespace sdk.CodespaceType) sdk.Error
- func ErrSvcBindingNotExists(codespace sdk.CodespaceType) sdk.Error
- func ErrSvcDefExists(codespace sdk.CodespaceType, defChainId, svcDefName string) sdk.Error
- func ErrSvcDefNotExists(codespace sdk.CodespaceType, defChainId, svcDefName string) sdk.Error
- func GetBindingsSubspaceKey(chainId, serviceName string) []byte
- func GetMethodPropertyKey(chainId, serviceName string, id int) []byte
- func GetMethodsSubspaceKey(chainId, serviceName string) []byte
- func GetServiceBindingKey(defChainId, name, bindChainId string, provider sdk.AccAddress) []byte
- func GetServiceDefinitionKey(chainId, name string) []byte
- func InitGenesis(ctx sdk.Context, data GenesisState)
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- func RegisterCodec(cdc *codec.Codec)
- func SortAddresses(addrs []sdk.AccAddress)
- func SortByteArrays(src [][]byte) [][]byte
- func SvcBindingEqual(bindingA, bindingB SvcBinding) bool
- type BindingType
- type GenesisState
- type Keeper
- func (k Keeper) AddMethods(ctx sdk.Context, svcDef SvcDef) sdk.Error
- func (k Keeper) AddServiceBinding(ctx sdk.Context, svcBinding SvcBinding) (sdk.Error, bool)
- func (k Keeper) AddServiceDefinition(ctx sdk.Context, svcDef SvcDef)
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) Disable(ctx sdk.Context, defChainID, defName, bindChainID string, ...) (sdk.Error, bool)
- func (k Keeper) Enable(ctx sdk.Context, defChainID, defName, bindChainID string, ...) (sdk.Error, bool)
- func (k Keeper) GetMethods(ctx sdk.Context, chainId, name string) sdk.Iterator
- func (k Keeper) GetServiceBinding(ctx sdk.Context, defChainID, defName, bindChainID string, ...) (svcBinding SvcBinding, found bool)
- func (k Keeper) GetServiceDefinition(ctx sdk.Context, chainId, name string) (svcDef SvcDef, found bool)
- func (k Keeper) RefundDeposit(ctx sdk.Context, defChainID, defName, bindChainID string, ...) (sdk.Error, bool)
- func (k Keeper) UpdateServiceBinding(ctx sdk.Context, svcBinding SvcBinding) (sdk.Error, bool)
- type Level
- type MessagingType
- type MethodProperty
- type MsgSvcBind
- type MsgSvcBindingUpdate
- type MsgSvcDef
- type MsgSvcDisable
- type MsgSvcEnable
- type MsgSvcRefundDeposit
- type OutputCachedEnum
- type OutputPrivacyEnum
- type SvcBinding
- type SvcDef
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = 8 CodeInvalidIDL sdk.CodeType = 100 CodeSvcDefExists sdk.CodeType = 101 CodeSvcDefNotExists sdk.CodeType = 102 CodeInvalidOutputPrivacyEnum sdk.CodeType = 103 CodeInvalidOutputCachedEnum sdk.CodeType = 104 CodeInvalidServiceName sdk.CodeType = 105 CodeInvalidChainId sdk.CodeType = 106 CodeInvalidAuthor sdk.CodeType = 107 CodeInvalidMethodName sdk.CodeType = 108 CodeSvcBindingExists sdk.CodeType = 109 CodeSvcBindingNotExists sdk.CodeType = 110 CodeInvalidDefChainId sdk.CodeType = 111 CodeInvalidBindingType sdk.CodeType = 112 CodeInvalidLevel sdk.CodeType = 113 CodeInvalidPriceCount sdk.CodeType = 114 CodeInvalidRefundDeposit sdk.CodeType = 115 CodeLtMinProviderDeposit sdk.CodeType = 116 CodeInvalidDisable sdk.CodeType = 117 CodeInvalidEnable sdk.CodeType = 118 )
const (
// name to idetify transaction types
MsgType = "service"
)
Variables ¶
This section is empty.
Functions ¶
func ErrDisable ¶
func ErrDisable(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidAuthor ¶
func ErrInvalidAuthor(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidBindingType ¶
func ErrInvalidBindingType(codespace sdk.CodespaceType, bindingType BindingType) sdk.Error
func ErrInvalidChainId ¶
func ErrInvalidChainId(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidDefChainId ¶
func ErrInvalidDefChainId(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidIDL ¶
func ErrInvalidIDL(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidLevel ¶
func ErrInvalidLevel(codespace sdk.CodespaceType, level Level) 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 ErrInvalidPriceCount ¶
func ErrInvalidServiceName ¶
func ErrInvalidServiceName(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrLtMinProviderDeposit ¶
func ErrRefundDeposit ¶
func ErrRefundDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrSvcBindingExists ¶
func ErrSvcBindingExists(codespace sdk.CodespaceType) sdk.Error
func ErrSvcBindingNotExists ¶
func ErrSvcBindingNotExists(codespace sdk.CodespaceType) sdk.Error
func ErrSvcDefExists ¶
func ErrSvcDefExists(codespace sdk.CodespaceType, defChainId, svcDefName string) sdk.Error
func ErrSvcDefNotExists ¶
func ErrSvcDefNotExists(codespace sdk.CodespaceType, defChainId, svcDefName string) sdk.Error
func GetBindingsSubspaceKey ¶
Key for getting all methods on a service from the store
func GetMethodPropertyKey ¶
id can not zero
func GetMethodsSubspaceKey ¶
Key for getting all methods on a service from the store
func GetServiceBindingKey ¶
func GetServiceBindingKey(defChainId, name, bindChainId string, provider sdk.AccAddress) []byte
func GetServiceDefinitionKey ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, data GenesisState)
InitGenesis - store genesis parameters
func SvcBindingEqual ¶
func SvcBindingEqual(bindingA, bindingB SvcBinding) bool
Types ¶
type BindingType ¶
type BindingType byte
const ( Global BindingType = 0x01 Local BindingType = 0x02 )
func BindingTypeFromString ¶
func BindingTypeFromString(str string) (BindingType, error)
String to BindingType byte, Returns ff if invalid.
func (BindingType) Format ¶
func (bt BindingType) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (BindingType) MarshalJSON ¶
func (bt BindingType) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (*BindingType) UnmarshalJSON ¶
func (bt *BindingType) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type GenesisState ¶
GenesisState - all service state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func DefaultGenesisStateForTest ¶
func DefaultGenesisStateForTest() GenesisState
get raw genesis raw message for testing
func NewGenesisState ¶
func NewGenesisState(maxRequestTimeout int64, minProviderDeposit sdk.Coins) GenesisState
func WriteGenesis ¶
func WriteGenesis(ctx sdk.Context) GenesisState
WriteGenesis - output genesis parameters
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AddServiceBinding ¶
func (Keeper) AddServiceDefinition ¶
func (Keeper) GetMethods ¶
Gets all the methods in a specific service
func (Keeper) GetServiceBinding ¶
func (k Keeper) GetServiceBinding(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) (svcBinding SvcBinding, found bool)
func (Keeper) GetServiceDefinition ¶
func (Keeper) RefundDeposit ¶
func (Keeper) UpdateServiceBinding ¶
type MessagingType ¶
type MessagingType byte
const ( Unicast MessagingType = 0x01 Multicast MessagingType = 0x02 )
func MessagingTypeFromString ¶
func MessagingTypeFromString(str string) (MessagingType, error)
String to messagingType byte, Returns ff if invalid.
func (MessagingType) Format ¶
func (mt MessagingType) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (MessagingType) MarshalJSON ¶
func (mt MessagingType) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (MessagingType) String ¶
func (mt MessagingType) String() string
Turns MessagingType byte to String
func (*MessagingType) UnmarshalJSON ¶
func (mt *MessagingType) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type MethodProperty ¶
type MethodProperty struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
OutputPrivacy OutputPrivacyEnum `json:"output_privacy"`
OutputCached OutputCachedEnum `json:"output_cached"`
}
type MsgSvcBind ¶
type MsgSvcBind struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
BindingType BindingType `json:"binding_type"`
Deposit sdk.Coins `json:"deposit"`
Prices []sdk.Coin `json:"price"`
Level Level `json:"level"`
}
MsgSvcBinding - struct for bind a service
func NewMsgSvcBind ¶
func NewMsgSvcBind(defChainID, defName, bindChainID string, provider sdk.AccAddress, bindingType BindingType, deposit sdk.Coins, prices []sdk.Coin, level Level) MsgSvcBind
func (MsgSvcBind) GetSignBytes ¶
func (msg MsgSvcBind) GetSignBytes() []byte
func (MsgSvcBind) GetSigners ¶
func (msg MsgSvcBind) GetSigners() []sdk.AccAddress
func (MsgSvcBind) Route ¶
func (msg MsgSvcBind) Route() string
func (MsgSvcBind) Type ¶
func (msg MsgSvcBind) Type() string
func (MsgSvcBind) ValidateBasic ¶
func (msg MsgSvcBind) ValidateBasic() sdk.Error
type MsgSvcBindingUpdate ¶
type MsgSvcBindingUpdate struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
BindingType BindingType `json:"binding_type"`
Deposit sdk.Coins `json:"deposit"`
Prices []sdk.Coin `json:"price"`
Level Level `json:"level"`
}
MsgSvcBindingUpdate - struct for update a service binding
func NewMsgSvcBindingUpdate ¶
func NewMsgSvcBindingUpdate(defChainID, defName, bindChainID string, provider sdk.AccAddress, bindingType BindingType, deposit sdk.Coins, prices []sdk.Coin, level Level) MsgSvcBindingUpdate
func (MsgSvcBindingUpdate) GetSignBytes ¶
func (msg MsgSvcBindingUpdate) GetSignBytes() []byte
func (MsgSvcBindingUpdate) GetSigners ¶
func (msg MsgSvcBindingUpdate) GetSigners() []sdk.AccAddress
func (MsgSvcBindingUpdate) Route ¶
func (msg MsgSvcBindingUpdate) Route() string
func (MsgSvcBindingUpdate) Type ¶
func (msg MsgSvcBindingUpdate) Type() string
func (MsgSvcBindingUpdate) ValidateBasic ¶
func (msg MsgSvcBindingUpdate) ValidateBasic() sdk.Error
type MsgSvcDef ¶
type MsgSvcDef struct {
SvcDef
}
MsgSvcDef - struct for define a service
func NewMsgSvcDef ¶
func (MsgSvcDef) GetSignBytes ¶
func (MsgSvcDef) GetSigners ¶
func (msg MsgSvcDef) GetSigners() []sdk.AccAddress
func (MsgSvcDef) ValidateBasic ¶
type MsgSvcDisable ¶
type MsgSvcDisable struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
}
MsgSvcDisable - struct for disable a service binding
func NewMsgSvcDisable ¶
func NewMsgSvcDisable(defChainID, defName, bindChainID string, provider sdk.AccAddress) MsgSvcDisable
func (MsgSvcDisable) GetSignBytes ¶
func (msg MsgSvcDisable) GetSignBytes() []byte
func (MsgSvcDisable) GetSigners ¶
func (msg MsgSvcDisable) GetSigners() []sdk.AccAddress
func (MsgSvcDisable) Route ¶
func (msg MsgSvcDisable) Route() string
func (MsgSvcDisable) Type ¶
func (msg MsgSvcDisable) Type() string
func (MsgSvcDisable) ValidateBasic ¶
func (msg MsgSvcDisable) ValidateBasic() sdk.Error
type MsgSvcEnable ¶
type MsgSvcEnable struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
Deposit sdk.Coins `json:"deposit"`
}
MsgSvcEnable - struct for enable a service binding
func NewMsgSvcEnable ¶
func NewMsgSvcEnable(defChainID, defName, bindChainID string, provider sdk.AccAddress, deposit sdk.Coins) MsgSvcEnable
func (MsgSvcEnable) GetSignBytes ¶
func (msg MsgSvcEnable) GetSignBytes() []byte
func (MsgSvcEnable) GetSigners ¶
func (msg MsgSvcEnable) GetSigners() []sdk.AccAddress
func (MsgSvcEnable) Route ¶
func (msg MsgSvcEnable) Route() string
func (MsgSvcEnable) Type ¶
func (msg MsgSvcEnable) Type() string
func (MsgSvcEnable) ValidateBasic ¶
func (msg MsgSvcEnable) ValidateBasic() sdk.Error
type MsgSvcRefundDeposit ¶
type MsgSvcRefundDeposit struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
}
MsgSvcRefundDeposit - struct for refund deposit from a service binding
func NewMsgSvcRefundDeposit ¶
func NewMsgSvcRefundDeposit(defChainID, defName, bindChainID string, provider sdk.AccAddress) MsgSvcRefundDeposit
func (MsgSvcRefundDeposit) GetSignBytes ¶
func (msg MsgSvcRefundDeposit) GetSignBytes() []byte
func (MsgSvcRefundDeposit) GetSigners ¶
func (msg MsgSvcRefundDeposit) GetSigners() []sdk.AccAddress
func (MsgSvcRefundDeposit) Route ¶
func (msg MsgSvcRefundDeposit) Route() string
func (MsgSvcRefundDeposit) Type ¶
func (msg MsgSvcRefundDeposit) Type() string
func (MsgSvcRefundDeposit) ValidateBasic ¶
func (msg MsgSvcRefundDeposit) ValidateBasic() sdk.Error
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
type SvcBinding ¶
type SvcBinding struct {
DefName string `json:"def_name"`
DefChainID string `json:"def_chain_id"`
BindChainID string `json:"bind_chain_id"`
Provider sdk.AccAddress `json:"provider"`
BindingType BindingType `json:"binding_type"`
Deposit sdk.Coins `json:"deposit"`
Prices []sdk.Coin `json:"price"`
Level Level `json:"level"`
Available bool `json:"available"`
DisableHeight int64 `json:"disable_height"`
}
func NewSvcBinding ¶
func NewSvcBinding(defChainID, defName, bindChainID string, provider sdk.AccAddress, bindingType BindingType, deposit sdk.Coins, prices []sdk.Coin, level Level, available bool, disableHeight int64) SvcBinding
NewSvcBinding returns a new SvcBinding with the provided values.