github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/subscription_provider.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 irrecoverable "github.com/onflow/flow-go/module/irrecoverable" 7 mock "github.com/stretchr/testify/mock" 8 9 peer "github.com/libp2p/go-libp2p/core/peer" 10 ) 11 12 // SubscriptionProvider is an autogenerated mock type for the SubscriptionProvider type 13 type SubscriptionProvider struct { 14 mock.Mock 15 } 16 17 // Done provides a mock function with given fields: 18 func (_m *SubscriptionProvider) Done() <-chan struct{} { 19 ret := _m.Called() 20 21 var r0 <-chan struct{} 22 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 23 r0 = rf() 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).(<-chan struct{}) 27 } 28 } 29 30 return r0 31 } 32 33 // GetSubscribedTopics provides a mock function with given fields: pid 34 func (_m *SubscriptionProvider) GetSubscribedTopics(pid peer.ID) []string { 35 ret := _m.Called(pid) 36 37 var r0 []string 38 if rf, ok := ret.Get(0).(func(peer.ID) []string); ok { 39 r0 = rf(pid) 40 } else { 41 if ret.Get(0) != nil { 42 r0 = ret.Get(0).([]string) 43 } 44 } 45 46 return r0 47 } 48 49 // Ready provides a mock function with given fields: 50 func (_m *SubscriptionProvider) Ready() <-chan struct{} { 51 ret := _m.Called() 52 53 var r0 <-chan struct{} 54 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 55 r0 = rf() 56 } else { 57 if ret.Get(0) != nil { 58 r0 = ret.Get(0).(<-chan struct{}) 59 } 60 } 61 62 return r0 63 } 64 65 // Start provides a mock function with given fields: _a0 66 func (_m *SubscriptionProvider) Start(_a0 irrecoverable.SignalerContext) { 67 _m.Called(_a0) 68 } 69 70 type mockConstructorTestingTNewSubscriptionProvider interface { 71 mock.TestingT 72 Cleanup(func()) 73 } 74 75 // NewSubscriptionProvider creates a new instance of SubscriptionProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 76 func NewSubscriptionProvider(t mockConstructorTestingTNewSubscriptionProvider) *SubscriptionProvider { 77 mock := &SubscriptionProvider{} 78 mock.Mock.Test(t) 79 80 t.Cleanup(func() { mock.AssertExpectations(t) }) 81 82 return mock 83 }