types

package
v0.4.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeAddKey = "add_key"

	AttributePublicKey     = "public_key"
	AttributePubKeyIndex   = "public_key_index"
	AttributeValidatorAddr = "validator_address"
)
View Source
const (
	ModuleName = "pubkey"
	StoreKey
)

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 (
	ErrInvalidLengthPubkey        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPubkey          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPubkey = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var PubKeysPrefix = collections.NewPrefix(0)

Functions

func RegisterCodec

func RegisterCodec(_ *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type GenesisState

type GenesisState struct {
	ValidatorPubKeys []ValidatorPubKeys `protobuf:"bytes,1,rep,name=validator_pub_keys,json=validatorPubKeys,proto3" json:"validator_pub_keys"`
}

GenesisState defines pubkey module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

func NewGenesisState

func NewGenesisState(valPubKeys []ValidatorPubKeys) GenesisState

func (*GenesisState) Descriptor

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

func (*GenesisState) GetValidatorPubKeys

func (m *GenesisState) GetValidatorPubKeys() []ValidatorPubKeys

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) UnpackInterfaces

func (g GenesisState) UnpackInterfaces(c codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces.

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 IndexedPubKey

type IndexedPubKey struct {
	Index  uint32     `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
}

IndexPubKeyPair defines an index - public key pair.

func (*IndexedPubKey) Descriptor

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

func (*IndexedPubKey) GetIndex

func (m *IndexedPubKey) GetIndex() uint32

func (*IndexedPubKey) GetPubKey

func (m *IndexedPubKey) GetPubKey() *types.Any

func (*IndexedPubKey) Marshal

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

func (*IndexedPubKey) MarshalTo

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

func (*IndexedPubKey) MarshalToSizedBuffer

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

func (*IndexedPubKey) ProtoMessage

func (*IndexedPubKey) ProtoMessage()

func (*IndexedPubKey) Reset

func (m *IndexedPubKey) Reset()

func (*IndexedPubKey) Size

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

func (*IndexedPubKey) String

func (m *IndexedPubKey) String() string

func (*IndexedPubKey) Unmarshal

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

func (*IndexedPubKey) XXX_DiscardUnknown

func (m *IndexedPubKey) XXX_DiscardUnknown()

func (*IndexedPubKey) XXX_Marshal

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

func (*IndexedPubKey) XXX_Merge

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

func (*IndexedPubKey) XXX_Size

func (m *IndexedPubKey) XXX_Size() int

func (*IndexedPubKey) XXX_Unmarshal

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

type MsgAddKey

type MsgAddKey struct {
	ValidatorAddr  string          `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"`
	IndexedPubKeys []IndexedPubKey `protobuf:"bytes,2,rep,name=indexed_pub_keys,json=indexedPubKeys,proto3" json:"indexed_pub_keys"`
}

MsgAddKey defines a message for registering a new public key.

func (*MsgAddKey) Descriptor

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

func (*MsgAddKey) GetIndexedPubKeys

func (m *MsgAddKey) GetIndexedPubKeys() []IndexedPubKey

func (*MsgAddKey) GetValidatorAddr

func (m *MsgAddKey) GetValidatorAddr() string

func (*MsgAddKey) Marshal

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

func (*MsgAddKey) MarshalTo

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

func (*MsgAddKey) MarshalToSizedBuffer

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

func (*MsgAddKey) ProtoMessage

func (*MsgAddKey) ProtoMessage()

func (*MsgAddKey) Reset

func (m *MsgAddKey) Reset()

func (*MsgAddKey) Size

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

func (*MsgAddKey) String

func (m *MsgAddKey) String() string

func (*MsgAddKey) Unmarshal

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

func (*MsgAddKey) UnpackInterfaces

func (m *MsgAddKey) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*MsgAddKey) Validate

func (m *MsgAddKey) Validate() error

func (*MsgAddKey) XXX_DiscardUnknown

func (m *MsgAddKey) XXX_DiscardUnknown()

func (*MsgAddKey) XXX_Marshal

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

func (*MsgAddKey) XXX_Merge

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

func (*MsgAddKey) XXX_Size

func (m *MsgAddKey) XXX_Size() int

func (*MsgAddKey) XXX_Unmarshal

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

type MsgAddKeyResponse

type MsgAddKeyResponse struct {
}

MsgAddKeyResponse defines the Msg/MsgAddKey response type.

func (*MsgAddKeyResponse) Descriptor

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

func (*MsgAddKeyResponse) Marshal

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

func (*MsgAddKeyResponse) MarshalTo

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

func (*MsgAddKeyResponse) MarshalToSizedBuffer

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

func (*MsgAddKeyResponse) ProtoMessage

func (*MsgAddKeyResponse) ProtoMessage()

func (*MsgAddKeyResponse) Reset

func (m *MsgAddKeyResponse) Reset()

func (*MsgAddKeyResponse) Size

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

func (*MsgAddKeyResponse) String

func (m *MsgAddKeyResponse) String() string

func (*MsgAddKeyResponse) Unmarshal

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

func (*MsgAddKeyResponse) XXX_DiscardUnknown

func (m *MsgAddKeyResponse) XXX_DiscardUnknown()

func (*MsgAddKeyResponse) XXX_Marshal

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

func (*MsgAddKeyResponse) XXX_Merge

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

func (*MsgAddKeyResponse) XXX_Size

func (m *MsgAddKeyResponse) XXX_Size() int

func (*MsgAddKeyResponse) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	// AddKey defines a method for registering a new public key.
	AddKey(ctx context.Context, in *MsgAddKey, opts ...grpc.CallOption) (*MsgAddKeyResponse, 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 {
	// AddKey defines a method for registering a new public key.
	AddKey(context.Context, *MsgAddKey) (*MsgAddKeyResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// ValidatorKeys returns a given validator's registered keys.
	ValidatorKeys(ctx context.Context, in *QueryValidatorKeysRequest, opts ...grpc.CallOption) (*QueryValidatorKeysResponse, error)
}

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 {
	// ValidatorKeys returns a given validator's registered keys.
	ValidatorKeys(context.Context, *QueryValidatorKeysRequest) (*QueryValidatorKeysResponse, error)
}

QueryServer is the server API for Query service.

type QueryValidatorKeysRequest

type QueryValidatorKeysRequest struct {
	ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"`
}

QueryValidatorKeysRequest is request type for the Query/ValidatorKeys RPC method.

func (*QueryValidatorKeysRequest) Descriptor

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

func (*QueryValidatorKeysRequest) GetValidatorAddr

func (m *QueryValidatorKeysRequest) GetValidatorAddr() string

func (*QueryValidatorKeysRequest) Marshal

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

func (*QueryValidatorKeysRequest) MarshalTo

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

func (*QueryValidatorKeysRequest) MarshalToSizedBuffer

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

func (*QueryValidatorKeysRequest) ProtoMessage

func (*QueryValidatorKeysRequest) ProtoMessage()

func (*QueryValidatorKeysRequest) Reset

func (m *QueryValidatorKeysRequest) Reset()

func (*QueryValidatorKeysRequest) Size

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

func (*QueryValidatorKeysRequest) String

func (m *QueryValidatorKeysRequest) String() string

func (*QueryValidatorKeysRequest) Unmarshal

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

func (*QueryValidatorKeysRequest) XXX_DiscardUnknown

func (m *QueryValidatorKeysRequest) XXX_DiscardUnknown()

func (*QueryValidatorKeysRequest) XXX_Marshal

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

func (*QueryValidatorKeysRequest) XXX_Merge

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

func (*QueryValidatorKeysRequest) XXX_Size

func (m *QueryValidatorKeysRequest) XXX_Size() int

func (*QueryValidatorKeysRequest) XXX_Unmarshal

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

type QueryValidatorKeysResponse

type QueryValidatorKeysResponse struct {
	ValidatorPubKeys ValidatorPubKeys `protobuf:"bytes,1,opt,name=validator_pub_keys,json=validatorPubKeys,proto3" json:"validator_pub_keys"`
}

QueryValidatorKeysResponse is response type for the Query/ValidatorKeys RPC method.

func (*QueryValidatorKeysResponse) Descriptor

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

func (*QueryValidatorKeysResponse) GetValidatorPubKeys

func (m *QueryValidatorKeysResponse) GetValidatorPubKeys() ValidatorPubKeys

func (*QueryValidatorKeysResponse) Marshal

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

func (*QueryValidatorKeysResponse) MarshalTo

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

func (*QueryValidatorKeysResponse) MarshalToSizedBuffer

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

func (*QueryValidatorKeysResponse) ProtoMessage

func (*QueryValidatorKeysResponse) ProtoMessage()

func (*QueryValidatorKeysResponse) Reset

func (m *QueryValidatorKeysResponse) Reset()

func (*QueryValidatorKeysResponse) Size

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

func (*QueryValidatorKeysResponse) String

func (m *QueryValidatorKeysResponse) String() string

func (*QueryValidatorKeysResponse) Unmarshal

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

func (*QueryValidatorKeysResponse) XXX_DiscardUnknown

func (m *QueryValidatorKeysResponse) XXX_DiscardUnknown()

func (*QueryValidatorKeysResponse) XXX_Marshal

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

func (*QueryValidatorKeysResponse) XXX_Merge

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

func (*QueryValidatorKeysResponse) XXX_Size

func (m *QueryValidatorKeysResponse) XXX_Size() int

func (*QueryValidatorKeysResponse) XXX_Unmarshal

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

type StakingKeeper

type StakingKeeper interface {
	GetValidator(ctx context.Context, addr sdk.ValAddress) (validator types.Validator, err error)
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) AddKey

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) ValidatorKeys

type ValidatorPubKeys

type ValidatorPubKeys struct {
	ValidatorAddr  string          `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"`
	IndexedPubKeys []IndexedPubKey `protobuf:"bytes,2,rep,name=indexed_pub_keys,json=indexedPubKeys,proto3" json:"indexed_pub_keys"`
}

ValidatorPubKeys defines a validator's list of registered public keys primarily used in the x/pubkey genesis state.

func (*ValidatorPubKeys) Descriptor

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

func (*ValidatorPubKeys) GetIndexedPubKeys

func (m *ValidatorPubKeys) GetIndexedPubKeys() []IndexedPubKey

func (*ValidatorPubKeys) GetValidatorAddr

func (m *ValidatorPubKeys) GetValidatorAddr() string

func (*ValidatorPubKeys) Marshal

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

func (*ValidatorPubKeys) MarshalTo

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

func (*ValidatorPubKeys) MarshalToSizedBuffer

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

func (*ValidatorPubKeys) ProtoMessage

func (*ValidatorPubKeys) ProtoMessage()

func (*ValidatorPubKeys) Reset

func (m *ValidatorPubKeys) Reset()

func (*ValidatorPubKeys) Size

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

func (*ValidatorPubKeys) String

func (m *ValidatorPubKeys) String() string

func (*ValidatorPubKeys) Unmarshal

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

func (ValidatorPubKeys) UnpackInterfaces

func (v ValidatorPubKeys) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces.

func (*ValidatorPubKeys) XXX_DiscardUnknown

func (m *ValidatorPubKeys) XXX_DiscardUnknown()

func (*ValidatorPubKeys) XXX_Marshal

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

func (*ValidatorPubKeys) XXX_Merge

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

func (*ValidatorPubKeys) XXX_Size

func (m *ValidatorPubKeys) XXX_Size() int

func (*ValidatorPubKeys) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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