types

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "randomness"

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

	// RouterKey defines the module's message routing key
	RouterKey = ModuleName
)
View Source
const DefaultSeed = "sedouards"

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 (
	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 (
	ErrInvalidLengthRandomness        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRandomness          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRandomness = 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")
)

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

ValidateGenesis ensures validity of given randomness genesis state.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
	SetAccount(ctx context.Context, acc sdk.AccountI)
}

type GenesisState

type GenesisState struct {
	Seed string `protobuf:"bytes,1,opt,name=seed,proto3" json:"seed,omitempty"`
}

GenesisState defines the randomness module's genesis state with a seed.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns default state for randomness module.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetSeed

func (m *GenesisState) GetSeed() string

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) 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 {
	// NewSeed defines a method for submitting a new seed to the chain.
	NewSeed(ctx context.Context, in *MsgNewSeed, opts ...grpc.CallOption) (*MsgNewSeedResponse, 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 MsgNewSeed

type MsgNewSeed struct {
	Prover string `protobuf:"bytes,1,opt,name=prover,proto3" json:"prover,omitempty"`
	Pi     string `protobuf:"bytes,2,opt,name=pi,proto3" json:"pi,omitempty"`
	Beta   string `protobuf:"bytes,3,opt,name=beta,proto3" json:"beta,omitempty"`
}

The message for submitting a new seed to the chain.

func (*MsgNewSeed) Descriptor

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

func (*MsgNewSeed) GetBeta

func (m *MsgNewSeed) GetBeta() string

func (*MsgNewSeed) GetPi

func (m *MsgNewSeed) GetPi() string

func (*MsgNewSeed) GetProver

func (m *MsgNewSeed) GetProver() string

func (*MsgNewSeed) Marshal

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

func (*MsgNewSeed) MarshalTo

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

func (*MsgNewSeed) MarshalToSizedBuffer

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

func (*MsgNewSeed) ProtoMessage

func (*MsgNewSeed) ProtoMessage()

func (*MsgNewSeed) Reset

func (m *MsgNewSeed) Reset()

func (*MsgNewSeed) Size

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

func (*MsgNewSeed) String

func (m *MsgNewSeed) String() string

func (*MsgNewSeed) Unmarshal

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

func (*MsgNewSeed) XXX_DiscardUnknown

func (m *MsgNewSeed) XXX_DiscardUnknown()

func (*MsgNewSeed) XXX_Marshal

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

func (*MsgNewSeed) XXX_Merge

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

func (*MsgNewSeed) XXX_Size

func (m *MsgNewSeed) XXX_Size() int

func (*MsgNewSeed) XXX_Unmarshal

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

type MsgNewSeedResponse

type MsgNewSeedResponse struct {
}

The response message for submitting a new seed to the chain.

func (*MsgNewSeedResponse) Descriptor

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

func (*MsgNewSeedResponse) Marshal

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

func (*MsgNewSeedResponse) MarshalTo

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

func (*MsgNewSeedResponse) MarshalToSizedBuffer

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

func (*MsgNewSeedResponse) ProtoMessage

func (*MsgNewSeedResponse) ProtoMessage()

func (*MsgNewSeedResponse) Reset

func (m *MsgNewSeedResponse) Reset()

func (*MsgNewSeedResponse) Size

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

func (*MsgNewSeedResponse) String

func (m *MsgNewSeedResponse) String() string

func (*MsgNewSeedResponse) Unmarshal

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

func (*MsgNewSeedResponse) XXX_DiscardUnknown

func (m *MsgNewSeedResponse) XXX_DiscardUnknown()

func (*MsgNewSeedResponse) XXX_Marshal

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

func (*MsgNewSeedResponse) XXX_Merge

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

func (*MsgNewSeedResponse) XXX_Size

func (m *MsgNewSeedResponse) XXX_Size() int

func (*MsgNewSeedResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// NewSeed defines a method for submitting a new seed to the chain.
	NewSeed(context.Context, *MsgNewSeed) (*MsgNewSeedResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// For getting the random modules seed.
	Seed(ctx context.Context, in *QuerySeedRequest, opts ...grpc.CallOption) (*QuerySeedResponse, 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 QuerySeedRequest

type QuerySeedRequest struct {
}

The message for getting the random modules seed.

func (*QuerySeedRequest) Descriptor

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

func (*QuerySeedRequest) Marshal

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

func (*QuerySeedRequest) MarshalTo

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

func (*QuerySeedRequest) MarshalToSizedBuffer

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

func (*QuerySeedRequest) ProtoMessage

func (*QuerySeedRequest) ProtoMessage()

func (*QuerySeedRequest) Reset

func (m *QuerySeedRequest) Reset()

func (*QuerySeedRequest) Size

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

func (*QuerySeedRequest) String

func (m *QuerySeedRequest) String() string

func (*QuerySeedRequest) Unmarshal

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

func (*QuerySeedRequest) XXX_DiscardUnknown

func (m *QuerySeedRequest) XXX_DiscardUnknown()

func (*QuerySeedRequest) XXX_Marshal

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

func (*QuerySeedRequest) XXX_Merge

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

func (*QuerySeedRequest) XXX_Size

func (m *QuerySeedRequest) XXX_Size() int

func (*QuerySeedRequest) XXX_Unmarshal

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

type QuerySeedResponse

type QuerySeedResponse struct {
	Seed        string `protobuf:"bytes,1,opt,name=seed,proto3" json:"seed,omitempty"`
	BlockHeight int64  `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
}

The message for returning the random modules seed.

func (*QuerySeedResponse) Descriptor

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

func (*QuerySeedResponse) GetBlockHeight

func (m *QuerySeedResponse) GetBlockHeight() int64

func (*QuerySeedResponse) GetSeed

func (m *QuerySeedResponse) GetSeed() string

func (*QuerySeedResponse) Marshal

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

func (*QuerySeedResponse) MarshalTo

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

func (*QuerySeedResponse) MarshalToSizedBuffer

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

func (*QuerySeedResponse) ProtoMessage

func (*QuerySeedResponse) ProtoMessage()

func (*QuerySeedResponse) Reset

func (m *QuerySeedResponse) Reset()

func (*QuerySeedResponse) Size

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

func (*QuerySeedResponse) String

func (m *QuerySeedResponse) String() string

func (*QuerySeedResponse) Unmarshal

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

func (*QuerySeedResponse) XXX_DiscardUnknown

func (m *QuerySeedResponse) XXX_DiscardUnknown()

func (*QuerySeedResponse) XXX_Marshal

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

func (*QuerySeedResponse) XXX_Merge

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

func (*QuerySeedResponse) XXX_Size

func (m *QuerySeedResponse) XXX_Size() int

func (*QuerySeedResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// For getting the random modules seed.
	Seed(context.Context, *QuerySeedRequest) (*QuerySeedResponse, error)
}

QueryServer is the server API for Query service.

type StakingKeeper

type StakingKeeper interface {
	GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator types.Validator, err error)
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) NewSeed

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Seed

type ValidatorVRF

type ValidatorVRF struct {
	// operator_address defines the address of the validator's operator; bech
	// encoded in JSON.
	OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"`
	// vrf_pubkey is the public key of the validator's VRF key pair
	VrfPubkey *types.Any `protobuf:"bytes,2,opt,name=vrf_pubkey,json=vrfPubkey,proto3" json:"vrf_pubkey,omitempty"`
}

ValidatorVRF is the randomness validator's VRF key information

func (*ValidatorVRF) Descriptor

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

func (*ValidatorVRF) GetOperatorAddress

func (m *ValidatorVRF) GetOperatorAddress() string

func (*ValidatorVRF) GetVrfPubkey

func (m *ValidatorVRF) GetVrfPubkey() *types.Any

func (*ValidatorVRF) Marshal

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

func (*ValidatorVRF) MarshalTo

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

func (*ValidatorVRF) MarshalToSizedBuffer

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

func (*ValidatorVRF) ProtoMessage

func (*ValidatorVRF) ProtoMessage()

func (*ValidatorVRF) Reset

func (m *ValidatorVRF) Reset()

func (*ValidatorVRF) Size

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

func (*ValidatorVRF) String

func (m *ValidatorVRF) String() string

func (*ValidatorVRF) Unmarshal

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

func (*ValidatorVRF) XXX_DiscardUnknown

func (m *ValidatorVRF) XXX_DiscardUnknown()

func (*ValidatorVRF) XXX_Marshal

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

func (*ValidatorVRF) XXX_Merge

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

func (*ValidatorVRF) XXX_Size

func (m *ValidatorVRF) XXX_Size() int

func (*ValidatorVRF) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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