Documentation ¶
Index ¶
- func NewMockBeacon() (*drand.ChainInfoPacket, *drand.PublicRandResponse)
- func NewMockGRPCPublicServer(bind string, badSecondRound bool) (net.Listener, net.Service)
- func NewMockServer(badSecondRound bool) net.Service
- type Data
- type MockService
- type Server
- func (s *Server) ChainInfo(context.Context, *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
- func (s *Server) EmitRand(closeStream bool)
- func (s *Server) PublicRand(c context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
- func (s *Server) PublicRandStream(req *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockBeacon ¶
func NewMockBeacon() (*drand.ChainInfoPacket, *drand.PublicRandResponse)
NewMockBeacon provides a random beacon and the chain it validates against
func NewMockGRPCPublicServer ¶
NewMockGRPCPublicServer creates a listener that provides valid single-node randomness.
func NewMockServer ¶
NewMockServer creates a server interface not bound to a newtork port
Types ¶
type Data ¶
type Data struct { Public []byte Signature string Round int PreviousSignature string PreviousRound int Genesis int64 Period time.Duration BadSecondRound bool // contains filtered or unexported fields }
Data of signing
type MockService ¶
type MockService interface {
EmitRand(bool)
}
MockService provides a way for clients getting the service to be able to call the EmitRand method on the mock server
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) EmitRand ¶
EmitRand will cause the next round to be emitted by a previous call to `PublicRandomStream`
func (*Server) PublicRand ¶
func (s *Server) PublicRand(c context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
PublicRand implements net.Service
func (*Server) PublicRandStream ¶
func (s *Server) PublicRandStream(req *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.