mocks

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockNetwork

type MockNetwork struct {
	network.GossipNode
}

MockNetwork is a dummy network that doesn't do anything

func (*MockNetwork) Address

func (network *MockNetwork) Address() (string, bool)

Address - unused function

func (*MockNetwork) Broadcast

func (network *MockNetwork) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error

Broadcast - unused function

func (*MockNetwork) ClearHandlers

func (network *MockNetwork) ClearHandlers()

ClearHandlers - empty implementation

func (*MockNetwork) DisconnectPeers

func (network *MockNetwork) DisconnectPeers()

DisconnectPeers - unused function

func (*MockNetwork) GetPeers

func (network *MockNetwork) GetPeers(options ...network.PeerOption) []network.Peer

GetPeers - unused function

func (*MockNetwork) Ready

func (network *MockNetwork) Ready() chan struct{}

Ready - always ready

func (*MockNetwork) RegisterHTTPHandler

func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler)

RegisterHTTPHandler - empty implementation

func (*MockNetwork) RegisterHandlers

func (network *MockNetwork) RegisterHandlers(dispatch []network.TaggedMessageHandler)

RegisterHandlers - empty implementation.

func (*MockNetwork) RegisterRPCName

func (network *MockNetwork) RegisterRPCName(name string, rcvr interface{})

RegisterRPCName - unused function

func (*MockNetwork) Relay

func (network *MockNetwork) Relay(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error

Relay - unused function

func (*MockNetwork) RequestConnectOutgoing

func (network *MockNetwork) RequestConnectOutgoing(replace bool, quit <-chan struct{})

RequestConnectOutgoing - unused function

func (*MockNetwork) Start

func (network *MockNetwork) Start()

Start - unused function

func (*MockNetwork) Stop

func (network *MockNetwork) Stop()

Stop - unused function

type MockNodeContext

type MockNodeContext struct {
	CatchingUp                bool
	InitialCatchupNotComplete bool
	NotCaughtUp               bool
}

MockNodeContext implements NodeContext for testing

func (*MockNodeContext) HasCaughtUp

func (ctx *MockNodeContext) HasCaughtUp() bool

HasCaughtUp (implements NodeContext) returns true if we have completely caught up at least once

func (*MockNodeContext) IsCatchingUp

func (ctx *MockNodeContext) IsCatchingUp() bool

IsCatchingUp (implements NodeContext) returns true if our sync routine is currently running

func (*MockNodeContext) IsInitialCatchupComplete

func (ctx *MockNodeContext) IsInitialCatchupComplete() bool

IsInitialCatchupComplete (implements NodeContext) returns true if the initial sync has completed (doesn't mean it succeeded)

func (*MockNodeContext) SetLastLiveRound

func (ctx *MockNodeContext) SetLastLiveRound(round basics.Round)

SetLastLiveRound is called to record observation of a round completion

Jump to

Keyboard shortcuts

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