github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/blob_service.go (about)

     1  // Code generated by mockery v2.21.4. 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/onflow/flow-go/module/irrecoverable"
    12  
    13  	mock "github.com/stretchr/testify/mock"
    14  
    15  	network "github.com/onflow/flow-go/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  	var r1 error
    87  	if rf, ok := ret.Get(0).(func(context.Context, cid.Cid) (blocks.Block, error)); ok {
    88  		return rf(ctx, c)
    89  	}
    90  	if rf, ok := ret.Get(0).(func(context.Context, cid.Cid) blocks.Block); ok {
    91  		r0 = rf(ctx, c)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(blocks.Block)
    95  		}
    96  	}
    97  
    98  	if rf, ok := ret.Get(1).(func(context.Context, cid.Cid) error); ok {
    99  		r1 = rf(ctx, c)
   100  	} else {
   101  		r1 = ret.Error(1)
   102  	}
   103  
   104  	return r0, r1
   105  }
   106  
   107  // GetBlobs provides a mock function with given fields: ctx, ks
   108  func (_m *BlobService) GetBlobs(ctx context.Context, ks []cid.Cid) <-chan blocks.Block {
   109  	ret := _m.Called(ctx, ks)
   110  
   111  	var r0 <-chan blocks.Block
   112  	if rf, ok := ret.Get(0).(func(context.Context, []cid.Cid) <-chan blocks.Block); ok {
   113  		r0 = rf(ctx, ks)
   114  	} else {
   115  		if ret.Get(0) != nil {
   116  			r0 = ret.Get(0).(<-chan blocks.Block)
   117  		}
   118  	}
   119  
   120  	return r0
   121  }
   122  
   123  // GetSession provides a mock function with given fields: ctx
   124  func (_m *BlobService) GetSession(ctx context.Context) network.BlobGetter {
   125  	ret := _m.Called(ctx)
   126  
   127  	var r0 network.BlobGetter
   128  	if rf, ok := ret.Get(0).(func(context.Context) network.BlobGetter); ok {
   129  		r0 = rf(ctx)
   130  	} else {
   131  		if ret.Get(0) != nil {
   132  			r0 = ret.Get(0).(network.BlobGetter)
   133  		}
   134  	}
   135  
   136  	return r0
   137  }
   138  
   139  // Ready provides a mock function with given fields:
   140  func (_m *BlobService) Ready() <-chan struct{} {
   141  	ret := _m.Called()
   142  
   143  	var r0 <-chan struct{}
   144  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
   145  		r0 = rf()
   146  	} else {
   147  		if ret.Get(0) != nil {
   148  			r0 = ret.Get(0).(<-chan struct{})
   149  		}
   150  	}
   151  
   152  	return r0
   153  }
   154  
   155  // Start provides a mock function with given fields: _a0
   156  func (_m *BlobService) Start(_a0 irrecoverable.SignalerContext) {
   157  	_m.Called(_a0)
   158  }
   159  
   160  // TriggerReprovide provides a mock function with given fields: ctx
   161  func (_m *BlobService) TriggerReprovide(ctx context.Context) error {
   162  	ret := _m.Called(ctx)
   163  
   164  	var r0 error
   165  	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
   166  		r0 = rf(ctx)
   167  	} else {
   168  		r0 = ret.Error(0)
   169  	}
   170  
   171  	return r0
   172  }
   173  
   174  type mockConstructorTestingTNewBlobService interface {
   175  	mock.TestingT
   176  	Cleanup(func())
   177  }
   178  
   179  // 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.
   180  func NewBlobService(t mockConstructorTestingTNewBlobService) *BlobService {
   181  	mock := &BlobService{}
   182  	mock.Mock.Test(t)
   183  
   184  	t.Cleanup(func() { mock.AssertExpectations(t) })
   185  
   186  	return mock
   187  }