github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/peer_score_tracer.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 irrecoverable "github.com/onflow/flow-go/module/irrecoverable" 7 mock "github.com/stretchr/testify/mock" 8 9 p2p "github.com/onflow/flow-go/network/p2p" 10 11 peer "github.com/libp2p/go-libp2p/core/peer" 12 13 time "time" 14 ) 15 16 // PeerScoreTracer is an autogenerated mock type for the PeerScoreTracer type 17 type PeerScoreTracer struct { 18 mock.Mock 19 } 20 21 // Done provides a mock function with given fields: 22 func (_m *PeerScoreTracer) Done() <-chan struct{} { 23 ret := _m.Called() 24 25 var r0 <-chan struct{} 26 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 27 r0 = rf() 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(<-chan struct{}) 31 } 32 } 33 34 return r0 35 } 36 37 // GetAppScore provides a mock function with given fields: peerID 38 func (_m *PeerScoreTracer) GetAppScore(peerID peer.ID) (float64, bool) { 39 ret := _m.Called(peerID) 40 41 var r0 float64 42 var r1 bool 43 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 44 return rf(peerID) 45 } 46 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 47 r0 = rf(peerID) 48 } else { 49 r0 = ret.Get(0).(float64) 50 } 51 52 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 53 r1 = rf(peerID) 54 } else { 55 r1 = ret.Get(1).(bool) 56 } 57 58 return r0, r1 59 } 60 61 // GetBehaviourPenalty provides a mock function with given fields: peerID 62 func (_m *PeerScoreTracer) GetBehaviourPenalty(peerID peer.ID) (float64, bool) { 63 ret := _m.Called(peerID) 64 65 var r0 float64 66 var r1 bool 67 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 68 return rf(peerID) 69 } 70 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 71 r0 = rf(peerID) 72 } else { 73 r0 = ret.Get(0).(float64) 74 } 75 76 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 77 r1 = rf(peerID) 78 } else { 79 r1 = ret.Get(1).(bool) 80 } 81 82 return r0, r1 83 } 84 85 // GetIPColocationFactor provides a mock function with given fields: peerID 86 func (_m *PeerScoreTracer) GetIPColocationFactor(peerID peer.ID) (float64, bool) { 87 ret := _m.Called(peerID) 88 89 var r0 float64 90 var r1 bool 91 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 92 return rf(peerID) 93 } 94 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 95 r0 = rf(peerID) 96 } else { 97 r0 = ret.Get(0).(float64) 98 } 99 100 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 101 r1 = rf(peerID) 102 } else { 103 r1 = ret.Get(1).(bool) 104 } 105 106 return r0, r1 107 } 108 109 // GetScore provides a mock function with given fields: peerID 110 func (_m *PeerScoreTracer) GetScore(peerID peer.ID) (float64, bool) { 111 ret := _m.Called(peerID) 112 113 var r0 float64 114 var r1 bool 115 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 116 return rf(peerID) 117 } 118 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 119 r0 = rf(peerID) 120 } else { 121 r0 = ret.Get(0).(float64) 122 } 123 124 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 125 r1 = rf(peerID) 126 } else { 127 r1 = ret.Get(1).(bool) 128 } 129 130 return r0, r1 131 } 132 133 // GetTopicScores provides a mock function with given fields: peerID 134 func (_m *PeerScoreTracer) GetTopicScores(peerID peer.ID) (map[string]p2p.TopicScoreSnapshot, bool) { 135 ret := _m.Called(peerID) 136 137 var r0 map[string]p2p.TopicScoreSnapshot 138 var r1 bool 139 if rf, ok := ret.Get(0).(func(peer.ID) (map[string]p2p.TopicScoreSnapshot, bool)); ok { 140 return rf(peerID) 141 } 142 if rf, ok := ret.Get(0).(func(peer.ID) map[string]p2p.TopicScoreSnapshot); ok { 143 r0 = rf(peerID) 144 } else { 145 if ret.Get(0) != nil { 146 r0 = ret.Get(0).(map[string]p2p.TopicScoreSnapshot) 147 } 148 } 149 150 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 151 r1 = rf(peerID) 152 } else { 153 r1 = ret.Get(1).(bool) 154 } 155 156 return r0, r1 157 } 158 159 // Ready provides a mock function with given fields: 160 func (_m *PeerScoreTracer) Ready() <-chan struct{} { 161 ret := _m.Called() 162 163 var r0 <-chan struct{} 164 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 165 r0 = rf() 166 } else { 167 if ret.Get(0) != nil { 168 r0 = ret.Get(0).(<-chan struct{}) 169 } 170 } 171 172 return r0 173 } 174 175 // Start provides a mock function with given fields: _a0 176 func (_m *PeerScoreTracer) Start(_a0 irrecoverable.SignalerContext) { 177 _m.Called(_a0) 178 } 179 180 // UpdateInterval provides a mock function with given fields: 181 func (_m *PeerScoreTracer) UpdateInterval() time.Duration { 182 ret := _m.Called() 183 184 var r0 time.Duration 185 if rf, ok := ret.Get(0).(func() time.Duration); ok { 186 r0 = rf() 187 } else { 188 r0 = ret.Get(0).(time.Duration) 189 } 190 191 return r0 192 } 193 194 // UpdatePeerScoreSnapshots provides a mock function with given fields: _a0 195 func (_m *PeerScoreTracer) UpdatePeerScoreSnapshots(_a0 map[peer.ID]*p2p.PeerScoreSnapshot) { 196 _m.Called(_a0) 197 } 198 199 type mockConstructorTestingTNewPeerScoreTracer interface { 200 mock.TestingT 201 Cleanup(func()) 202 } 203 204 // NewPeerScoreTracer creates a new instance of PeerScoreTracer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 205 func NewPeerScoreTracer(t mockConstructorTestingTNewPeerScoreTracer) *PeerScoreTracer { 206 mock := &PeerScoreTracer{} 207 mock.Mock.Test(t) 208 209 t.Cleanup(func() { mock.AssertExpectations(t) }) 210 211 return mock 212 }