Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRequestID(requestId string) (eHeight int64, rHeight int64, counter int16, err error)
- func EndBlocker(ctx sdk.Context, keeper Keeper) (resTags sdk.Tags)
- 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 ErrInvalidBindChainId(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 ErrInvalidReqChainId(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidReqId(codespace sdk.CodespaceType, reqId string) sdk.Error
- func ErrInvalidServiceName(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrLtMinProviderDeposit(codespace sdk.CodespaceType, coins sdk.Coins) sdk.Error
- func ErrLtServiceFee(codespace sdk.CodespaceType, coins sdk.Coins) sdk.Error
- func ErrMethodNotExists(codespace sdk.CodespaceType, methodID int16) sdk.Error
- func ErrNoResponseFound(codespace sdk.CodespaceType, requestID string) sdk.Error
- func ErrNotMatchingProvider(codespace sdk.CodespaceType, provider sdk.AccAddress) sdk.Error
- func ErrNotMatchingReqChainID(codespace sdk.CodespaceType, reqChainID string) sdk.Error
- func ErrNotProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
- func ErrNotTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
- func ErrRefundDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrRequestNotActive(codespace sdk.CodespaceType, requestID string) sdk.Error
- func ErrReturnFeeNotExists(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func ErrSvcBindingExists(codespace sdk.CodespaceType) sdk.Error
- func ErrSvcBindingNotAvailable(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 ErrWithdrawFeeNotExists(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func GetActiveRequestKey(defChainId, serviceName, bindChainId string, provider sdk.AccAddress, ...) []byte
- func GetBindingsSubspaceKey(chainId, serviceName string) []byte
- func GetIncomingFeeKey(address sdk.AccAddress) []byte
- func GetMethodPropertyKey(chainId, serviceName string, id int16) []byte
- func GetMethodsSubspaceKey(chainId, serviceName string) []byte
- func GetRequestKey(defChainId, serviceName, bindChainId string, provider sdk.AccAddress, ...) []byte
- func GetRequestsByExpirationIndexKey(eHeight, rHeight int64, counter int16) []byte
- func GetRequestsByExpirationIndexKeyByReq(req SvcRequest) []byte
- func GetRequestsByExpirationPrefix(height int64) []byte
- func GetResponseKey(reqChainId string, eHeight, rHeight int64, counter int16) []byte
- func GetReturnedFeeKey(address sdk.AccAddress) []byte
- func GetServiceBindingKey(defChainId, name, bindChainId string, provider sdk.AccAddress) []byte
- func GetServiceDefinitionKey(chainId, name string) []byte
- func GetSubActiveRequestKey(defChainId, serviceName, bindChainId string, provider sdk.AccAddress) []byte
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func ParamTypeTable() params.KeyTable
- func PrepForZeroHeightGenesis(ctx sdk.Context, k Keeper)
- func RegisterCodec(cdc *codec.Codec)
- func SvcBindingEqual(bindingA, bindingB SvcBinding) bool
- func ValidateGenesis(data GenesisState) error
- type BindingType
- type DefinitionOutput
- type FeesOutput
- type GenesisState
- type IncomingFee
- type Keeper
- func (k Keeper) ActiveAllRequestQueueIterator(store sdk.KVStore) sdk.Iterator
- func (k Keeper) ActiveBindRequestsIterator(ctx sdk.Context, defChainID, defName, bindChainID string, ...) sdk.Iterator
- func (k Keeper) ActiveRequestQueueIterator(ctx sdk.Context, height int64) sdk.Iterator
- func (k Keeper) AddActiveRequest(ctx sdk.Context, req SvcRequest)
- func (k Keeper) AddIncomingFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins) sdk.Error
- func (k Keeper) AddMethods(ctx sdk.Context, svcDef SvcDef) sdk.Error
- func (k Keeper) AddRequest(ctx sdk.Context, req SvcRequest) (SvcRequest, sdk.Error)
- func (k Keeper) AddRequestExpiration(ctx sdk.Context, req SvcRequest)
- func (k Keeper) AddResponse(ctx sdk.Context, resp SvcResponse)
- func (k Keeper) AddReturnFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)
- func (k Keeper) AddServiceBinding(ctx sdk.Context, svcBinding SvcBinding) sdk.Error
- func (k Keeper) AddServiceDefinition(ctx sdk.Context, svcDef SvcDef)
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) DeleteActiveRequest(ctx sdk.Context, req SvcRequest)
- func (k Keeper) DeleteRequestExpiration(ctx sdk.Context, req SvcRequest)
- func (k Keeper) Disable(ctx sdk.Context, defChainID, defName, bindChainID string, ...) sdk.Error
- func (k Keeper) Enable(ctx sdk.Context, defChainID, defName, bindChainID string, ...) sdk.Error
- func (k Keeper) GetActiveRequest(ctx sdk.Context, eHeight, rHeight int64, counter int16) (req SvcRequest, found bool)
- func (k Keeper) GetIncomingFee(ctx sdk.Context, address sdk.AccAddress) (fee IncomingFee, found bool)
- func (k Keeper) GetIntraTxCounter(ctx sdk.Context) int16
- func (k Keeper) GetMethod(ctx sdk.Context, chainId, name string, id int16) (method MethodProperty, found bool)
- func (k Keeper) GetMethods(ctx sdk.Context, chainId, name string) sdk.Iterator
- func (k Keeper) GetParamSet(ctx sdk.Context) Params
- func (k Keeper) GetResponse(ctx sdk.Context, reqChainID string, eHeight, rHeight int64, counter int16) (resp SvcResponse, found bool)
- func (k Keeper) GetReturnFee(ctx sdk.Context, address sdk.AccAddress) (fee ReturnedFee, found bool)
- 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) InitMetrics(store sdk.KVStore)
- func (k Keeper) RefundDeposit(ctx sdk.Context, defChainID, defName, bindChainID string, ...) sdk.Error
- func (k Keeper) RefundFee(ctx sdk.Context, address sdk.AccAddress) sdk.Error
- func (k Keeper) ServiceBindingsIterator(ctx sdk.Context, defChainID, defName string) sdk.Iterator
- func (k Keeper) SetIncomingFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)
- func (k Keeper) SetIntraTxCounter(ctx sdk.Context, counter int16)
- func (k Keeper) SetParamSet(ctx sdk.Context, params Params)
- func (k Keeper) SetReturnFee(ctx sdk.Context, address sdk.AccAddress, coins sdk.Coins)
- func (k Keeper) Slash(ctx sdk.Context, binding SvcBinding, slashCoins sdk.Coins) sdk.Error
- func (k Keeper) UpdateServiceBinding(ctx sdk.Context, svcBinding SvcBinding) sdk.Error
- func (k Keeper) WithdrawFee(ctx sdk.Context, address sdk.AccAddress) sdk.Error
- type Level
- type MessagingType
- type MethodProperty
- type Metrics
- type MsgSvcBind
- type MsgSvcBindingUpdate
- type MsgSvcDef
- type MsgSvcDisable
- type MsgSvcEnable
- type MsgSvcRefundDeposit
- type MsgSvcRefundFees
- type MsgSvcRequest
- type MsgSvcResponse
- type MsgSvcWithdrawFees
- type MsgSvcWithdrawTax
- type OutputCachedEnum
- type OutputPrivacyEnum
- type Params
- type QueryBindingParams
- type QueryFeesParams
- type QueryResponseParams
- type QueryServiceParams
- type ReturnedFee
- type SvcBinding
- type SvcDef
- type SvcRequest
- type SvcResponse
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "service" 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 CodeMethodNotExists sdk.CodeType = 119 CodeRequestNotActive sdk.CodeType = 120 CodeReturnFeeNotExists sdk.CodeType = 121 CodeWithdrawFeeNotExists sdk.CodeType = 122 CodeLtServiceFee sdk.CodeType = 123 CodeInvalidReqId sdk.CodeType = 124 CodeSvcBindingNotAvailable sdk.CodeType = 125 CodeNotMatchingProvider sdk.CodeType = 126 CodeInvalidReqChainId sdk.CodeType = 127 CodeInvalidBindChainId sdk.CodeType = 128 CodeNotMatchingReqChainID sdk.CodeType = 129 CodeIntOverflow sdk.CodeType = 130 CodeInvalidInput sdk.CodeType = 131 )
const ( QueryDefinition = "definition" QueryBinding = "binding" QueryBindings = "bindings" QueryRequests = "requests" QueryResponse = "response" QueryFees = "fees" )
const (
DefaultParamSpace = "service"
)
default paramSpace for service keeper
const MetricsSubsystem = "module_service"
const (
// name to idetify transaction types
MsgRoute = "service"
)
Variables ¶
var ( // params store for service params KeyMaxRequestTimeout = []byte("MaxRequestTimeout") KeyMinDepositMultiple = []byte("MinDepositMultiple") KeyServiceFeeTax = []byte("ServiceFeeTax") KeySlashFraction = []byte("SlashFraction") KeyComplaintRetrospect = []byte("ComplaintRetrospect") KeyArbitrationTimeLimit = []byte("ArbitrationTimeLimit") KeyTxSizeLimit = []byte("TxSizeLimit") )
Parameter store key
var DepositedCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceDepositedCoins")))
var RequestCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceRequestCoins")))
var TaxCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceTaxCoins")))
Functions ¶
func ConvertRequestID ¶
func EndBlocker ¶
Called every block, update request status
func ErrDisable ¶
func ErrDisable(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidAuthor ¶
func ErrInvalidAuthor(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidBindChainId ¶
func ErrInvalidBindChainId(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 ErrInvalidReqChainId ¶
func ErrInvalidReqChainId(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidReqId ¶
func ErrInvalidReqId(codespace sdk.CodespaceType, reqId string) sdk.Error
func ErrInvalidServiceName ¶
func ErrInvalidServiceName(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrLtMinProviderDeposit ¶
func ErrLtServiceFee ¶
func ErrMethodNotExists ¶
func ErrMethodNotExists(codespace sdk.CodespaceType, methodID int16) sdk.Error
func ErrNoResponseFound ¶
func ErrNoResponseFound(codespace sdk.CodespaceType, requestID string) sdk.Error
func ErrNotMatchingProvider ¶
func ErrNotMatchingProvider(codespace sdk.CodespaceType, provider sdk.AccAddress) sdk.Error
func ErrNotMatchingReqChainID ¶
func ErrNotMatchingReqChainID(codespace sdk.CodespaceType, reqChainID string) sdk.Error
func ErrNotProfiler ¶
func ErrNotProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
func ErrNotTrustee ¶
func ErrNotTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
func ErrRefundDeposit ¶
func ErrRefundDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrRequestNotActive ¶
func ErrRequestNotActive(codespace sdk.CodespaceType, requestID string) sdk.Error
func ErrReturnFeeNotExists ¶
func ErrReturnFeeNotExists(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
func ErrSvcBindingExists ¶
func ErrSvcBindingExists(codespace sdk.CodespaceType) sdk.Error
func ErrSvcBindingNotAvailable ¶
func ErrSvcBindingNotAvailable(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 ErrWithdrawFeeNotExists ¶
func ErrWithdrawFeeNotExists(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
func GetActiveRequestKey ¶
func GetBindingsSubspaceKey ¶
Key for getting all methods on a service from the store
func GetIncomingFeeKey ¶
func GetIncomingFeeKey(address sdk.AccAddress) []byte
func GetMethodPropertyKey ¶
id can not be zero
func GetMethodsSubspaceKey ¶
Key for getting all methods on a service from the store
func GetRequestKey ¶
func GetRequestsByExpirationIndexKeyByReq ¶
func GetRequestsByExpirationIndexKeyByReq(req SvcRequest) []byte
get the expiration index of a request
func GetRequestsByExpirationPrefix ¶
get the expiration prefix for all request of a block height
func GetResponseKey ¶
func GetReturnedFeeKey ¶
func GetReturnedFeeKey(address sdk.AccAddress) []byte
func GetServiceBindingKey ¶
func GetServiceBindingKey(defChainId, name, bindChainId string, provider sdk.AccAddress) []byte
func GetServiceDefinitionKey ¶
func GetSubActiveRequestKey ¶
func GetSubActiveRequestKey(defChainId, serviceName, bindChainId string, provider sdk.AccAddress) []byte
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis - store genesis parameters
func NewQuerier ¶
func PrepForZeroHeightGenesis ¶
refund deposit from all bindings refund service fee from all request refund all incoming/return fee no process for service fee tax account
func SvcBindingEqual ¶
func SvcBindingEqual(bindingA, bindingB SvcBinding) bool
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided service genesis state to ensure the expected invariants holds.
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 DefinitionOutput ¶
type DefinitionOutput struct { Definition SvcDef `json:"definition"` Methods []MethodProperty `json:"methods"` }
type FeesOutput ¶
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params"` // service params
}
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 ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis - output genesis parameters
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
type IncomingFee ¶
type IncomingFee struct { Address sdk.AccAddress `json:"address"` Coins sdk.Coins `json:"coins"` }
incoming fee of a consumer
func NewIncomingFee ¶
func NewIncomingFee(address sdk.AccAddress, coins sdk.Coins) IncomingFee
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) ActiveAllRequestQueueIterator ¶
Returns an iterator for all the request in the Active Queue
func (Keeper) ActiveBindRequestsIterator ¶
func (k Keeper) ActiveBindRequestsIterator(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress) sdk.Iterator
Returns an iterator for all the request in the Active Queue of specified service binding
func (Keeper) ActiveRequestQueueIterator ¶
Returns an iterator for all the request in the Active Queue that expire by block height
func (Keeper) AddActiveRequest ¶
func (k Keeper) AddActiveRequest(ctx sdk.Context, req SvcRequest)
func (Keeper) AddIncomingFee ¶
Add incoming fee for a particular provider, if it is not existed will create a new
func (Keeper) AddRequest ¶
func (k Keeper) AddRequest(ctx sdk.Context, req SvcRequest) (SvcRequest, sdk.Error)
func (Keeper) AddRequestExpiration ¶
func (k Keeper) AddRequestExpiration(ctx sdk.Context, req SvcRequest)
func (Keeper) AddResponse ¶
func (k Keeper) AddResponse(ctx sdk.Context, resp SvcResponse)
func (Keeper) AddReturnFee ¶
Add return fee for a particular consumer, if it is not existed will create a new
func (Keeper) AddServiceBinding ¶
func (Keeper) AddServiceDefinition ¶
func (Keeper) DeleteActiveRequest ¶
func (k Keeper) DeleteActiveRequest(ctx sdk.Context, req SvcRequest)
func (Keeper) DeleteRequestExpiration ¶
func (k Keeper) DeleteRequestExpiration(ctx sdk.Context, req SvcRequest)
func (Keeper) GetActiveRequest ¶
func (Keeper) GetIncomingFee ¶
func (k Keeper) GetIncomingFee(ctx sdk.Context, address sdk.AccAddress) (fee IncomingFee, found bool)
func (Keeper) GetIntraTxCounter ¶
get the current in-block request operation counter
func (Keeper) GetMethod ¶
func (k Keeper) GetMethod(ctx sdk.Context, chainId, name string, id int16) (method MethodProperty, found bool)
Gets the method in a specific service and methodID
func (Keeper) GetMethods ¶
Gets all the methods in a specific service
func (Keeper) GetParamSet ¶
get service params from the global param store
func (Keeper) GetResponse ¶
func (Keeper) GetReturnFee ¶
func (k Keeper) GetReturnFee(ctx sdk.Context, address sdk.AccAddress) (fee ReturnedFee, found bool)
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) InitMetrics ¶
func (Keeper) RefundDeposit ¶
func (Keeper) ServiceBindingsIterator ¶
func (Keeper) SetIncomingFee ¶
func (Keeper) SetIntraTxCounter ¶
set the current in-block request counter
func (Keeper) SetParamSet ¶
set service params from the global param store
func (Keeper) SetReturnFee ¶
func (Keeper) UpdateServiceBinding ¶
func (Keeper) WithdrawFee ¶
withdraw fees from a particular provider, and delete it
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 int16 `json:"id"` Name string `json:"name"` Description string `json:"description"` OutputPrivacy OutputPrivacyEnum `json:"output_privacy"` OutputCached OutputCachedEnum `json:"output_cached"` }
type Metrics ¶
func NopMetrics ¶
func NopMetrics() *Metrics
func PrometheusMetrics ¶
func PrometheusMetrics(config *cfg.InstrumentationConfig) *Metrics
PrometheusMetrics returns Metrics build using Prometheus client library.
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) EnsureLength ¶
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 MsgSvcRefundFees ¶
type MsgSvcRefundFees struct {
Consumer sdk.AccAddress `json:"consumer"`
}
MsgSvcRefundFees - struct for refund fees
func NewMsgSvcRefundFees ¶
func NewMsgSvcRefundFees(consumer sdk.AccAddress) MsgSvcRefundFees
func (MsgSvcRefundFees) GetSignBytes ¶
func (msg MsgSvcRefundFees) GetSignBytes() []byte
func (MsgSvcRefundFees) GetSigners ¶
func (msg MsgSvcRefundFees) GetSigners() []sdk.AccAddress
func (MsgSvcRefundFees) Route ¶
func (msg MsgSvcRefundFees) Route() string
func (MsgSvcRefundFees) Type ¶
func (msg MsgSvcRefundFees) Type() string
func (MsgSvcRefundFees) ValidateBasic ¶
func (msg MsgSvcRefundFees) ValidateBasic() sdk.Error
type MsgSvcRequest ¶
type MsgSvcRequest struct { DefChainID string `json:"def_chain_id"` DefName string `json:"def_name"` BindChainID string `json:"bind_chain_id"` ReqChainID string `json:"req_chain_id"` MethodID int16 `json:"method_id"` Provider sdk.AccAddress `json:"provider"` Consumer sdk.AccAddress `json:"consumer"` Input []byte `json:"input"` ServiceFee sdk.Coins `json:"service_fee"` Profiling bool `json:"profiling"` }
MsgSvcRequest - struct for call a service
func NewMsgSvcRequest ¶
func NewMsgSvcRequest(defChainID, defName, bindChainID, reqChainID string, consumer, provider sdk.AccAddress, methodID int16, input []byte, serviceFee sdk.Coins, profiling bool) MsgSvcRequest
func (MsgSvcRequest) GetSignBytes ¶
func (msg MsgSvcRequest) GetSignBytes() []byte
func (MsgSvcRequest) GetSigners ¶
func (msg MsgSvcRequest) GetSigners() []sdk.AccAddress
func (MsgSvcRequest) Route ¶
func (msg MsgSvcRequest) Route() string
func (MsgSvcRequest) Type ¶
func (msg MsgSvcRequest) Type() string
func (MsgSvcRequest) ValidateBasic ¶
func (msg MsgSvcRequest) ValidateBasic() sdk.Error
type MsgSvcResponse ¶
type MsgSvcResponse struct { ReqChainID string `json:"req_chain_id"` RequestID string `json:"request_id"` Provider sdk.AccAddress `json:"provider"` Output []byte `json:"output"` ErrorMsg []byte `json:"error_msg"` }
MsgSvcResponse - struct for respond a service call
func NewMsgSvcResponse ¶
func NewMsgSvcResponse(reqChainID string, requestId string, provider sdk.AccAddress, output, errorMsg []byte) MsgSvcResponse
func (MsgSvcResponse) GetSignBytes ¶
func (msg MsgSvcResponse) GetSignBytes() []byte
func (MsgSvcResponse) GetSigners ¶
func (msg MsgSvcResponse) GetSigners() []sdk.AccAddress
func (MsgSvcResponse) Route ¶
func (msg MsgSvcResponse) Route() string
func (MsgSvcResponse) Type ¶
func (msg MsgSvcResponse) Type() string
func (MsgSvcResponse) ValidateBasic ¶
func (msg MsgSvcResponse) ValidateBasic() sdk.Error
type MsgSvcWithdrawFees ¶
type MsgSvcWithdrawFees struct {
Provider sdk.AccAddress `json:"provider"`
}
MsgSvcWithdrawFees - struct for withdraw fees
func NewMsgSvcWithdrawFees ¶
func NewMsgSvcWithdrawFees(provider sdk.AccAddress) MsgSvcWithdrawFees
func (MsgSvcWithdrawFees) GetSignBytes ¶
func (msg MsgSvcWithdrawFees) GetSignBytes() []byte
func (MsgSvcWithdrawFees) GetSigners ¶
func (msg MsgSvcWithdrawFees) GetSigners() []sdk.AccAddress
func (MsgSvcWithdrawFees) Route ¶
func (msg MsgSvcWithdrawFees) Route() string
func (MsgSvcWithdrawFees) Type ¶
func (msg MsgSvcWithdrawFees) Type() string
func (MsgSvcWithdrawFees) ValidateBasic ¶
func (msg MsgSvcWithdrawFees) ValidateBasic() sdk.Error
type MsgSvcWithdrawTax ¶
type MsgSvcWithdrawTax struct { Trustee sdk.AccAddress `json:"trustee"` DestAddress sdk.AccAddress `json:"dest_address"` Amount sdk.Coins `json:"amount"` }
MsgSvcWithdrawTax - struct for withdraw tax
func NewMsgSvcWithdrawTax ¶
func NewMsgSvcWithdrawTax(trustee, destAddress sdk.AccAddress, amount sdk.Coins) MsgSvcWithdrawTax
func (MsgSvcWithdrawTax) GetSignBytes ¶
func (msg MsgSvcWithdrawTax) GetSignBytes() []byte
func (MsgSvcWithdrawTax) GetSigners ¶
func (msg MsgSvcWithdrawTax) GetSigners() []sdk.AccAddress
func (MsgSvcWithdrawTax) Route ¶
func (msg MsgSvcWithdrawTax) Route() string
func (MsgSvcWithdrawTax) Type ¶
func (msg MsgSvcWithdrawTax) Type() string
func (MsgSvcWithdrawTax) ValidateBasic ¶
func (msg MsgSvcWithdrawTax) 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 Params ¶
type Params struct { MaxRequestTimeout int64 `json:"max_request_timeout"` MinDepositMultiple int64 `json:"min_deposit_multiple"` ServiceFeeTax sdk.Dec `json:"service_fee_tax"` SlashFraction sdk.Dec `json:"slash_fraction"` ComplaintRetrospect time.Duration `json:"complaint_retrospect"` ArbitrationTimeLimit time.Duration `json:"arbitration_time_limit"` TxSizeLimit uint64 `json:"tx_size_limit"` }
service params
func DefaultParamsForTest ¶
func DefaultParamsForTest() Params
default service module params for test
func (*Params) GetParamSpace ¶
Implements params.ParamStruct
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
func (*Params) StringFromBytes ¶
type QueryBindingParams ¶
type QueryBindingParams struct { DefChainID string ServiceName string BindChainId string Provider sdk.AccAddress }
type QueryFeesParams ¶
type QueryFeesParams struct {
Address sdk.AccAddress
}
type QueryResponseParams ¶
type QueryServiceParams ¶
type ReturnedFee ¶
type ReturnedFee struct { Address sdk.AccAddress `json:"address"` Coins sdk.Coins `json:"coins"` }
return fee of a consumer
func NewReturnedFee ¶
func NewReturnedFee(address sdk.AccAddress, coins sdk.Coins) ReturnedFee
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"` DisableTime time.Time `json:"disable_time"` }
func NewSvcBinding ¶
func NewSvcBinding(ctx sdk.Context, defChainID, defName, bindChainID string, provider sdk.AccAddress, bindingType BindingType, deposit sdk.Coins, prices []sdk.Coin, level Level, available bool) SvcBinding
NewSvcBinding returns a new SvcBinding with the provided values.
type SvcDef ¶
type SvcRequest ¶
type SvcRequest struct { DefChainID string `json:"def_chain_id"` DefName string `json:"def_name"` BindChainID string `json:"bind_chain_id"` ReqChainID string `json:"req_chain_id"` MethodID int16 `json:"method_id"` Provider sdk.AccAddress `json:"provider"` Consumer sdk.AccAddress `json:"consumer"` Input []byte `json:"input"` ServiceFee sdk.Coins `json:"service_fee"` Profiling bool `json:"profiling"` // profiling model will be free of service charges RequestHeight int64 `json:"request_height"` // block height of service request RequestIntraTxCounter int16 `json:"request_intra_tx_counter"` // block-local tx index of service request ExpirationHeight int64 `json:"expiration_height"` // block height of the service request has expired }
func NewSvcRequest ¶
func NewSvcRequest(defChainID, defName, bindChainID, reqChainID string, consumer, provider sdk.AccAddress, methodID int16, input []byte, serviceFee sdk.Coins, profiling bool) SvcRequest
func (SvcRequest) RequestID ¶
func (req SvcRequest) RequestID() string
RequestID is of format request expirationHeight-requestHeight-intraTxCounter
type SvcResponse ¶
type SvcResponse struct { ReqChainID string `json:"req_chain_id"` RequestHeight int64 `json:"request_height"` RequestIntraTxCounter int16 `json:"request_intra_tx_counter"` ExpirationHeight int64 `json:"expiration_height"` Provider sdk.AccAddress `json:"provider"` Consumer sdk.AccAddress `json:"consumer"` Output []byte `json:"output"` ErrorMsg []byte `json:"error_msg"` }
func NewSvcResponse ¶
func NewSvcResponse(reqChainID string, eheight int64, rheight int64, counter int16, provider, consumer sdk.AccAddress, out []byte, errorMsg []byte) SvcResponse