types

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0, Apache-2.0 Imports: 28 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AttributeKeyQueryId      = "query_id"
	AttributeKeyChainId      = "chain_id"
	AttributeKeyConnectionId = "connection_id"
	AttributeKeyType         = "type"
	AttributeKeyParams       = "parameters"
	AttributeKeyRequest      = "request"
	AttributeKeyHeight       = "height"

	AttributeValueCategory = ModuleName
	AttributeValueQuery    = "query"
)
View Source
const (
	// ModuleName defines the module name
	ModuleName = "interchainquery"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName
)
View Source
const (
	STAKING_STORE_QUERY_WITH_PROOF = "store/staking/key"
	BANK_STORE_QUERY_WITH_PROOF    = "store/bank/key"
)
View Source
const (
	TypeMsgSubmitQueryResponse = "submitqueryresponse"
)

interchainquery message types

Variables

View Source
var (
	ErrAlreadyFulfilled  = errors.New("query already fulfilled")
	ErrSucceededNoDelete = errors.New("query succeeded; do not not execute default behavior")
	ErrInvalidICQProof   = errors.New("icq query response failed")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyPrefixData  = []byte{prefixData}
	KeyPrefixQuery = []byte{prefixQuery}
)
View Source
var (
	ErrInvalidLengthMessages        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessages          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessages = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func KeyPrefix

func KeyPrefix(p string) []byte

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func RegisterMsgHandler

func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

RegisterMsgHandlerClient registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MsgClient" to call the correct interceptors.

func RegisterMsgHandlerFromEndpoint

func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMsgHandlerServer

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type DataPoint

type DataPoint struct {
	Id           string                                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	RemoteHeight github_com_cosmos_cosmos_sdk_types.Int `` /* 137-byte string literal not displayed */
	LocalHeight  github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
	Value        []byte                                 `protobuf:"bytes,4,opt,name=value,proto3" json:"result,omitempty"`
}

func (*DataPoint) Descriptor

func (*DataPoint) Descriptor() ([]byte, []int)

func (*DataPoint) GetId

func (m *DataPoint) GetId() string

func (*DataPoint) GetValue

func (m *DataPoint) GetValue() []byte

func (*DataPoint) Marshal

func (m *DataPoint) Marshal() (dAtA []byte, err error)

func (*DataPoint) MarshalTo

func (m *DataPoint) MarshalTo(dAtA []byte) (int, error)

func (*DataPoint) MarshalToSizedBuffer

func (m *DataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DataPoint) ProtoMessage

func (*DataPoint) ProtoMessage()

func (*DataPoint) Reset

func (m *DataPoint) Reset()

func (*DataPoint) Size

func (m *DataPoint) Size() (n int)

func (*DataPoint) String

func (m *DataPoint) String() string

func (*DataPoint) Unmarshal

func (m *DataPoint) Unmarshal(dAtA []byte) error

func (*DataPoint) XXX_DiscardUnknown

func (m *DataPoint) XXX_DiscardUnknown()

func (*DataPoint) XXX_Marshal

func (m *DataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataPoint) XXX_Merge

func (m *DataPoint) XXX_Merge(src proto.Message)

func (*DataPoint) XXX_Size

func (m *DataPoint) XXX_Size() int

func (*DataPoint) XXX_Unmarshal

func (m *DataPoint) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Queries []Query `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries"`
}

GenesisState defines the epochs module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func NewGenesisState

func NewGenesisState(queries []Query) *GenesisState

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetQueries

func (m *GenesisState) GetQueries() []Query

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// SubmitQueryResponse defines a method for submit query responses.
	SubmitQueryResponse(ctx context.Context, in *MsgSubmitQueryResponse, opts ...grpc.CallOption) (*MsgSubmitQueryResponseResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// SubmitQueryResponse defines a method for submit query responses.
	SubmitQueryResponse(context.Context, *MsgSubmitQueryResponse) (*MsgSubmitQueryResponseResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSubmitQueryResponse

type MsgSubmitQueryResponse struct {
	ChainId     string           `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"`
	QueryId     string           `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty" yaml:"query_id"`
	Result      []byte           `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty" yaml:"result"`
	ProofOps    *crypto.ProofOps `protobuf:"bytes,4,opt,name=proof_ops,json=proofOps,proto3" json:"proof_ops,omitempty" yaml:"proof_ops"`
	Height      int64            `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty" yaml:"height"`
	FromAddress string           `protobuf:"bytes,6,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"`
}

MsgSubmitQueryResponse represents a message type to fulfil a query request.

func (*MsgSubmitQueryResponse) Descriptor

func (*MsgSubmitQueryResponse) Descriptor() ([]byte, []int)

func (MsgSubmitQueryResponse) GetSignBytes

func (msg MsgSubmitQueryResponse) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgSubmitQueryResponse) GetSigners

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

GetSigners Implements Msg.

func (*MsgSubmitQueryResponse) Marshal

func (m *MsgSubmitQueryResponse) Marshal() (dAtA []byte, err error)

func (*MsgSubmitQueryResponse) MarshalTo

func (m *MsgSubmitQueryResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSubmitQueryResponse) MarshalToSizedBuffer

func (m *MsgSubmitQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSubmitQueryResponse) ProtoMessage

func (*MsgSubmitQueryResponse) ProtoMessage()

func (*MsgSubmitQueryResponse) Reset

func (m *MsgSubmitQueryResponse) Reset()

func (MsgSubmitQueryResponse) Route

func (msg MsgSubmitQueryResponse) Route() string

Route Implements Msg.

func (*MsgSubmitQueryResponse) Size

func (m *MsgSubmitQueryResponse) Size() (n int)

func (*MsgSubmitQueryResponse) String

func (m *MsgSubmitQueryResponse) String() string

func (MsgSubmitQueryResponse) Type

func (msg MsgSubmitQueryResponse) Type() string

Type Implements Msg.

func (*MsgSubmitQueryResponse) Unmarshal

func (m *MsgSubmitQueryResponse) Unmarshal(dAtA []byte) error

func (MsgSubmitQueryResponse) ValidateBasic

func (msg MsgSubmitQueryResponse) ValidateBasic() error

ValidateBasic Implements Msg.

func (*MsgSubmitQueryResponse) XXX_DiscardUnknown

func (m *MsgSubmitQueryResponse) XXX_DiscardUnknown()

func (*MsgSubmitQueryResponse) XXX_Marshal

func (m *MsgSubmitQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitQueryResponse) XXX_Merge

func (m *MsgSubmitQueryResponse) XXX_Merge(src proto.Message)

func (*MsgSubmitQueryResponse) XXX_Size

func (m *MsgSubmitQueryResponse) XXX_Size() int

func (*MsgSubmitQueryResponse) XXX_Unmarshal

func (m *MsgSubmitQueryResponse) XXX_Unmarshal(b []byte) error

type MsgSubmitQueryResponseResponse

type MsgSubmitQueryResponseResponse struct {
}

MsgSubmitQueryResponseResponse defines the MsgSubmitQueryResponse response type.

func (*MsgSubmitQueryResponseResponse) Descriptor

func (*MsgSubmitQueryResponseResponse) Descriptor() ([]byte, []int)

func (*MsgSubmitQueryResponseResponse) Marshal

func (m *MsgSubmitQueryResponseResponse) Marshal() (dAtA []byte, err error)

func (*MsgSubmitQueryResponseResponse) MarshalTo

func (m *MsgSubmitQueryResponseResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSubmitQueryResponseResponse) MarshalToSizedBuffer

func (m *MsgSubmitQueryResponseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSubmitQueryResponseResponse) ProtoMessage

func (*MsgSubmitQueryResponseResponse) ProtoMessage()

func (*MsgSubmitQueryResponseResponse) Reset

func (m *MsgSubmitQueryResponseResponse) Reset()

func (*MsgSubmitQueryResponseResponse) Size

func (m *MsgSubmitQueryResponseResponse) Size() (n int)

func (*MsgSubmitQueryResponseResponse) String

func (*MsgSubmitQueryResponseResponse) Unmarshal

func (m *MsgSubmitQueryResponseResponse) Unmarshal(dAtA []byte) error

func (*MsgSubmitQueryResponseResponse) XXX_DiscardUnknown

func (m *MsgSubmitQueryResponseResponse) XXX_DiscardUnknown()

func (*MsgSubmitQueryResponseResponse) XXX_Marshal

func (m *MsgSubmitQueryResponseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitQueryResponseResponse) XXX_Merge

func (m *MsgSubmitQueryResponseResponse) XXX_Merge(src proto.Message)

func (*MsgSubmitQueryResponseResponse) XXX_Size

func (m *MsgSubmitQueryResponseResponse) XXX_Size() int

func (*MsgSubmitQueryResponseResponse) XXX_Unmarshal

func (m *MsgSubmitQueryResponseResponse) XXX_Unmarshal(b []byte) error

type Query

type Query struct {
	Id           string                                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ConnectionId string                                 `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
	ChainId      string                                 `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	QueryType    string                                 `protobuf:"bytes,4,opt,name=query_type,json=queryType,proto3" json:"query_type,omitempty"`
	Request      []byte                                 `protobuf:"bytes,5,opt,name=request,proto3" json:"request,omitempty"`
	Period       github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=period,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"period"`
	LastHeight   github_com_cosmos_cosmos_sdk_types.Int `` /* 131-byte string literal not displayed */
	CallbackId   string                                 `protobuf:"bytes,8,opt,name=callback_id,json=callbackId,proto3" json:"callback_id,omitempty"`
	Ttl          uint64                                 `protobuf:"varint,9,opt,name=ttl,proto3" json:"ttl,omitempty"`
	Height       int64                                  `protobuf:"varint,10,opt,name=height,proto3" json:"height,omitempty"`
}

func (*Query) Descriptor

func (*Query) Descriptor() ([]byte, []int)

func (*Query) GetCallbackId added in v0.0.6

func (m *Query) GetCallbackId() string

func (*Query) GetChainId

func (m *Query) GetChainId() string

func (*Query) GetConnectionId

func (m *Query) GetConnectionId() string

func (*Query) GetHeight added in v0.0.7

func (m *Query) GetHeight() int64

func (*Query) GetId

func (m *Query) GetId() string

func (*Query) GetQueryType

func (m *Query) GetQueryType() string

func (*Query) GetRequest added in v0.0.6

func (m *Query) GetRequest() []byte

func (*Query) GetTtl added in v0.0.6

func (m *Query) GetTtl() uint64

func (*Query) Marshal

func (m *Query) Marshal() (dAtA []byte, err error)

func (*Query) MarshalTo

func (m *Query) MarshalTo(dAtA []byte) (int, error)

func (*Query) MarshalToSizedBuffer

func (m *Query) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) Size

func (m *Query) Size() (n int)

func (*Query) String

func (m *Query) String() string

func (*Query) Unmarshal

func (m *Query) Unmarshal(dAtA []byte) error

func (*Query) XXX_DiscardUnknown

func (m *Query) XXX_DiscardUnknown()

func (*Query) XXX_Marshal

func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Query) XXX_Merge

func (m *Query) XXX_Merge(src proto.Message)

func (*Query) XXX_Size

func (m *Query) XXX_Size() int

func (*Query) XXX_Unmarshal

func (m *Query) XXX_Unmarshal(b []byte) error

type QueryCallbacks

type QueryCallbacks interface {
	AddCallback(id string, fn interface{}) QueryCallbacks
	RegisterCallbacks() QueryCallbacks
	Call(ctx sdk.Context, id string, args []byte, query Query) error
	Has(id string) bool
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) SubmitQueryResponse

Jump to

Keyboard shortcuts

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