github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/node_builder.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 context "context" 7 8 connmgr "github.com/libp2p/go-libp2p/core/connmgr" 9 10 host "github.com/libp2p/go-libp2p/core/host" 11 12 madns "github.com/multiformats/go-multiaddr-dns" 13 14 mock "github.com/stretchr/testify/mock" 15 16 network "github.com/libp2p/go-libp2p/core/network" 17 18 p2p "github.com/onflow/flow-go/network/p2p" 19 20 pubsub "github.com/libp2p/go-libp2p-pubsub" 21 22 routing "github.com/libp2p/go-libp2p/core/routing" 23 ) 24 25 // NodeBuilder is an autogenerated mock type for the NodeBuilder type 26 type NodeBuilder struct { 27 mock.Mock 28 } 29 30 // Build provides a mock function with given fields: 31 func (_m *NodeBuilder) Build() (p2p.LibP2PNode, error) { 32 ret := _m.Called() 33 34 var r0 p2p.LibP2PNode 35 var r1 error 36 if rf, ok := ret.Get(0).(func() (p2p.LibP2PNode, error)); ok { 37 return rf() 38 } 39 if rf, ok := ret.Get(0).(func() p2p.LibP2PNode); ok { 40 r0 = rf() 41 } else { 42 if ret.Get(0) != nil { 43 r0 = ret.Get(0).(p2p.LibP2PNode) 44 } 45 } 46 47 if rf, ok := ret.Get(1).(func() error); ok { 48 r1 = rf() 49 } else { 50 r1 = ret.Error(1) 51 } 52 53 return r0, r1 54 } 55 56 // OverrideDefaultRpcInspectorFactory provides a mock function with given fields: _a0 57 func (_m *NodeBuilder) OverrideDefaultRpcInspectorFactory(_a0 p2p.GossipSubRpcInspectorFactoryFunc) p2p.NodeBuilder { 58 ret := _m.Called(_a0) 59 60 var r0 p2p.NodeBuilder 61 if rf, ok := ret.Get(0).(func(p2p.GossipSubRpcInspectorFactoryFunc) p2p.NodeBuilder); ok { 62 r0 = rf(_a0) 63 } else { 64 if ret.Get(0) != nil { 65 r0 = ret.Get(0).(p2p.NodeBuilder) 66 } 67 } 68 69 return r0 70 } 71 72 // OverrideGossipSubFactory provides a mock function with given fields: _a0, _a1 73 func (_m *NodeBuilder) OverrideGossipSubFactory(_a0 p2p.GossipSubFactoryFunc, _a1 p2p.GossipSubAdapterConfigFunc) p2p.NodeBuilder { 74 ret := _m.Called(_a0, _a1) 75 76 var r0 p2p.NodeBuilder 77 if rf, ok := ret.Get(0).(func(p2p.GossipSubFactoryFunc, p2p.GossipSubAdapterConfigFunc) p2p.NodeBuilder); ok { 78 r0 = rf(_a0, _a1) 79 } else { 80 if ret.Get(0) != nil { 81 r0 = ret.Get(0).(p2p.NodeBuilder) 82 } 83 } 84 85 return r0 86 } 87 88 // OverrideGossipSubScoringConfig provides a mock function with given fields: _a0 89 func (_m *NodeBuilder) OverrideGossipSubScoringConfig(_a0 *p2p.PeerScoringConfigOverride) p2p.NodeBuilder { 90 ret := _m.Called(_a0) 91 92 var r0 p2p.NodeBuilder 93 if rf, ok := ret.Get(0).(func(*p2p.PeerScoringConfigOverride) p2p.NodeBuilder); ok { 94 r0 = rf(_a0) 95 } else { 96 if ret.Get(0) != nil { 97 r0 = ret.Get(0).(p2p.NodeBuilder) 98 } 99 } 100 101 return r0 102 } 103 104 // OverrideNodeConstructor provides a mock function with given fields: _a0 105 func (_m *NodeBuilder) OverrideNodeConstructor(_a0 p2p.NodeConstructor) p2p.NodeBuilder { 106 ret := _m.Called(_a0) 107 108 var r0 p2p.NodeBuilder 109 if rf, ok := ret.Get(0).(func(p2p.NodeConstructor) p2p.NodeBuilder); ok { 110 r0 = rf(_a0) 111 } else { 112 if ret.Get(0) != nil { 113 r0 = ret.Get(0).(p2p.NodeBuilder) 114 } 115 } 116 117 return r0 118 } 119 120 // SetBasicResolver provides a mock function with given fields: _a0 121 func (_m *NodeBuilder) SetBasicResolver(_a0 madns.BasicResolver) p2p.NodeBuilder { 122 ret := _m.Called(_a0) 123 124 var r0 p2p.NodeBuilder 125 if rf, ok := ret.Get(0).(func(madns.BasicResolver) p2p.NodeBuilder); ok { 126 r0 = rf(_a0) 127 } else { 128 if ret.Get(0) != nil { 129 r0 = ret.Get(0).(p2p.NodeBuilder) 130 } 131 } 132 133 return r0 134 } 135 136 // SetConnectionGater provides a mock function with given fields: _a0 137 func (_m *NodeBuilder) SetConnectionGater(_a0 p2p.ConnectionGater) p2p.NodeBuilder { 138 ret := _m.Called(_a0) 139 140 var r0 p2p.NodeBuilder 141 if rf, ok := ret.Get(0).(func(p2p.ConnectionGater) p2p.NodeBuilder); ok { 142 r0 = rf(_a0) 143 } else { 144 if ret.Get(0) != nil { 145 r0 = ret.Get(0).(p2p.NodeBuilder) 146 } 147 } 148 149 return r0 150 } 151 152 // SetConnectionManager provides a mock function with given fields: _a0 153 func (_m *NodeBuilder) SetConnectionManager(_a0 connmgr.ConnManager) p2p.NodeBuilder { 154 ret := _m.Called(_a0) 155 156 var r0 p2p.NodeBuilder 157 if rf, ok := ret.Get(0).(func(connmgr.ConnManager) p2p.NodeBuilder); ok { 158 r0 = rf(_a0) 159 } else { 160 if ret.Get(0) != nil { 161 r0 = ret.Get(0).(p2p.NodeBuilder) 162 } 163 } 164 165 return r0 166 } 167 168 // SetResourceManager provides a mock function with given fields: _a0 169 func (_m *NodeBuilder) SetResourceManager(_a0 network.ResourceManager) p2p.NodeBuilder { 170 ret := _m.Called(_a0) 171 172 var r0 p2p.NodeBuilder 173 if rf, ok := ret.Get(0).(func(network.ResourceManager) p2p.NodeBuilder); ok { 174 r0 = rf(_a0) 175 } else { 176 if ret.Get(0) != nil { 177 r0 = ret.Get(0).(p2p.NodeBuilder) 178 } 179 } 180 181 return r0 182 } 183 184 // SetRoutingSystem provides a mock function with given fields: _a0 185 func (_m *NodeBuilder) SetRoutingSystem(_a0 func(context.Context, host.Host) (routing.Routing, error)) p2p.NodeBuilder { 186 ret := _m.Called(_a0) 187 188 var r0 p2p.NodeBuilder 189 if rf, ok := ret.Get(0).(func(func(context.Context, host.Host) (routing.Routing, error)) p2p.NodeBuilder); ok { 190 r0 = rf(_a0) 191 } else { 192 if ret.Get(0) != nil { 193 r0 = ret.Get(0).(p2p.NodeBuilder) 194 } 195 } 196 197 return r0 198 } 199 200 // SetSubscriptionFilter provides a mock function with given fields: _a0 201 func (_m *NodeBuilder) SetSubscriptionFilter(_a0 pubsub.SubscriptionFilter) p2p.NodeBuilder { 202 ret := _m.Called(_a0) 203 204 var r0 p2p.NodeBuilder 205 if rf, ok := ret.Get(0).(func(pubsub.SubscriptionFilter) p2p.NodeBuilder); ok { 206 r0 = rf(_a0) 207 } else { 208 if ret.Get(0) != nil { 209 r0 = ret.Get(0).(p2p.NodeBuilder) 210 } 211 } 212 213 return r0 214 } 215 216 type mockConstructorTestingTNewNodeBuilder interface { 217 mock.TestingT 218 Cleanup(func()) 219 } 220 221 // NewNodeBuilder creates a new instance of NodeBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 222 func NewNodeBuilder(t mockConstructorTestingTNewNodeBuilder) *NodeBuilder { 223 mock := &NodeBuilder{} 224 mock.Mock.Test(t) 225 226 t.Cleanup(func() { mock.AssertExpectations(t) }) 227 228 return mock 229 }