github.com/koko1123/flow-go-1@v0.29.6/network/mocknetwork/blob_service.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mocknetwork 4 5 import ( 6 blocks "github.com/ipfs/go-block-format" 7 cid "github.com/ipfs/go-cid" 8 9 context "context" 10 11 irrecoverable "github.com/koko1123/flow-go-1/module/irrecoverable" 12 13 mock "github.com/stretchr/testify/mock" 14 15 network "github.com/koko1123/flow-go-1/network" 16 ) 17 18 // BlobService is an autogenerated mock type for the BlobService type 19 type BlobService struct { 20 mock.Mock 21 } 22 23 // AddBlob provides a mock function with given fields: ctx, b 24 func (_m *BlobService) AddBlob(ctx context.Context, b blocks.Block) error { 25 ret := _m.Called(ctx, b) 26 27 var r0 error 28 if rf, ok := ret.Get(0).(func(context.Context, blocks.Block) error); ok { 29 r0 = rf(ctx, b) 30 } else { 31 r0 = ret.Error(0) 32 } 33 34 return r0 35 } 36 37 // AddBlobs provides a mock function with given fields: ctx, bs 38 func (_m *BlobService) AddBlobs(ctx context.Context, bs []blocks.Block) error { 39 ret := _m.Called(ctx, bs) 40 41 var r0 error 42 if rf, ok := ret.Get(0).(func(context.Context, []blocks.Block) error); ok { 43 r0 = rf(ctx, bs) 44 } else { 45 r0 = ret.Error(0) 46 } 47 48 return r0 49 } 50 51 // DeleteBlob provides a mock function with given fields: ctx, c 52 func (_m *BlobService) DeleteBlob(ctx context.Context, c cid.Cid) error { 53 ret := _m.Called(ctx, c) 54 55 var r0 error 56 if rf, ok := ret.Get(0).(func(context.Context, cid.Cid) error); ok { 57 r0 = rf(ctx, c) 58 } else { 59 r0 = ret.Error(0) 60 } 61 62 return r0 63 } 64 65 // Done provides a mock function with given fields: 66 func (_m *BlobService) Done() <-chan struct{} { 67 ret := _m.Called() 68 69 var r0 <-chan struct{} 70 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 71 r0 = rf() 72 } else { 73 if ret.Get(0) != nil { 74 r0 = ret.Get(0).(<-chan struct{}) 75 } 76 } 77 78 return r0 79 } 80 81 // GetBlob provides a mock function with given fields: ctx, c 82 func (_m *BlobService) GetBlob(ctx context.Context, c cid.Cid) (blocks.Block, error) { 83 ret := _m.Called(ctx, c) 84 85 var r0 blocks.Block 86 if rf, ok := ret.Get(0).(func(context.Context, cid.Cid) blocks.Block); ok { 87 r0 = rf(ctx, c) 88 } else { 89 if ret.Get(0) != nil { 90 r0 = ret.Get(0).(blocks.Block) 91 } 92 } 93 94 var r1 error 95 if rf, ok := ret.Get(1).(func(context.Context, cid.Cid) error); ok { 96 r1 = rf(ctx, c) 97 } else { 98 r1 = ret.Error(1) 99 } 100 101 return r0, r1 102 } 103 104 // GetBlobs provides a mock function with given fields: ctx, ks 105 func (_m *BlobService) GetBlobs(ctx context.Context, ks []cid.Cid) <-chan blocks.Block { 106 ret := _m.Called(ctx, ks) 107 108 var r0 <-chan blocks.Block 109 if rf, ok := ret.Get(0).(func(context.Context, []cid.Cid) <-chan blocks.Block); ok { 110 r0 = rf(ctx, ks) 111 } else { 112 if ret.Get(0) != nil { 113 r0 = ret.Get(0).(<-chan blocks.Block) 114 } 115 } 116 117 return r0 118 } 119 120 // GetSession provides a mock function with given fields: ctx 121 func (_m *BlobService) GetSession(ctx context.Context) network.BlobGetter { 122 ret := _m.Called(ctx) 123 124 var r0 network.BlobGetter 125 if rf, ok := ret.Get(0).(func(context.Context) network.BlobGetter); ok { 126 r0 = rf(ctx) 127 } else { 128 if ret.Get(0) != nil { 129 r0 = ret.Get(0).(network.BlobGetter) 130 } 131 } 132 133 return r0 134 } 135 136 // Ready provides a mock function with given fields: 137 func (_m *BlobService) Ready() <-chan struct{} { 138 ret := _m.Called() 139 140 var r0 <-chan struct{} 141 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 142 r0 = rf() 143 } else { 144 if ret.Get(0) != nil { 145 r0 = ret.Get(0).(<-chan struct{}) 146 } 147 } 148 149 return r0 150 } 151 152 // Start provides a mock function with given fields: _a0 153 func (_m *BlobService) Start(_a0 irrecoverable.SignalerContext) { 154 _m.Called(_a0) 155 } 156 157 // TriggerReprovide provides a mock function with given fields: ctx 158 func (_m *BlobService) TriggerReprovide(ctx context.Context) error { 159 ret := _m.Called(ctx) 160 161 var r0 error 162 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 163 r0 = rf(ctx) 164 } else { 165 r0 = ret.Error(0) 166 } 167 168 return r0 169 } 170 171 type mockConstructorTestingTNewBlobService interface { 172 mock.TestingT 173 Cleanup(func()) 174 } 175 176 // NewBlobService creates a new instance of BlobService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 177 func NewBlobService(t mockConstructorTestingTNewBlobService) *BlobService { 178 mock := &BlobService{} 179 mock.Mock.Test(t) 180 181 t.Cleanup(func() { mock.AssertExpectations(t) }) 182 183 return mock 184 }