github.com/aergoio/aergo@v1.3.1/p2p/p2pmock/mock_networktransport.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: github.com/aergoio/aergo/p2p/p2pcommon (interfaces: NTContainer,NetworkTransport) 3 4 // Package mock_p2pcommon is a generated GoMock package. 5 package p2pmock 6 7 import ( 8 context "context" 9 p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" 10 types "github.com/aergoio/aergo/types" 11 gomock "github.com/golang/mock/gomock" 12 connmgr "github.com/libp2p/go-libp2p-core/connmgr" 13 network "github.com/libp2p/go-libp2p-core/network" 14 peer "github.com/libp2p/go-libp2p-core/peer" 15 peerstore "github.com/libp2p/go-libp2p-core/peerstore" 16 protocol "github.com/libp2p/go-libp2p-core/protocol" 17 go_multiaddr "github.com/multiformats/go-multiaddr" 18 reflect "reflect" 19 time "time" 20 ) 21 22 // MockNTContainer is a mock of NTContainer interface 23 type MockNTContainer struct { 24 ctrl *gomock.Controller 25 recorder *MockNTContainerMockRecorder 26 } 27 28 // MockNTContainerMockRecorder is the mock recorder for MockNTContainer 29 type MockNTContainerMockRecorder struct { 30 mock *MockNTContainer 31 } 32 33 // NewMockNTContainer creates a new mock instance 34 func NewMockNTContainer(ctrl *gomock.Controller) *MockNTContainer { 35 mock := &MockNTContainer{ctrl: ctrl} 36 mock.recorder = &MockNTContainerMockRecorder{mock} 37 return mock 38 } 39 40 // EXPECT returns an object that allows the caller to indicate expected use 41 func (m *MockNTContainer) EXPECT() *MockNTContainerMockRecorder { 42 return m.recorder 43 } 44 45 // ChainID mocks base method 46 func (m *MockNTContainer) ChainID() *types.ChainID { 47 m.ctrl.T.Helper() 48 ret := m.ctrl.Call(m, "ChainID") 49 ret0, _ := ret[0].(*types.ChainID) 50 return ret0 51 } 52 53 // ChainID indicates an expected call of ChainID 54 func (mr *MockNTContainerMockRecorder) ChainID() *gomock.Call { 55 mr.mock.ctrl.T.Helper() 56 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainID", reflect.TypeOf((*MockNTContainer)(nil).ChainID)) 57 } 58 59 // GetNetworkTransport mocks base method 60 func (m *MockNTContainer) GetNetworkTransport() p2pcommon.NetworkTransport { 61 m.ctrl.T.Helper() 62 ret := m.ctrl.Call(m, "GetNetworkTransport") 63 ret0, _ := ret[0].(p2pcommon.NetworkTransport) 64 return ret0 65 } 66 67 // GetNetworkTransport indicates an expected call of GetNetworkTransport 68 func (mr *MockNTContainerMockRecorder) GetNetworkTransport() *gomock.Call { 69 mr.mock.ctrl.T.Helper() 70 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetworkTransport", reflect.TypeOf((*MockNTContainer)(nil).GetNetworkTransport)) 71 } 72 73 // SelfMeta mocks base method 74 func (m *MockNTContainer) SelfMeta() p2pcommon.PeerMeta { 75 m.ctrl.T.Helper() 76 ret := m.ctrl.Call(m, "SelfMeta") 77 ret0, _ := ret[0].(p2pcommon.PeerMeta) 78 return ret0 79 } 80 81 // SelfMeta indicates an expected call of SelfMeta 82 func (mr *MockNTContainerMockRecorder) SelfMeta() *gomock.Call { 83 mr.mock.ctrl.T.Helper() 84 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelfMeta", reflect.TypeOf((*MockNTContainer)(nil).SelfMeta)) 85 } 86 87 // MockNetworkTransport is a mock of NetworkTransport interface 88 type MockNetworkTransport struct { 89 ctrl *gomock.Controller 90 recorder *MockNetworkTransportMockRecorder 91 } 92 93 // MockNetworkTransportMockRecorder is the mock recorder for MockNetworkTransport 94 type MockNetworkTransportMockRecorder struct { 95 mock *MockNetworkTransport 96 } 97 98 // NewMockNetworkTransport creates a new mock instance 99 func NewMockNetworkTransport(ctrl *gomock.Controller) *MockNetworkTransport { 100 mock := &MockNetworkTransport{ctrl: ctrl} 101 mock.recorder = &MockNetworkTransportMockRecorder{mock} 102 return mock 103 } 104 105 // EXPECT returns an object that allows the caller to indicate expected use 106 func (m *MockNetworkTransport) EXPECT() *MockNetworkTransportMockRecorder { 107 return m.recorder 108 } 109 110 // AddStreamHandler mocks base method 111 func (m *MockNetworkTransport) AddStreamHandler(arg0 protocol.ID, arg1 network.StreamHandler) { 112 m.ctrl.T.Helper() 113 m.ctrl.Call(m, "AddStreamHandler", arg0, arg1) 114 } 115 116 // AddStreamHandler indicates an expected call of AddStreamHandler 117 func (mr *MockNetworkTransportMockRecorder) AddStreamHandler(arg0, arg1 interface{}) *gomock.Call { 118 mr.mock.ctrl.T.Helper() 119 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddStreamHandler", reflect.TypeOf((*MockNetworkTransport)(nil).AddStreamHandler), arg0, arg1) 120 } 121 122 // Addrs mocks base method 123 func (m *MockNetworkTransport) Addrs() []go_multiaddr.Multiaddr { 124 m.ctrl.T.Helper() 125 ret := m.ctrl.Call(m, "Addrs") 126 ret0, _ := ret[0].([]go_multiaddr.Multiaddr) 127 return ret0 128 } 129 130 // Addrs indicates an expected call of Addrs 131 func (mr *MockNetworkTransportMockRecorder) Addrs() *gomock.Call { 132 mr.mock.ctrl.T.Helper() 133 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addrs", reflect.TypeOf((*MockNetworkTransport)(nil).Addrs)) 134 } 135 136 // Close mocks base method 137 func (m *MockNetworkTransport) Close() error { 138 m.ctrl.T.Helper() 139 ret := m.ctrl.Call(m, "Close") 140 ret0, _ := ret[0].(error) 141 return ret0 142 } 143 144 // Close indicates an expected call of Close 145 func (mr *MockNetworkTransportMockRecorder) Close() *gomock.Call { 146 mr.mock.ctrl.T.Helper() 147 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockNetworkTransport)(nil).Close)) 148 } 149 150 // ClosePeerConnection mocks base method 151 func (m *MockNetworkTransport) ClosePeerConnection(arg0 peer.ID) bool { 152 m.ctrl.T.Helper() 153 ret := m.ctrl.Call(m, "ClosePeerConnection", arg0) 154 ret0, _ := ret[0].(bool) 155 return ret0 156 } 157 158 // ClosePeerConnection indicates an expected call of ClosePeerConnection 159 func (mr *MockNetworkTransportMockRecorder) ClosePeerConnection(arg0 interface{}) *gomock.Call { 160 mr.mock.ctrl.T.Helper() 161 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClosePeerConnection", reflect.TypeOf((*MockNetworkTransport)(nil).ClosePeerConnection), arg0) 162 } 163 164 // ConnManager mocks base method 165 func (m *MockNetworkTransport) ConnManager() connmgr.ConnManager { 166 m.ctrl.T.Helper() 167 ret := m.ctrl.Call(m, "ConnManager") 168 ret0, _ := ret[0].(connmgr.ConnManager) 169 return ret0 170 } 171 172 // ConnManager indicates an expected call of ConnManager 173 func (mr *MockNetworkTransportMockRecorder) ConnManager() *gomock.Call { 174 mr.mock.ctrl.T.Helper() 175 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnManager", reflect.TypeOf((*MockNetworkTransport)(nil).ConnManager)) 176 } 177 178 // Connect mocks base method 179 func (m *MockNetworkTransport) Connect(arg0 context.Context, arg1 peer.AddrInfo) error { 180 m.ctrl.T.Helper() 181 ret := m.ctrl.Call(m, "Connect", arg0, arg1) 182 ret0, _ := ret[0].(error) 183 return ret0 184 } 185 186 // Connect indicates an expected call of Connect 187 func (mr *MockNetworkTransportMockRecorder) Connect(arg0, arg1 interface{}) *gomock.Call { 188 mr.mock.ctrl.T.Helper() 189 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockNetworkTransport)(nil).Connect), arg0, arg1) 190 } 191 192 // FindPeer mocks base method 193 func (m *MockNetworkTransport) FindPeer(arg0 peer.ID) bool { 194 m.ctrl.T.Helper() 195 ret := m.ctrl.Call(m, "FindPeer", arg0) 196 ret0, _ := ret[0].(bool) 197 return ret0 198 } 199 200 // FindPeer indicates an expected call of FindPeer 201 func (mr *MockNetworkTransportMockRecorder) FindPeer(arg0 interface{}) *gomock.Call { 202 mr.mock.ctrl.T.Helper() 203 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindPeer", reflect.TypeOf((*MockNetworkTransport)(nil).FindPeer), arg0) 204 } 205 206 // GetAddressesOfPeer mocks base method 207 func (m *MockNetworkTransport) GetAddressesOfPeer(arg0 peer.ID) []string { 208 m.ctrl.T.Helper() 209 ret := m.ctrl.Call(m, "GetAddressesOfPeer", arg0) 210 ret0, _ := ret[0].([]string) 211 return ret0 212 } 213 214 // GetAddressesOfPeer indicates an expected call of GetAddressesOfPeer 215 func (mr *MockNetworkTransportMockRecorder) GetAddressesOfPeer(arg0 interface{}) *gomock.Call { 216 mr.mock.ctrl.T.Helper() 217 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddressesOfPeer", reflect.TypeOf((*MockNetworkTransport)(nil).GetAddressesOfPeer), arg0) 218 } 219 220 // GetOrCreateStream mocks base method 221 func (m *MockNetworkTransport) GetOrCreateStream(arg0 p2pcommon.PeerMeta, arg1 ...protocol.ID) (network.Stream, error) { 222 m.ctrl.T.Helper() 223 varargs := []interface{}{arg0} 224 for _, a := range arg1 { 225 varargs = append(varargs, a) 226 } 227 ret := m.ctrl.Call(m, "GetOrCreateStream", varargs...) 228 ret0, _ := ret[0].(network.Stream) 229 ret1, _ := ret[1].(error) 230 return ret0, ret1 231 } 232 233 // GetOrCreateStream indicates an expected call of GetOrCreateStream 234 func (mr *MockNetworkTransportMockRecorder) GetOrCreateStream(arg0 interface{}, arg1 ...interface{}) *gomock.Call { 235 mr.mock.ctrl.T.Helper() 236 varargs := append([]interface{}{arg0}, arg1...) 237 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreateStream", reflect.TypeOf((*MockNetworkTransport)(nil).GetOrCreateStream), varargs...) 238 } 239 240 // GetOrCreateStreamWithTTL mocks base method 241 func (m *MockNetworkTransport) GetOrCreateStreamWithTTL(arg0 p2pcommon.PeerMeta, arg1 time.Duration, arg2 ...protocol.ID) (network.Stream, error) { 242 m.ctrl.T.Helper() 243 varargs := []interface{}{arg0, arg1} 244 for _, a := range arg2 { 245 varargs = append(varargs, a) 246 } 247 ret := m.ctrl.Call(m, "GetOrCreateStreamWithTTL", varargs...) 248 ret0, _ := ret[0].(network.Stream) 249 ret1, _ := ret[1].(error) 250 return ret0, ret1 251 } 252 253 // GetOrCreateStreamWithTTL indicates an expected call of GetOrCreateStreamWithTTL 254 func (mr *MockNetworkTransportMockRecorder) GetOrCreateStreamWithTTL(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { 255 mr.mock.ctrl.T.Helper() 256 varargs := append([]interface{}{arg0, arg1}, arg2...) 257 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreateStreamWithTTL", reflect.TypeOf((*MockNetworkTransport)(nil).GetOrCreateStreamWithTTL), varargs...) 258 } 259 260 // ID mocks base method 261 func (m *MockNetworkTransport) ID() peer.ID { 262 m.ctrl.T.Helper() 263 ret := m.ctrl.Call(m, "ID") 264 ret0, _ := ret[0].(peer.ID) 265 return ret0 266 } 267 268 // ID indicates an expected call of ID 269 func (mr *MockNetworkTransportMockRecorder) ID() *gomock.Call { 270 mr.mock.ctrl.T.Helper() 271 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockNetworkTransport)(nil).ID)) 272 } 273 274 // Mux mocks base method 275 func (m *MockNetworkTransport) Mux() protocol.Switch { 276 m.ctrl.T.Helper() 277 ret := m.ctrl.Call(m, "Mux") 278 ret0, _ := ret[0].(protocol.Switch) 279 return ret0 280 } 281 282 // Mux indicates an expected call of Mux 283 func (mr *MockNetworkTransportMockRecorder) Mux() *gomock.Call { 284 mr.mock.ctrl.T.Helper() 285 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Mux", reflect.TypeOf((*MockNetworkTransport)(nil).Mux)) 286 } 287 288 // Network mocks base method 289 func (m *MockNetworkTransport) Network() network.Network { 290 m.ctrl.T.Helper() 291 ret := m.ctrl.Call(m, "Network") 292 ret0, _ := ret[0].(network.Network) 293 return ret0 294 } 295 296 // Network indicates an expected call of Network 297 func (mr *MockNetworkTransportMockRecorder) Network() *gomock.Call { 298 mr.mock.ctrl.T.Helper() 299 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Network", reflect.TypeOf((*MockNetworkTransport)(nil).Network)) 300 } 301 302 // NewStream mocks base method 303 func (m *MockNetworkTransport) NewStream(arg0 context.Context, arg1 peer.ID, arg2 ...protocol.ID) (network.Stream, error) { 304 m.ctrl.T.Helper() 305 varargs := []interface{}{arg0, arg1} 306 for _, a := range arg2 { 307 varargs = append(varargs, a) 308 } 309 ret := m.ctrl.Call(m, "NewStream", varargs...) 310 ret0, _ := ret[0].(network.Stream) 311 ret1, _ := ret[1].(error) 312 return ret0, ret1 313 } 314 315 // NewStream indicates an expected call of NewStream 316 func (mr *MockNetworkTransportMockRecorder) NewStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { 317 mr.mock.ctrl.T.Helper() 318 varargs := append([]interface{}{arg0, arg1}, arg2...) 319 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewStream", reflect.TypeOf((*MockNetworkTransport)(nil).NewStream), varargs...) 320 } 321 322 // Peerstore mocks base method 323 func (m *MockNetworkTransport) Peerstore() peerstore.Peerstore { 324 m.ctrl.T.Helper() 325 ret := m.ctrl.Call(m, "Peerstore") 326 ret0, _ := ret[0].(peerstore.Peerstore) 327 return ret0 328 } 329 330 // Peerstore indicates an expected call of Peerstore 331 func (mr *MockNetworkTransportMockRecorder) Peerstore() *gomock.Call { 332 mr.mock.ctrl.T.Helper() 333 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peerstore", reflect.TypeOf((*MockNetworkTransport)(nil).Peerstore)) 334 } 335 336 // RemoveStreamHandler mocks base method 337 func (m *MockNetworkTransport) RemoveStreamHandler(arg0 protocol.ID) { 338 m.ctrl.T.Helper() 339 m.ctrl.Call(m, "RemoveStreamHandler", arg0) 340 } 341 342 // RemoveStreamHandler indicates an expected call of RemoveStreamHandler 343 func (mr *MockNetworkTransportMockRecorder) RemoveStreamHandler(arg0 interface{}) *gomock.Call { 344 mr.mock.ctrl.T.Helper() 345 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveStreamHandler", reflect.TypeOf((*MockNetworkTransport)(nil).RemoveStreamHandler), arg0) 346 } 347 348 // SelfMeta mocks base method 349 func (m *MockNetworkTransport) SelfMeta() p2pcommon.PeerMeta { 350 m.ctrl.T.Helper() 351 ret := m.ctrl.Call(m, "SelfMeta") 352 ret0, _ := ret[0].(p2pcommon.PeerMeta) 353 return ret0 354 } 355 356 // SelfMeta indicates an expected call of SelfMeta 357 func (mr *MockNetworkTransportMockRecorder) SelfMeta() *gomock.Call { 358 mr.mock.ctrl.T.Helper() 359 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelfMeta", reflect.TypeOf((*MockNetworkTransport)(nil).SelfMeta)) 360 } 361 362 // SetStreamHandler mocks base method 363 func (m *MockNetworkTransport) SetStreamHandler(arg0 protocol.ID, arg1 network.StreamHandler) { 364 m.ctrl.T.Helper() 365 m.ctrl.Call(m, "SetStreamHandler", arg0, arg1) 366 } 367 368 // SetStreamHandler indicates an expected call of SetStreamHandler 369 func (mr *MockNetworkTransportMockRecorder) SetStreamHandler(arg0, arg1 interface{}) *gomock.Call { 370 mr.mock.ctrl.T.Helper() 371 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStreamHandler", reflect.TypeOf((*MockNetworkTransport)(nil).SetStreamHandler), arg0, arg1) 372 } 373 374 // SetStreamHandlerMatch mocks base method 375 func (m *MockNetworkTransport) SetStreamHandlerMatch(arg0 protocol.ID, arg1 func(string) bool, arg2 network.StreamHandler) { 376 m.ctrl.T.Helper() 377 m.ctrl.Call(m, "SetStreamHandlerMatch", arg0, arg1, arg2) 378 } 379 380 // SetStreamHandlerMatch indicates an expected call of SetStreamHandlerMatch 381 func (mr *MockNetworkTransportMockRecorder) SetStreamHandlerMatch(arg0, arg1, arg2 interface{}) *gomock.Call { 382 mr.mock.ctrl.T.Helper() 383 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStreamHandlerMatch", reflect.TypeOf((*MockNetworkTransport)(nil).SetStreamHandlerMatch), arg0, arg1, arg2) 384 } 385 386 // Start mocks base method 387 func (m *MockNetworkTransport) Start() error { 388 m.ctrl.T.Helper() 389 ret := m.ctrl.Call(m, "Start") 390 ret0, _ := ret[0].(error) 391 return ret0 392 } 393 394 // Start indicates an expected call of Start 395 func (mr *MockNetworkTransportMockRecorder) Start() *gomock.Call { 396 mr.mock.ctrl.T.Helper() 397 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockNetworkTransport)(nil).Start)) 398 } 399 400 // Stop mocks base method 401 func (m *MockNetworkTransport) Stop() error { 402 m.ctrl.T.Helper() 403 ret := m.ctrl.Call(m, "Stop") 404 ret0, _ := ret[0].(error) 405 return ret0 406 } 407 408 // Stop indicates an expected call of Stop 409 func (mr *MockNetworkTransportMockRecorder) Stop() *gomock.Call { 410 mr.mock.ctrl.T.Helper() 411 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockNetworkTransport)(nil).Stop)) 412 }