Peerstore.go 2.14 KB
Newer Older
1
// Code generated by mockery v2.46.0. DO NOT EDIT.
Andreas Bigger's avatar
Andreas Bigger committed
2 3 4 5 6 7 8

package mocks

import (
	mock "github.com/stretchr/testify/mock"

	peer "github.com/libp2p/go-libp2p/core/peer"
9 10

	store "github.com/ethereum-optimism/optimism/op-node/p2p/store"
Andreas Bigger's avatar
Andreas Bigger committed
11 12 13 14 15 16 17 18 19 20 21
)

// Peerstore is an autogenerated mock type for the Peerstore type
type Peerstore struct {
	mock.Mock
}

// PeerInfo provides a mock function with given fields: _a0
func (_m *Peerstore) PeerInfo(_a0 peer.ID) peer.AddrInfo {
	ret := _m.Called(_a0)

22 23 24 25
	if len(ret) == 0 {
		panic("no return value specified for PeerInfo")
	}

Andreas Bigger's avatar
Andreas Bigger committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39
	var r0 peer.AddrInfo
	if rf, ok := ret.Get(0).(func(peer.ID) peer.AddrInfo); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Get(0).(peer.AddrInfo)
	}

	return r0
}

// Peers provides a mock function with given fields:
func (_m *Peerstore) Peers() peer.IDSlice {
	ret := _m.Called()

40 41 42 43
	if len(ret) == 0 {
		panic("no return value specified for Peers")
	}

Andreas Bigger's avatar
Andreas Bigger committed
44 45 46 47 48 49 50 51 52 53 54 55
	var r0 peer.IDSlice
	if rf, ok := ret.Get(0).(func() peer.IDSlice); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(peer.IDSlice)
		}
	}

	return r0
}

56
// SetScore provides a mock function with given fields: id, diff
57
func (_m *Peerstore) SetScore(id peer.ID, diff store.ScoreDiff) (store.PeerScores, error) {
58
	ret := _m.Called(id, diff)
59

60 61 62 63
	if len(ret) == 0 {
		panic("no return value specified for SetScore")
	}

64 65 66 67 68 69
	var r0 store.PeerScores
	var r1 error
	if rf, ok := ret.Get(0).(func(peer.ID, store.ScoreDiff) (store.PeerScores, error)); ok {
		return rf(id, diff)
	}
	if rf, ok := ret.Get(0).(func(peer.ID, store.ScoreDiff) store.PeerScores); ok {
70
		r0 = rf(id, diff)
71
	} else {
72
		r0 = ret.Get(0).(store.PeerScores)
73 74
	}

75 76 77 78 79 80 81
	if rf, ok := ret.Get(1).(func(peer.ID, store.ScoreDiff) error); ok {
		r1 = rf(id, diff)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
82 83
}

84 85 86
// 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 NewPeerstore(t interface {
Andreas Bigger's avatar
Andreas Bigger committed
87 88
	mock.TestingT
	Cleanup(func())
89
}) *Peerstore {
Andreas Bigger's avatar
Andreas Bigger committed
90 91 92 93 94 95 96
	mock := &Peerstore{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}