Documentation ¶
Index ¶
- func NewMockBeacon(t *testing.T, sch *crypto.Scheme, clk clock.Clock) (*drand.ChainInfoPacket, *drand.PublicRandResponse)
- func NewMockGRPCPublicServer(t *testing.T, l log.Logger, bind string, badSecondRound bool, ...) (net.Listener, net.Service)
- func NewMockServer(t *testing.T, badSecondRound bool, sch *crypto.Scheme, clk clock.Clock) net.Service
- type Data
- type GrpcClient
- func (c *GrpcClient) Close() error
- func (c *GrpcClient) Get(ctx context.Context, round uint64) (client.Result, error)
- func (c *GrpcClient) Info(ctx context.Context) (*chain.Info, error)
- func (c *GrpcClient) RoundAt(_ time.Time) uint64
- func (c *GrpcClient) Watch(ctx context.Context) <-chan client.Result
- type Server
- func (s *Server) ChainInfo(context.Context, *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
- func (s *Server) Command(_ context.Context, _ *pdkg.DKGCommand) (*pdkg.EmptyDKGResponse, error)
- func (s *Server) DKGStatus(_ context.Context, _ *pdkg.DKGStatusRequest) (*pdkg.DKGStatusResponse, error)
- func (s *Server) EmitRand(closeStream bool)
- func (s *Server) Metrics(_ context.Context, _ *drand.MetricsRequest) (*drand.MetricsResponse, error)
- func (s *Server) Packet(_ context.Context, _ *pdkg.GossipPacket) (*pdkg.EmptyDKGResponse, error)
- func (s *Server) PublicRand(_ context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
- func (s *Server) PublicRandStream(_ *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockBeacon ¶
func NewMockBeacon(t *testing.T, sch *crypto.Scheme, clk clock.Clock) (*drand.ChainInfoPacket, *drand.PublicRandResponse)
NewMockBeacon provides a random beacon and the chain it validates against
Types ¶
type Data ¶
type Data struct { Public []byte Signature string Round int PreviousSignature string PreviousRound int Genesis int64 Period time.Duration BadSecondRound bool Scheme *crypto.Scheme // contains filtered or unexported fields }
Data of signing
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶
func NewGrpcClient(s *Server) *GrpcClient
func (*GrpcClient) Close ¶
func (c *GrpcClient) Close() error
type Server ¶
type Server struct { *testnet.EmptyServer // contains filtered or unexported fields }
Server fake
func (*Server) ChainInfo ¶
func (s *Server) ChainInfo(context.Context, *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
ChainInfo implements net.Service
func (*Server) Command ¶
func (s *Server) Command(_ context.Context, _ *pdkg.DKGCommand) (*pdkg.EmptyDKGResponse, error)
func (*Server) DKGStatus ¶
func (s *Server) DKGStatus(_ context.Context, _ *pdkg.DKGStatusRequest) (*pdkg.DKGStatusResponse, error)
func (*Server) EmitRand ¶
EmitRand will cause the next round to be emitted by a previous call to `PublicRandomStream`
func (*Server) Metrics ¶
func (s *Server) Metrics(_ context.Context, _ *drand.MetricsRequest) (*drand.MetricsResponse, error)
func (*Server) Packet ¶
func (s *Server) Packet(_ context.Context, _ *pdkg.GossipPacket) (*pdkg.EmptyDKGResponse, error)
func (*Server) PublicRand ¶
func (s *Server) PublicRand(_ context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
PublicRand implements net.Service
func (*Server) PublicRandStream ¶
func (s *Server) PublicRandStream(_ *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
PublicRandStream is part of the public drand service.
Click to show internal directories.
Click to hide internal directories.