Documentation
¶
Index ¶
- type MockNetwork
- func (network *MockNetwork) Address() (string, bool)
- func (network *MockNetwork) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, ...) error
- func (network *MockNetwork) ClearHandlers()
- func (network *MockNetwork) DisconnectPeers()
- func (network *MockNetwork) GetPeers(options ...network.PeerOption) []network.Peer
- func (network *MockNetwork) Ready() chan struct{}
- func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler)
- func (network *MockNetwork) RegisterHandlers(dispatch []network.TaggedMessageHandler)
- func (network *MockNetwork) RegisterRPCName(name string, rcvr interface{})
- func (network *MockNetwork) Relay(ctx context.Context, tag protocol.Tag, data []byte, wait bool, ...) error
- func (network *MockNetwork) RequestConnectOutgoing(replace bool, quit <-chan struct{})
- func (network *MockNetwork) Start()
- func (network *MockNetwork) Stop()
- type MockNodeContext
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) 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
type MockNodeContext ¶
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