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