mocks

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT, MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	mock.Mock
}

API is an autogenerated mock type for the API type

func NewAPI

func NewAPI(t interface {
	mock.TestingT
	Cleanup(func())
}) *API

NewAPI creates a new instance of API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*API) BlockAddr

func (_m *API) BlockAddr(ctx context.Context, ip net.IP) error

BlockAddr provides a mock function with given fields: ctx, ip

func (*API) BlockPeer

func (_m *API) BlockPeer(ctx context.Context, p peer.ID) error

BlockPeer provides a mock function with given fields: ctx, p

func (*API) BlockSubnet

func (_m *API) BlockSubnet(ctx context.Context, ipnet *net.IPNet) error

BlockSubnet provides a mock function with given fields: ctx, ipnet

func (*API) ConnectPeer

func (_m *API) ConnectPeer(ctx context.Context, addr string) error

ConnectPeer provides a mock function with given fields: ctx, addr

func (*API) DisconnectPeer

func (_m *API) DisconnectPeer(ctx context.Context, id peer.ID) error

DisconnectPeer provides a mock function with given fields: ctx, id

func (*API) DiscoveryTable

func (_m *API) DiscoveryTable(ctx context.Context) ([]*enode.Node, error)

DiscoveryTable provides a mock function with given fields: ctx

func (*API) EXPECT

func (_m *API) EXPECT() *API_Expecter

func (*API) ListBlockedAddrs

func (_m *API) ListBlockedAddrs(ctx context.Context) ([]net.IP, error)

ListBlockedAddrs provides a mock function with given fields: ctx

func (*API) ListBlockedPeers

func (_m *API) ListBlockedPeers(ctx context.Context) ([]peer.ID, error)

ListBlockedPeers provides a mock function with given fields: ctx

func (*API) ListBlockedSubnets

func (_m *API) ListBlockedSubnets(ctx context.Context) ([]*net.IPNet, error)

ListBlockedSubnets provides a mock function with given fields: ctx

func (*API) PeerStats

func (_m *API) PeerStats(ctx context.Context) (*p2p.PeerStats, error)

PeerStats provides a mock function with given fields: ctx

func (*API) Peers

func (_m *API) Peers(ctx context.Context, connected bool) (*p2p.PeerDump, error)

Peers provides a mock function with given fields: ctx, connected

func (*API) ProtectPeer

func (_m *API) ProtectPeer(ctx context.Context, p peer.ID) error

ProtectPeer provides a mock function with given fields: ctx, p

func (*API) Self

func (_m *API) Self(ctx context.Context) (*p2p.PeerInfo, error)

Self provides a mock function with given fields: ctx

func (*API) UnblockAddr

func (_m *API) UnblockAddr(ctx context.Context, ip net.IP) error

UnblockAddr provides a mock function with given fields: ctx, ip

func (*API) UnblockPeer

func (_m *API) UnblockPeer(ctx context.Context, p peer.ID) error

UnblockPeer provides a mock function with given fields: ctx, p

func (*API) UnblockSubnet

func (_m *API) UnblockSubnet(ctx context.Context, ipnet *net.IPNet) error

UnblockSubnet provides a mock function with given fields: ctx, ipnet

func (*API) UnprotectPeer

func (_m *API) UnprotectPeer(ctx context.Context, p peer.ID) error

UnprotectPeer provides a mock function with given fields: ctx, p

type API_BlockAddr_Call

type API_BlockAddr_Call struct {
	*mock.Call
}

API_BlockAddr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockAddr'

func (*API_BlockAddr_Call) Return

func (_c *API_BlockAddr_Call) Return(_a0 error) *API_BlockAddr_Call

func (*API_BlockAddr_Call) Run

func (_c *API_BlockAddr_Call) Run(run func(ctx context.Context, ip net.IP)) *API_BlockAddr_Call

func (*API_BlockAddr_Call) RunAndReturn

func (_c *API_BlockAddr_Call) RunAndReturn(run func(context.Context, net.IP) error) *API_BlockAddr_Call

type API_BlockPeer_Call

type API_BlockPeer_Call struct {
	*mock.Call
}

API_BlockPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockPeer'

func (*API_BlockPeer_Call) Return

func (_c *API_BlockPeer_Call) Return(_a0 error) *API_BlockPeer_Call

func (*API_BlockPeer_Call) Run

func (_c *API_BlockPeer_Call) Run(run func(ctx context.Context, p peer.ID)) *API_BlockPeer_Call

func (*API_BlockPeer_Call) RunAndReturn

func (_c *API_BlockPeer_Call) RunAndReturn(run func(context.Context, peer.ID) error) *API_BlockPeer_Call

type API_BlockSubnet_Call

type API_BlockSubnet_Call struct {
	*mock.Call
}

API_BlockSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockSubnet'

func (*API_BlockSubnet_Call) Return

func (*API_BlockSubnet_Call) Run

func (_c *API_BlockSubnet_Call) Run(run func(ctx context.Context, ipnet *net.IPNet)) *API_BlockSubnet_Call

func (*API_BlockSubnet_Call) RunAndReturn

func (_c *API_BlockSubnet_Call) RunAndReturn(run func(context.Context, *net.IPNet) error) *API_BlockSubnet_Call

type API_ConnectPeer_Call

type API_ConnectPeer_Call struct {
	*mock.Call
}

API_ConnectPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectPeer'

func (*API_ConnectPeer_Call) Return

func (*API_ConnectPeer_Call) Run

func (_c *API_ConnectPeer_Call) Run(run func(ctx context.Context, addr string)) *API_ConnectPeer_Call

func (*API_ConnectPeer_Call) RunAndReturn

func (_c *API_ConnectPeer_Call) RunAndReturn(run func(context.Context, string) error) *API_ConnectPeer_Call

type API_DisconnectPeer_Call

type API_DisconnectPeer_Call struct {
	*mock.Call
}

API_DisconnectPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisconnectPeer'

func (*API_DisconnectPeer_Call) Return

func (*API_DisconnectPeer_Call) Run

func (*API_DisconnectPeer_Call) RunAndReturn

type API_DiscoveryTable_Call

type API_DiscoveryTable_Call struct {
	*mock.Call
}

API_DiscoveryTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiscoveryTable'

func (*API_DiscoveryTable_Call) Return

func (*API_DiscoveryTable_Call) Run

func (*API_DiscoveryTable_Call) RunAndReturn

func (_c *API_DiscoveryTable_Call) RunAndReturn(run func(context.Context) ([]*enode.Node, error)) *API_DiscoveryTable_Call

type API_Expecter

type API_Expecter struct {
	// contains filtered or unexported fields
}

func (*API_Expecter) BlockAddr

func (_e *API_Expecter) BlockAddr(ctx interface{}, ip interface{}) *API_BlockAddr_Call

BlockAddr is a helper method to define mock.On call

  • ctx context.Context
  • ip net.IP

func (*API_Expecter) BlockPeer

func (_e *API_Expecter) BlockPeer(ctx interface{}, p interface{}) *API_BlockPeer_Call

BlockPeer is a helper method to define mock.On call

  • ctx context.Context
  • p peer.ID

func (*API_Expecter) BlockSubnet

func (_e *API_Expecter) BlockSubnet(ctx interface{}, ipnet interface{}) *API_BlockSubnet_Call

BlockSubnet is a helper method to define mock.On call

  • ctx context.Context
  • ipnet *net.IPNet

func (*API_Expecter) ConnectPeer

func (_e *API_Expecter) ConnectPeer(ctx interface{}, addr interface{}) *API_ConnectPeer_Call

ConnectPeer is a helper method to define mock.On call

  • ctx context.Context
  • addr string

func (*API_Expecter) DisconnectPeer

func (_e *API_Expecter) DisconnectPeer(ctx interface{}, id interface{}) *API_DisconnectPeer_Call

DisconnectPeer is a helper method to define mock.On call

  • ctx context.Context
  • id peer.ID

func (*API_Expecter) DiscoveryTable

func (_e *API_Expecter) DiscoveryTable(ctx interface{}) *API_DiscoveryTable_Call

DiscoveryTable is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) ListBlockedAddrs

func (_e *API_Expecter) ListBlockedAddrs(ctx interface{}) *API_ListBlockedAddrs_Call

ListBlockedAddrs is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) ListBlockedPeers

func (_e *API_Expecter) ListBlockedPeers(ctx interface{}) *API_ListBlockedPeers_Call

ListBlockedPeers is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) ListBlockedSubnets

func (_e *API_Expecter) ListBlockedSubnets(ctx interface{}) *API_ListBlockedSubnets_Call

ListBlockedSubnets is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) PeerStats

func (_e *API_Expecter) PeerStats(ctx interface{}) *API_PeerStats_Call

PeerStats is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) Peers

func (_e *API_Expecter) Peers(ctx interface{}, connected interface{}) *API_Peers_Call

Peers is a helper method to define mock.On call

  • ctx context.Context
  • connected bool

func (*API_Expecter) ProtectPeer

func (_e *API_Expecter) ProtectPeer(ctx interface{}, p interface{}) *API_ProtectPeer_Call

ProtectPeer is a helper method to define mock.On call

  • ctx context.Context
  • p peer.ID

func (*API_Expecter) Self

func (_e *API_Expecter) Self(ctx interface{}) *API_Self_Call

Self is a helper method to define mock.On call

  • ctx context.Context

func (*API_Expecter) UnblockAddr

func (_e *API_Expecter) UnblockAddr(ctx interface{}, ip interface{}) *API_UnblockAddr_Call

UnblockAddr is a helper method to define mock.On call

  • ctx context.Context
  • ip net.IP

func (*API_Expecter) UnblockPeer

func (_e *API_Expecter) UnblockPeer(ctx interface{}, p interface{}) *API_UnblockPeer_Call

UnblockPeer is a helper method to define mock.On call

  • ctx context.Context
  • p peer.ID

func (*API_Expecter) UnblockSubnet

func (_e *API_Expecter) UnblockSubnet(ctx interface{}, ipnet interface{}) *API_UnblockSubnet_Call

UnblockSubnet is a helper method to define mock.On call

  • ctx context.Context
  • ipnet *net.IPNet

func (*API_Expecter) UnprotectPeer

func (_e *API_Expecter) UnprotectPeer(ctx interface{}, p interface{}) *API_UnprotectPeer_Call

UnprotectPeer is a helper method to define mock.On call

  • ctx context.Context
  • p peer.ID

type API_ListBlockedAddrs_Call

type API_ListBlockedAddrs_Call struct {
	*mock.Call
}

API_ListBlockedAddrs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBlockedAddrs'

func (*API_ListBlockedAddrs_Call) Return

func (*API_ListBlockedAddrs_Call) Run

func (*API_ListBlockedAddrs_Call) RunAndReturn

type API_ListBlockedPeers_Call

type API_ListBlockedPeers_Call struct {
	*mock.Call
}

API_ListBlockedPeers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBlockedPeers'

func (*API_ListBlockedPeers_Call) Return

func (*API_ListBlockedPeers_Call) Run

func (*API_ListBlockedPeers_Call) RunAndReturn

type API_ListBlockedSubnets_Call

type API_ListBlockedSubnets_Call struct {
	*mock.Call
}

API_ListBlockedSubnets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBlockedSubnets'

func (*API_ListBlockedSubnets_Call) Return

func (*API_ListBlockedSubnets_Call) Run

func (*API_ListBlockedSubnets_Call) RunAndReturn

type API_PeerStats_Call

type API_PeerStats_Call struct {
	*mock.Call
}

API_PeerStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PeerStats'

func (*API_PeerStats_Call) Return

func (_c *API_PeerStats_Call) Return(_a0 *p2p.PeerStats, _a1 error) *API_PeerStats_Call

func (*API_PeerStats_Call) Run

func (_c *API_PeerStats_Call) Run(run func(ctx context.Context)) *API_PeerStats_Call

func (*API_PeerStats_Call) RunAndReturn

func (_c *API_PeerStats_Call) RunAndReturn(run func(context.Context) (*p2p.PeerStats, error)) *API_PeerStats_Call

type API_Peers_Call

type API_Peers_Call struct {
	*mock.Call
}

API_Peers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Peers'

func (*API_Peers_Call) Return

func (_c *API_Peers_Call) Return(_a0 *p2p.PeerDump, _a1 error) *API_Peers_Call

func (*API_Peers_Call) Run

func (_c *API_Peers_Call) Run(run func(ctx context.Context, connected bool)) *API_Peers_Call

func (*API_Peers_Call) RunAndReturn

func (_c *API_Peers_Call) RunAndReturn(run func(context.Context, bool) (*p2p.PeerDump, error)) *API_Peers_Call

type API_ProtectPeer_Call

type API_ProtectPeer_Call struct {
	*mock.Call
}

API_ProtectPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProtectPeer'

func (*API_ProtectPeer_Call) Return

func (*API_ProtectPeer_Call) Run

func (_c *API_ProtectPeer_Call) Run(run func(ctx context.Context, p peer.ID)) *API_ProtectPeer_Call

func (*API_ProtectPeer_Call) RunAndReturn

func (_c *API_ProtectPeer_Call) RunAndReturn(run func(context.Context, peer.ID) error) *API_ProtectPeer_Call

type API_Self_Call

type API_Self_Call struct {
	*mock.Call
}

API_Self_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Self'

func (*API_Self_Call) Return

func (_c *API_Self_Call) Return(_a0 *p2p.PeerInfo, _a1 error) *API_Self_Call

func (*API_Self_Call) Run

func (_c *API_Self_Call) Run(run func(ctx context.Context)) *API_Self_Call

func (*API_Self_Call) RunAndReturn

func (_c *API_Self_Call) RunAndReturn(run func(context.Context) (*p2p.PeerInfo, error)) *API_Self_Call

type API_UnblockAddr_Call

type API_UnblockAddr_Call struct {
	*mock.Call
}

API_UnblockAddr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnblockAddr'

func (*API_UnblockAddr_Call) Return

func (*API_UnblockAddr_Call) Run

func (_c *API_UnblockAddr_Call) Run(run func(ctx context.Context, ip net.IP)) *API_UnblockAddr_Call

func (*API_UnblockAddr_Call) RunAndReturn

func (_c *API_UnblockAddr_Call) RunAndReturn(run func(context.Context, net.IP) error) *API_UnblockAddr_Call

type API_UnblockPeer_Call

type API_UnblockPeer_Call struct {
	*mock.Call
}

API_UnblockPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnblockPeer'

func (*API_UnblockPeer_Call) Return

func (*API_UnblockPeer_Call) Run

func (_c *API_UnblockPeer_Call) Run(run func(ctx context.Context, p peer.ID)) *API_UnblockPeer_Call

func (*API_UnblockPeer_Call) RunAndReturn

func (_c *API_UnblockPeer_Call) RunAndReturn(run func(context.Context, peer.ID) error) *API_UnblockPeer_Call

type API_UnblockSubnet_Call

type API_UnblockSubnet_Call struct {
	*mock.Call
}

API_UnblockSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnblockSubnet'

func (*API_UnblockSubnet_Call) Return

func (*API_UnblockSubnet_Call) Run

func (_c *API_UnblockSubnet_Call) Run(run func(ctx context.Context, ipnet *net.IPNet)) *API_UnblockSubnet_Call

func (*API_UnblockSubnet_Call) RunAndReturn

type API_UnprotectPeer_Call

type API_UnprotectPeer_Call struct {
	*mock.Call
}

API_UnprotectPeer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnprotectPeer'

func (*API_UnprotectPeer_Call) Return

func (*API_UnprotectPeer_Call) Run

func (*API_UnprotectPeer_Call) RunAndReturn

type GossipMetricer

type GossipMetricer struct {
	mock.Mock
}

GossipMetricer is an autogenerated mock type for the GossipMetricer type

func NewGossipMetricer

func NewGossipMetricer(t interface {
	mock.TestingT
	Cleanup(func())
}) *GossipMetricer

NewGossipMetricer creates a new instance of GossipMetricer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*GossipMetricer) RecordGossipEvent

func (_m *GossipMetricer) RecordGossipEvent(evType int32)

RecordGossipEvent provides a mock function with given fields: evType

type PeerGater

type PeerGater struct {
	mock.Mock
}

PeerGater is an autogenerated mock type for the PeerGater type

func NewPeerGater

func NewPeerGater(t mockConstructorTestingTNewPeerGater) *PeerGater

NewPeerGater creates a new instance of PeerGater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PeerGater) IsBlocked

func (_m *PeerGater) IsBlocked(_a0 peer.ID) bool

IsBlocked provides a mock function with given fields: _a0

func (*PeerGater) Update

func (_m *PeerGater) Update(_a0 peer.ID, _a1 float64)

Update provides a mock function with given fields: _a0, _a1

type Peerstore

type Peerstore struct {
	mock.Mock
}

Peerstore is an autogenerated mock type for the Peerstore type

func NewPeerstore

func NewPeerstore(t interface {
	mock.TestingT
	Cleanup(func())
}) *Peerstore

NewPeerstore creates a new instance of Peerstore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Peerstore) PeerInfo

func (_m *Peerstore) PeerInfo(_a0 peer.ID) peer.AddrInfo

PeerInfo provides a mock function with given fields: _a0

func (*Peerstore) Peers

func (_m *Peerstore) Peers() peer.IDSlice

Peers provides a mock function with no fields

func (*Peerstore) SetScore

func (_m *Peerstore) SetScore(id peer.ID, diff store.ScoreDiff) (store.PeerScores, error)

SetScore provides a mock function with given fields: id, diff

type ScoreMetrics

type ScoreMetrics struct {
	mock.Mock
}

ScoreMetrics is an autogenerated mock type for the ScoreMetrics type

func NewScoreMetrics

func NewScoreMetrics(t interface {
	mock.TestingT
	Cleanup(func())
}) *ScoreMetrics

NewScoreMetrics creates a new instance of ScoreMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*ScoreMetrics) SetPeerScores

func (_m *ScoreMetrics) SetPeerScores(_a0 []store.PeerScores)

SetPeerScores provides a mock function with given fields: _a0

Jump to

Keyboard shortcuts

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