github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/peer_score_exposer.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 p2p "github.com/onflow/flow-go/network/p2p" 7 mock "github.com/stretchr/testify/mock" 8 9 peer "github.com/libp2p/go-libp2p/core/peer" 10 ) 11 12 // PeerScoreExposer is an autogenerated mock type for the PeerScoreExposer type 13 type PeerScoreExposer struct { 14 mock.Mock 15 } 16 17 // GetAppScore provides a mock function with given fields: peerID 18 func (_m *PeerScoreExposer) GetAppScore(peerID peer.ID) (float64, bool) { 19 ret := _m.Called(peerID) 20 21 var r0 float64 22 var r1 bool 23 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 24 return rf(peerID) 25 } 26 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 27 r0 = rf(peerID) 28 } else { 29 r0 = ret.Get(0).(float64) 30 } 31 32 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 33 r1 = rf(peerID) 34 } else { 35 r1 = ret.Get(1).(bool) 36 } 37 38 return r0, r1 39 } 40 41 // GetBehaviourPenalty provides a mock function with given fields: peerID 42 func (_m *PeerScoreExposer) GetBehaviourPenalty(peerID peer.ID) (float64, bool) { 43 ret := _m.Called(peerID) 44 45 var r0 float64 46 var r1 bool 47 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 48 return rf(peerID) 49 } 50 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 51 r0 = rf(peerID) 52 } else { 53 r0 = ret.Get(0).(float64) 54 } 55 56 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 57 r1 = rf(peerID) 58 } else { 59 r1 = ret.Get(1).(bool) 60 } 61 62 return r0, r1 63 } 64 65 // GetIPColocationFactor provides a mock function with given fields: peerID 66 func (_m *PeerScoreExposer) GetIPColocationFactor(peerID peer.ID) (float64, bool) { 67 ret := _m.Called(peerID) 68 69 var r0 float64 70 var r1 bool 71 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 72 return rf(peerID) 73 } 74 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 75 r0 = rf(peerID) 76 } else { 77 r0 = ret.Get(0).(float64) 78 } 79 80 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 81 r1 = rf(peerID) 82 } else { 83 r1 = ret.Get(1).(bool) 84 } 85 86 return r0, r1 87 } 88 89 // GetScore provides a mock function with given fields: peerID 90 func (_m *PeerScoreExposer) GetScore(peerID peer.ID) (float64, bool) { 91 ret := _m.Called(peerID) 92 93 var r0 float64 94 var r1 bool 95 if rf, ok := ret.Get(0).(func(peer.ID) (float64, bool)); ok { 96 return rf(peerID) 97 } 98 if rf, ok := ret.Get(0).(func(peer.ID) float64); ok { 99 r0 = rf(peerID) 100 } else { 101 r0 = ret.Get(0).(float64) 102 } 103 104 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 105 r1 = rf(peerID) 106 } else { 107 r1 = ret.Get(1).(bool) 108 } 109 110 return r0, r1 111 } 112 113 // GetTopicScores provides a mock function with given fields: peerID 114 func (_m *PeerScoreExposer) GetTopicScores(peerID peer.ID) (map[string]p2p.TopicScoreSnapshot, bool) { 115 ret := _m.Called(peerID) 116 117 var r0 map[string]p2p.TopicScoreSnapshot 118 var r1 bool 119 if rf, ok := ret.Get(0).(func(peer.ID) (map[string]p2p.TopicScoreSnapshot, bool)); ok { 120 return rf(peerID) 121 } 122 if rf, ok := ret.Get(0).(func(peer.ID) map[string]p2p.TopicScoreSnapshot); ok { 123 r0 = rf(peerID) 124 } else { 125 if ret.Get(0) != nil { 126 r0 = ret.Get(0).(map[string]p2p.TopicScoreSnapshot) 127 } 128 } 129 130 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 131 r1 = rf(peerID) 132 } else { 133 r1 = ret.Get(1).(bool) 134 } 135 136 return r0, r1 137 } 138 139 type mockConstructorTestingTNewPeerScoreExposer interface { 140 mock.TestingT 141 Cleanup(func()) 142 } 143 144 // NewPeerScoreExposer creates a new instance of PeerScoreExposer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 145 func NewPeerScoreExposer(t mockConstructorTestingTNewPeerScoreExposer) *PeerScoreExposer { 146 mock := &PeerScoreExposer{} 147 mock.Mock.Test(t) 148 149 t.Cleanup(func() { mock.AssertExpectations(t) }) 150 151 return mock 152 }