github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/connection_gater.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 control "github.com/libp2p/go-libp2p/core/control" 7 mock "github.com/stretchr/testify/mock" 8 9 multiaddr "github.com/multiformats/go-multiaddr" 10 11 network "github.com/libp2p/go-libp2p/core/network" 12 13 p2p "github.com/onflow/flow-go/network/p2p" 14 15 peer "github.com/libp2p/go-libp2p/core/peer" 16 ) 17 18 // ConnectionGater is an autogenerated mock type for the ConnectionGater type 19 type ConnectionGater struct { 20 mock.Mock 21 } 22 23 // InterceptAccept provides a mock function with given fields: _a0 24 func (_m *ConnectionGater) InterceptAccept(_a0 network.ConnMultiaddrs) bool { 25 ret := _m.Called(_a0) 26 27 var r0 bool 28 if rf, ok := ret.Get(0).(func(network.ConnMultiaddrs) bool); ok { 29 r0 = rf(_a0) 30 } else { 31 r0 = ret.Get(0).(bool) 32 } 33 34 return r0 35 } 36 37 // InterceptAddrDial provides a mock function with given fields: _a0, _a1 38 func (_m *ConnectionGater) InterceptAddrDial(_a0 peer.ID, _a1 multiaddr.Multiaddr) bool { 39 ret := _m.Called(_a0, _a1) 40 41 var r0 bool 42 if rf, ok := ret.Get(0).(func(peer.ID, multiaddr.Multiaddr) bool); ok { 43 r0 = rf(_a0, _a1) 44 } else { 45 r0 = ret.Get(0).(bool) 46 } 47 48 return r0 49 } 50 51 // InterceptPeerDial provides a mock function with given fields: p 52 func (_m *ConnectionGater) InterceptPeerDial(p peer.ID) bool { 53 ret := _m.Called(p) 54 55 var r0 bool 56 if rf, ok := ret.Get(0).(func(peer.ID) bool); ok { 57 r0 = rf(p) 58 } else { 59 r0 = ret.Get(0).(bool) 60 } 61 62 return r0 63 } 64 65 // InterceptSecured provides a mock function with given fields: _a0, _a1, _a2 66 func (_m *ConnectionGater) InterceptSecured(_a0 network.Direction, _a1 peer.ID, _a2 network.ConnMultiaddrs) bool { 67 ret := _m.Called(_a0, _a1, _a2) 68 69 var r0 bool 70 if rf, ok := ret.Get(0).(func(network.Direction, peer.ID, network.ConnMultiaddrs) bool); ok { 71 r0 = rf(_a0, _a1, _a2) 72 } else { 73 r0 = ret.Get(0).(bool) 74 } 75 76 return r0 77 } 78 79 // InterceptUpgraded provides a mock function with given fields: _a0 80 func (_m *ConnectionGater) InterceptUpgraded(_a0 network.Conn) (bool, control.DisconnectReason) { 81 ret := _m.Called(_a0) 82 83 var r0 bool 84 var r1 control.DisconnectReason 85 if rf, ok := ret.Get(0).(func(network.Conn) (bool, control.DisconnectReason)); ok { 86 return rf(_a0) 87 } 88 if rf, ok := ret.Get(0).(func(network.Conn) bool); ok { 89 r0 = rf(_a0) 90 } else { 91 r0 = ret.Get(0).(bool) 92 } 93 94 if rf, ok := ret.Get(1).(func(network.Conn) control.DisconnectReason); ok { 95 r1 = rf(_a0) 96 } else { 97 r1 = ret.Get(1).(control.DisconnectReason) 98 } 99 100 return r0, r1 101 } 102 103 // SetDisallowListOracle provides a mock function with given fields: oracle 104 func (_m *ConnectionGater) SetDisallowListOracle(oracle p2p.DisallowListOracle) { 105 _m.Called(oracle) 106 } 107 108 type mockConstructorTestingTNewConnectionGater interface { 109 mock.TestingT 110 Cleanup(func()) 111 } 112 113 // NewConnectionGater creates a new instance of ConnectionGater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 114 func NewConnectionGater(t mockConstructorTestingTNewConnectionGater) *ConnectionGater { 115 mock := &ConnectionGater{} 116 mock.Mock.Test(t) 117 118 t.Cleanup(func() { mock.AssertExpectations(t) }) 119 120 return mock 121 }