types

package
v2.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ModuleName = "signal"

	StoreKey     = ModuleName
	QuerierRoute = ModuleName
	RouterKey    = ModuleName

	URLMsgSignalVersion = "/celestia.signal.v1.Msg/SignalVersion"
	URLMsgTryUpgrade    = "/celestia.signal.v1.Msg/TryUpgrade"
)

Variables

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 ErrInvalidVersion = errors.Register(ModuleName, 1, "signalled version must be either the current version or one greater")

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers the upgrade module types on the provided registry.

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the upgrade types on the provided LegacyAmino codec.

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)

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)

Types

type MsgClient

type MsgClient interface {
	// SignalVersion allows a validator to signal for an upgrade.
	SignalVersion(ctx context.Context, in *MsgSignalVersion, opts ...grpc.CallOption) (*MsgSignalVersionResponse, error)
	// TryUpgrade tallies all the votes and if a quorum is reached, it will
	// trigger an upgrade for the following height.
	TryUpgrade(ctx context.Context, in *MsgTryUpgrade, opts ...grpc.CallOption) (*MsgTryUpgradeResponse, 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 {
	// SignalVersion allows a validator to signal for an upgrade.
	SignalVersion(context.Context, *MsgSignalVersion) (*MsgSignalVersionResponse, error)
	// TryUpgrade tallies all the votes and if a quorum is reached, it will
	// trigger an upgrade for the following height.
	TryUpgrade(context.Context, *MsgTryUpgrade) (*MsgTryUpgradeResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSignalVersion

type MsgSignalVersion struct {
	ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
	Version          uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}

MsgSignalVersion signals for an upgrade.

func NewMsgSignalVersion

func NewMsgSignalVersion(valAddress sdk.ValAddress, version uint64) *MsgSignalVersion

func (*MsgSignalVersion) Descriptor

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

func (*MsgSignalVersion) GetSignBytes

func (msg *MsgSignalVersion) GetSignBytes() []byte

GetSignBytes implements legacytx.LegacyMsg.

func (*MsgSignalVersion) GetSigners

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

func (*MsgSignalVersion) GetValidatorAddress

func (m *MsgSignalVersion) GetValidatorAddress() string

func (*MsgSignalVersion) GetVersion

func (m *MsgSignalVersion) GetVersion() uint64

func (*MsgSignalVersion) Marshal

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

func (*MsgSignalVersion) MarshalTo

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

func (*MsgSignalVersion) MarshalToSizedBuffer

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

func (*MsgSignalVersion) ProtoMessage

func (*MsgSignalVersion) ProtoMessage()

func (*MsgSignalVersion) Reset

func (m *MsgSignalVersion) Reset()

func (*MsgSignalVersion) Route

func (msg *MsgSignalVersion) Route() string

Route implements legacytx.LegacyMsg.

func (*MsgSignalVersion) Size

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

func (*MsgSignalVersion) String

func (m *MsgSignalVersion) String() string

func (*MsgSignalVersion) Type

func (msg *MsgSignalVersion) Type() string

Type implements legacytx.LegacyMsg.

func (*MsgSignalVersion) Unmarshal

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

func (*MsgSignalVersion) ValidateBasic

func (msg *MsgSignalVersion) ValidateBasic() error

func (*MsgSignalVersion) XXX_DiscardUnknown

func (m *MsgSignalVersion) XXX_DiscardUnknown()

func (*MsgSignalVersion) XXX_Marshal

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

func (*MsgSignalVersion) XXX_Merge

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

func (*MsgSignalVersion) XXX_Size

func (m *MsgSignalVersion) XXX_Size() int

func (*MsgSignalVersion) XXX_Unmarshal

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

type MsgSignalVersionResponse

type MsgSignalVersionResponse struct {
}

MsgSignalVersionResponse is the response type for the SignalVersion method.

func (*MsgSignalVersionResponse) Descriptor

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

func (*MsgSignalVersionResponse) Marshal

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

func (*MsgSignalVersionResponse) MarshalTo

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

func (*MsgSignalVersionResponse) MarshalToSizedBuffer

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

func (*MsgSignalVersionResponse) ProtoMessage

func (*MsgSignalVersionResponse) ProtoMessage()

func (*MsgSignalVersionResponse) Reset

func (m *MsgSignalVersionResponse) Reset()

func (*MsgSignalVersionResponse) Size

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

func (*MsgSignalVersionResponse) String

func (m *MsgSignalVersionResponse) String() string

func (*MsgSignalVersionResponse) Unmarshal

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

func (*MsgSignalVersionResponse) XXX_DiscardUnknown

func (m *MsgSignalVersionResponse) XXX_DiscardUnknown()

func (*MsgSignalVersionResponse) XXX_Marshal

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

func (*MsgSignalVersionResponse) XXX_Merge

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

func (*MsgSignalVersionResponse) XXX_Size

func (m *MsgSignalVersionResponse) XXX_Size() int

func (*MsgSignalVersionResponse) XXX_Unmarshal

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

type MsgTryUpgrade

type MsgTryUpgrade struct {
	Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
}

MsgTryUpgrade tries to upgrade the chain.

func NewMsgTryUpgrade

func NewMsgTryUpgrade(signer sdk.AccAddress) *MsgTryUpgrade

func (*MsgTryUpgrade) Descriptor

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

func (*MsgTryUpgrade) GetSignBytes

func (msg *MsgTryUpgrade) GetSignBytes() []byte

GetSignBytes implements legacytx.LegacyMsg.

func (*MsgTryUpgrade) GetSigner

func (m *MsgTryUpgrade) GetSigner() string

func (*MsgTryUpgrade) GetSigners

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

func (*MsgTryUpgrade) Marshal

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

func (*MsgTryUpgrade) MarshalTo

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

func (*MsgTryUpgrade) MarshalToSizedBuffer

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

func (*MsgTryUpgrade) ProtoMessage

func (*MsgTryUpgrade) ProtoMessage()

func (*MsgTryUpgrade) Reset

func (m *MsgTryUpgrade) Reset()

func (*MsgTryUpgrade) Route

func (msg *MsgTryUpgrade) Route() string

Route implements legacytx.LegacyMsg.

func (*MsgTryUpgrade) Size

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

func (*MsgTryUpgrade) String

func (m *MsgTryUpgrade) String() string

func (*MsgTryUpgrade) Type

func (msg *MsgTryUpgrade) Type() string

Type implements legacytx.LegacyMsg.

func (*MsgTryUpgrade) Unmarshal

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

func (*MsgTryUpgrade) ValidateBasic

func (msg *MsgTryUpgrade) ValidateBasic() error

func (*MsgTryUpgrade) XXX_DiscardUnknown

func (m *MsgTryUpgrade) XXX_DiscardUnknown()

func (*MsgTryUpgrade) XXX_Marshal

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

func (*MsgTryUpgrade) XXX_Merge

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

func (*MsgTryUpgrade) XXX_Size

func (m *MsgTryUpgrade) XXX_Size() int

func (*MsgTryUpgrade) XXX_Unmarshal

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

type MsgTryUpgradeResponse

type MsgTryUpgradeResponse struct {
}

MsgTryUpgradeResponse is the response type for the TryUpgrade method.

func (*MsgTryUpgradeResponse) Descriptor

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

func (*MsgTryUpgradeResponse) Marshal

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

func (*MsgTryUpgradeResponse) MarshalTo

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

func (*MsgTryUpgradeResponse) MarshalToSizedBuffer

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

func (*MsgTryUpgradeResponse) ProtoMessage

func (*MsgTryUpgradeResponse) ProtoMessage()

func (*MsgTryUpgradeResponse) Reset

func (m *MsgTryUpgradeResponse) Reset()

func (*MsgTryUpgradeResponse) Size

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

func (*MsgTryUpgradeResponse) String

func (m *MsgTryUpgradeResponse) String() string

func (*MsgTryUpgradeResponse) Unmarshal

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

func (*MsgTryUpgradeResponse) XXX_DiscardUnknown

func (m *MsgTryUpgradeResponse) XXX_DiscardUnknown()

func (*MsgTryUpgradeResponse) XXX_Marshal

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

func (*MsgTryUpgradeResponse) XXX_Merge

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

func (*MsgTryUpgradeResponse) XXX_Size

func (m *MsgTryUpgradeResponse) XXX_Size() int

func (*MsgTryUpgradeResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// VersionTally enables a client to query for the tally of voting power has
	// signalled for a particular version.
	VersionTally(ctx context.Context, in *QueryVersionTallyRequest, opts ...grpc.CallOption) (*QueryVersionTallyResponse, 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 {
	// VersionTally enables a client to query for the tally of voting power has
	// signalled for a particular version.
	VersionTally(context.Context, *QueryVersionTallyRequest) (*QueryVersionTallyResponse, error)
}

QueryServer is the server API for Query service.

type QueryVersionTallyRequest

type QueryVersionTallyRequest struct {
	Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
}

QueryVersionTallyRequest is the request type for the VersionTally query.

func (*QueryVersionTallyRequest) Descriptor

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

func (*QueryVersionTallyRequest) GetVersion

func (m *QueryVersionTallyRequest) GetVersion() uint64

func (*QueryVersionTallyRequest) Marshal

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

func (*QueryVersionTallyRequest) MarshalTo

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

func (*QueryVersionTallyRequest) MarshalToSizedBuffer

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

func (*QueryVersionTallyRequest) ProtoMessage

func (*QueryVersionTallyRequest) ProtoMessage()

func (*QueryVersionTallyRequest) Reset

func (m *QueryVersionTallyRequest) Reset()

func (*QueryVersionTallyRequest) Size

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

func (*QueryVersionTallyRequest) String

func (m *QueryVersionTallyRequest) String() string

func (*QueryVersionTallyRequest) Unmarshal

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

func (*QueryVersionTallyRequest) XXX_DiscardUnknown

func (m *QueryVersionTallyRequest) XXX_DiscardUnknown()

func (*QueryVersionTallyRequest) XXX_Marshal

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

func (*QueryVersionTallyRequest) XXX_Merge

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

func (*QueryVersionTallyRequest) XXX_Size

func (m *QueryVersionTallyRequest) XXX_Size() int

func (*QueryVersionTallyRequest) XXX_Unmarshal

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

type QueryVersionTallyResponse

type QueryVersionTallyResponse struct {
	VotingPower      uint64 `protobuf:"varint,1,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
	ThresholdPower   uint64 `protobuf:"varint,2,opt,name=threshold_power,json=thresholdPower,proto3" json:"threshold_power,omitempty"`
	TotalVotingPower uint64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"`
}

QueryVersionTallyResponse is the response type for the VersionTally query.

func (*QueryVersionTallyResponse) Descriptor

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

func (*QueryVersionTallyResponse) GetThresholdPower

func (m *QueryVersionTallyResponse) GetThresholdPower() uint64

func (*QueryVersionTallyResponse) GetTotalVotingPower

func (m *QueryVersionTallyResponse) GetTotalVotingPower() uint64

func (*QueryVersionTallyResponse) GetVotingPower

func (m *QueryVersionTallyResponse) GetVotingPower() uint64

func (*QueryVersionTallyResponse) Marshal

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

func (*QueryVersionTallyResponse) MarshalTo

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

func (*QueryVersionTallyResponse) MarshalToSizedBuffer

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

func (*QueryVersionTallyResponse) ProtoMessage

func (*QueryVersionTallyResponse) ProtoMessage()

func (*QueryVersionTallyResponse) Reset

func (m *QueryVersionTallyResponse) Reset()

func (*QueryVersionTallyResponse) Size

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

func (*QueryVersionTallyResponse) String

func (m *QueryVersionTallyResponse) String() string

func (*QueryVersionTallyResponse) Unmarshal

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

func (*QueryVersionTallyResponse) XXX_DiscardUnknown

func (m *QueryVersionTallyResponse) XXX_DiscardUnknown()

func (*QueryVersionTallyResponse) XXX_Marshal

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

func (*QueryVersionTallyResponse) XXX_Merge

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

func (*QueryVersionTallyResponse) XXX_Size

func (m *QueryVersionTallyResponse) XXX_Size() int

func (*QueryVersionTallyResponse) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) SignalVersion

func (*UnimplementedMsgServer) TryUpgrade

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) VersionTally

Jump to

Keyboard shortcuts

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