mock

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockBeacon added in v1.0.0

NewMockBeacon provides a random beacon and the chain it validates against

func NewMockGRPCPublicServer

func NewMockGRPCPublicServer(bind string, badSecondRound bool, sch scheme.Scheme) (net.Listener, net.Service)

NewMockGRPCPublicServer creates a listener that provides valid single-node randomness.

func NewMockServer added in v1.0.0

func NewMockServer(badSecondRound bool, sch scheme.Scheme) net.Service

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
	Scheme            scheme.Scheme
	// contains filtered or unexported fields
}

Data of signing

type MockService added in v1.0.0

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 added in v1.0.0

ChainInfo implements net.Service

func (*Server) EmitRand added in v1.0.0

func (s *Server) EmitRand(closeStream bool)

EmitRand will cause the next round to be emitted by a previous call to `PublicRandomStream`

func (*Server) PublicRand

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.

Jump to

Keyboard shortcuts

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