types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 23 Imported by: 15

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "gqb"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey is the module name router key
	RouterKey = ModuleName

	// QuerierRoute to be used for querierer msgs
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_payment"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

Variables

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 (
	ErrInvalidLengthMsgs        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsgs          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type GenesisState

type GenesisState struct {
}

GenesisState defines the capability module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func (*GenesisState) Descriptor

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

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 {
	// ValsetConfirm allows the validators to submit their signatures over the validator set.
	ValsetConfirm(ctx context.Context, in *MsgValsetConfirm, opts ...grpc.CallOption) (*MsgValsetConfirmResponse, error)
	// DataCommitmentConfirm allows the validators to submit a confirmation for a data commitment.
	DataCommitmentConfirm(ctx context.Context, in *MsgDataCommitmentConfirm, opts ...grpc.CallOption) (*MsgDataCommitmentConfirmResponse, 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 MsgDataCommitmentConfirm

type MsgDataCommitmentConfirm struct {
}

MsgDataCommitmentConfirm describes a data commitment for a set of blocks.

func (*MsgDataCommitmentConfirm) Descriptor

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

func (*MsgDataCommitmentConfirm) GetSigners

func (msg *MsgDataCommitmentConfirm) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgDataCommitmentConfirm) Marshal

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

func (*MsgDataCommitmentConfirm) MarshalTo

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

func (*MsgDataCommitmentConfirm) MarshalToSizedBuffer

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

func (*MsgDataCommitmentConfirm) ProtoMessage

func (*MsgDataCommitmentConfirm) ProtoMessage()

func (*MsgDataCommitmentConfirm) Reset

func (m *MsgDataCommitmentConfirm) Reset()

func (*MsgDataCommitmentConfirm) Size

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

func (*MsgDataCommitmentConfirm) String

func (m *MsgDataCommitmentConfirm) String() string

func (*MsgDataCommitmentConfirm) Unmarshal

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

func (*MsgDataCommitmentConfirm) ValidateBasic

func (msg *MsgDataCommitmentConfirm) ValidateBasic() error

ValidateBasic

func (*MsgDataCommitmentConfirm) XXX_DiscardUnknown

func (m *MsgDataCommitmentConfirm) XXX_DiscardUnknown()

func (*MsgDataCommitmentConfirm) XXX_Marshal

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

func (*MsgDataCommitmentConfirm) XXX_Merge

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

func (*MsgDataCommitmentConfirm) XXX_Size

func (m *MsgDataCommitmentConfirm) XXX_Size() int

func (*MsgDataCommitmentConfirm) XXX_Unmarshal

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

type MsgDataCommitmentConfirmResponse

type MsgDataCommitmentConfirmResponse struct {
}

MsgValsetConfirmResponse describes the response returned after the submission of a MsgDataCommitmentConfirm.

func (*MsgDataCommitmentConfirmResponse) Descriptor

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

func (*MsgDataCommitmentConfirmResponse) Marshal

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

func (*MsgDataCommitmentConfirmResponse) MarshalTo

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

func (*MsgDataCommitmentConfirmResponse) MarshalToSizedBuffer

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

func (*MsgDataCommitmentConfirmResponse) ProtoMessage

func (*MsgDataCommitmentConfirmResponse) ProtoMessage()

func (*MsgDataCommitmentConfirmResponse) Reset

func (*MsgDataCommitmentConfirmResponse) Size

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

func (*MsgDataCommitmentConfirmResponse) String

func (*MsgDataCommitmentConfirmResponse) Unmarshal

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

func (*MsgDataCommitmentConfirmResponse) XXX_DiscardUnknown

func (m *MsgDataCommitmentConfirmResponse) XXX_DiscardUnknown()

func (*MsgDataCommitmentConfirmResponse) XXX_Marshal

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

func (*MsgDataCommitmentConfirmResponse) XXX_Merge

func (*MsgDataCommitmentConfirmResponse) XXX_Size

func (m *MsgDataCommitmentConfirmResponse) XXX_Size() int

func (*MsgDataCommitmentConfirmResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// ValsetConfirm allows the validators to submit their signatures over the validator set.
	ValsetConfirm(context.Context, *MsgValsetConfirm) (*MsgValsetConfirmResponse, error)
	// DataCommitmentConfirm allows the validators to submit a confirmation for a data commitment.
	DataCommitmentConfirm(context.Context, *MsgDataCommitmentConfirm) (*MsgDataCommitmentConfirmResponse, error)
}

MsgServer is the server API for Msg service.

type MsgValsetConfirm

type MsgValsetConfirm struct {
	Nonce        uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Orchestrator string `protobuf:"bytes,2,opt,name=orchestrator,proto3" json:"orchestrator,omitempty"`
	EthAddress   string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"`
	Signature    string `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
}

MsgValsetConfirm this is the message sent by the validators when they wish to submit their signatures over the validator set at a given block height. A validator must first call MsgSetEthAddress to set their Ethereum address to be used for signing. Then someone (anyone) must make a ValsetRequest, the request is essentially a messaging mechanism to determine which block all validators should submit signatures over. Finally validators sign the validator set, powers, and Ethereum addresses of the entire validator set at the height of a ValsetRequest and submit that signature with this message.

If a sufficient number of validators (66% of voting power) (A) have set Ethereum addresses and (B) submit ValsetConfirm messages with their signatures it is then possible for anyone to view these signatures in the chain store and submit them to Ethereum to update the validator set -------------

func (*MsgValsetConfirm) Descriptor

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

func (*MsgValsetConfirm) GetEthAddress

func (m *MsgValsetConfirm) GetEthAddress() string

func (*MsgValsetConfirm) GetNonce

func (m *MsgValsetConfirm) GetNonce() uint64

func (*MsgValsetConfirm) GetOrchestrator

func (m *MsgValsetConfirm) GetOrchestrator() string

func (*MsgValsetConfirm) GetSignature

func (m *MsgValsetConfirm) GetSignature() string

func (*MsgValsetConfirm) GetSigners

func (msg *MsgValsetConfirm) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgValsetConfirm) Marshal

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

func (*MsgValsetConfirm) MarshalTo

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

func (*MsgValsetConfirm) MarshalToSizedBuffer

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

func (*MsgValsetConfirm) ProtoMessage

func (*MsgValsetConfirm) ProtoMessage()

func (*MsgValsetConfirm) Reset

func (m *MsgValsetConfirm) Reset()

func (*MsgValsetConfirm) Size

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

func (*MsgValsetConfirm) String

func (m *MsgValsetConfirm) String() string

func (*MsgValsetConfirm) Unmarshal

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

func (*MsgValsetConfirm) ValidateBasic

func (msg *MsgValsetConfirm) ValidateBasic() error

ValidateBasic

func (*MsgValsetConfirm) XXX_DiscardUnknown

func (m *MsgValsetConfirm) XXX_DiscardUnknown()

func (*MsgValsetConfirm) XXX_Marshal

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

func (*MsgValsetConfirm) XXX_Merge

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

func (*MsgValsetConfirm) XXX_Size

func (m *MsgValsetConfirm) XXX_Size() int

func (*MsgValsetConfirm) XXX_Unmarshal

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

type MsgValsetConfirmResponse

type MsgValsetConfirmResponse struct {
}

MsgValsetConfirmResponse describes the response returned after the submission of a MsgValsetConfirm.

func (*MsgValsetConfirmResponse) Descriptor

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

func (*MsgValsetConfirmResponse) Marshal

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

func (*MsgValsetConfirmResponse) MarshalTo

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

func (*MsgValsetConfirmResponse) MarshalToSizedBuffer

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

func (*MsgValsetConfirmResponse) ProtoMessage

func (*MsgValsetConfirmResponse) ProtoMessage()

func (*MsgValsetConfirmResponse) Reset

func (m *MsgValsetConfirmResponse) Reset()

func (*MsgValsetConfirmResponse) Size

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

func (*MsgValsetConfirmResponse) String

func (m *MsgValsetConfirmResponse) String() string

func (*MsgValsetConfirmResponse) Unmarshal

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

func (*MsgValsetConfirmResponse) XXX_DiscardUnknown

func (m *MsgValsetConfirmResponse) XXX_DiscardUnknown()

func (*MsgValsetConfirmResponse) XXX_Marshal

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

func (*MsgValsetConfirmResponse) XXX_Merge

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

func (*MsgValsetConfirmResponse) XXX_Size

func (m *MsgValsetConfirmResponse) XXX_Size() int

func (*MsgValsetConfirmResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) DataCommitmentConfirm

func (*UnimplementedMsgServer) ValsetConfirm

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

Jump to

Keyboard shortcuts

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