github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/network.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocknetwork 4 5 import ( 6 datastore "github.com/ipfs/go-datastore" 7 8 channels "github.com/onflow/flow-go/network/channels" 9 10 irrecoverable "github.com/onflow/flow-go/module/irrecoverable" 11 12 mock "github.com/stretchr/testify/mock" 13 14 network "github.com/onflow/flow-go/network" 15 16 protocol "github.com/libp2p/go-libp2p/core/protocol" 17 ) 18 19 // Network is an autogenerated mock type for the Network type 20 type Network struct { 21 mock.Mock 22 } 23 24 // Done provides a mock function with given fields: 25 func (_m *Network) Done() <-chan struct{} { 26 ret := _m.Called() 27 28 var r0 <-chan struct{} 29 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 30 r0 = rf() 31 } else { 32 if ret.Get(0) != nil { 33 r0 = ret.Get(0).(<-chan struct{}) 34 } 35 } 36 37 return r0 38 } 39 40 // Ready provides a mock function with given fields: 41 func (_m *Network) Ready() <-chan struct{} { 42 ret := _m.Called() 43 44 var r0 <-chan struct{} 45 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 46 r0 = rf() 47 } else { 48 if ret.Get(0) != nil { 49 r0 = ret.Get(0).(<-chan struct{}) 50 } 51 } 52 53 return r0 54 } 55 56 // Register provides a mock function with given fields: channel, messageProcessor 57 func (_m *Network) Register(channel channels.Channel, messageProcessor network.MessageProcessor) (network.Conduit, error) { 58 ret := _m.Called(channel, messageProcessor) 59 60 var r0 network.Conduit 61 var r1 error 62 if rf, ok := ret.Get(0).(func(channels.Channel, network.MessageProcessor) (network.Conduit, error)); ok { 63 return rf(channel, messageProcessor) 64 } 65 if rf, ok := ret.Get(0).(func(channels.Channel, network.MessageProcessor) network.Conduit); ok { 66 r0 = rf(channel, messageProcessor) 67 } else { 68 if ret.Get(0) != nil { 69 r0 = ret.Get(0).(network.Conduit) 70 } 71 } 72 73 if rf, ok := ret.Get(1).(func(channels.Channel, network.MessageProcessor) error); ok { 74 r1 = rf(channel, messageProcessor) 75 } else { 76 r1 = ret.Error(1) 77 } 78 79 return r0, r1 80 } 81 82 // RegisterBlobService provides a mock function with given fields: channel, store, opts 83 func (_m *Network) RegisterBlobService(channel channels.Channel, store datastore.Batching, opts ...network.BlobServiceOption) (network.BlobService, error) { 84 _va := make([]interface{}, len(opts)) 85 for _i := range opts { 86 _va[_i] = opts[_i] 87 } 88 var _ca []interface{} 89 _ca = append(_ca, channel, store) 90 _ca = append(_ca, _va...) 91 ret := _m.Called(_ca...) 92 93 var r0 network.BlobService 94 var r1 error 95 if rf, ok := ret.Get(0).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) (network.BlobService, error)); ok { 96 return rf(channel, store, opts...) 97 } 98 if rf, ok := ret.Get(0).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) network.BlobService); ok { 99 r0 = rf(channel, store, opts...) 100 } else { 101 if ret.Get(0) != nil { 102 r0 = ret.Get(0).(network.BlobService) 103 } 104 } 105 106 if rf, ok := ret.Get(1).(func(channels.Channel, datastore.Batching, ...network.BlobServiceOption) error); ok { 107 r1 = rf(channel, store, opts...) 108 } else { 109 r1 = ret.Error(1) 110 } 111 112 return r0, r1 113 } 114 115 // RegisterPingService provides a mock function with given fields: pingProtocolID, pingInfoProvider 116 func (_m *Network) RegisterPingService(pingProtocolID protocol.ID, pingInfoProvider network.PingInfoProvider) (network.PingService, error) { 117 ret := _m.Called(pingProtocolID, pingInfoProvider) 118 119 var r0 network.PingService 120 var r1 error 121 if rf, ok := ret.Get(0).(func(protocol.ID, network.PingInfoProvider) (network.PingService, error)); ok { 122 return rf(pingProtocolID, pingInfoProvider) 123 } 124 if rf, ok := ret.Get(0).(func(protocol.ID, network.PingInfoProvider) network.PingService); ok { 125 r0 = rf(pingProtocolID, pingInfoProvider) 126 } else { 127 if ret.Get(0) != nil { 128 r0 = ret.Get(0).(network.PingService) 129 } 130 } 131 132 if rf, ok := ret.Get(1).(func(protocol.ID, network.PingInfoProvider) error); ok { 133 r1 = rf(pingProtocolID, pingInfoProvider) 134 } else { 135 r1 = ret.Error(1) 136 } 137 138 return r0, r1 139 } 140 141 // Start provides a mock function with given fields: _a0 142 func (_m *Network) Start(_a0 irrecoverable.SignalerContext) { 143 _m.Called(_a0) 144 } 145 146 type mockConstructorTestingTNewNetwork interface { 147 mock.TestingT 148 Cleanup(func()) 149 } 150 151 // NewNetwork creates a new instance of Network. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 152 func NewNetwork(t mockConstructorTestingTNewNetwork) *Network { 153 mock := &Network{} 154 mock.Mock.Test(t) 155 156 t.Cleanup(func() { mock.AssertExpectations(t) }) 157 158 return mock 159 }