github.com/ethereum-optimism/optimism@v1.7.2/op-node/p2p/gating/mocks/Scores.go (about) 1 // Code generated by mockery v2.28.1. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 peer "github.com/libp2p/go-libp2p/core/peer" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // Scores is an autogenerated mock type for the Scores type 11 type Scores struct { 12 mock.Mock 13 } 14 15 type Scores_Expecter struct { 16 mock *mock.Mock 17 } 18 19 func (_m *Scores) EXPECT() *Scores_Expecter { 20 return &Scores_Expecter{mock: &_m.Mock} 21 } 22 23 // GetPeerScore provides a mock function with given fields: id 24 func (_m *Scores) GetPeerScore(id peer.ID) (float64, error) { 25 ret := _m.Called(id) 26 27 var r0 float64 28 var r1 error 29 if rf, ok := ret.Get(0).(func(peer.ID) (float64, error)); ok { 30 return rf(id) 31 } 32 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 33 r0 = rf(id) 34 } else { 35 r0 = ret.Get(0).(float64) 36 } 37 38 if rf, ok := ret.Get(1).(func(peer.ID) error); ok { 39 r1 = rf(id) 40 } else { 41 r1 = ret.Error(1) 42 } 43 44 return r0, r1 45 } 46 47 // Scores_GetPeerScore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPeerScore' 48 type Scores_GetPeerScore_Call struct { 49 *mock.Call 50 } 51 52 // GetPeerScore is a helper method to define mock.On call 53 // - id peer.ID 54 func (_e *Scores_Expecter) GetPeerScore(id interface{}) *Scores_GetPeerScore_Call { 55 return &Scores_GetPeerScore_Call{Call: _e.mock.On("GetPeerScore", id)} 56 } 57 58 func (_c *Scores_GetPeerScore_Call) Run(run func(id peer.ID)) *Scores_GetPeerScore_Call { 59 _c.Call.Run(func(args mock.Arguments) { 60 run(args[0].(peer.ID)) 61 }) 62 return _c 63 } 64 65 func (_c *Scores_GetPeerScore_Call) Return(_a0 float64, _a1 error) *Scores_GetPeerScore_Call { 66 _c.Call.Return(_a0, _a1) 67 return _c 68 } 69 70 func (_c *Scores_GetPeerScore_Call) RunAndReturn(run func(peer.ID) (float64, error)) *Scores_GetPeerScore_Call { 71 _c.Call.Return(run) 72 return _c 73 } 74 75 type mockConstructorTestingTNewScores interface { 76 mock.TestingT 77 Cleanup(func()) 78 } 79 80 // NewScores creates a new instance of Scores. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 81 func NewScores(t mockConstructorTestingTNewScores) *Scores { 82 mock := &Scores{} 83 mock.Mock.Test(t) 84 85 t.Cleanup(func() { mock.AssertExpectations(t) }) 86 87 return mock 88 }