github.com/koko1123/flow-go-1@v0.29.6/storage/mock/headers.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	flow "github.com/koko1123/flow-go-1/model/flow"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	storage "github.com/koko1123/flow-go-1/storage"
    10  )
    11  
    12  // Headers is an autogenerated mock type for the Headers type
    13  type Headers struct {
    14  	mock.Mock
    15  }
    16  
    17  // BatchIndexByChunkID provides a mock function with given fields: headerID, chunkID, batch
    18  func (_m *Headers) BatchIndexByChunkID(headerID flow.Identifier, chunkID flow.Identifier, batch storage.BatchStorage) error {
    19  	ret := _m.Called(headerID, chunkID, batch)
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier, storage.BatchStorage) error); ok {
    23  		r0 = rf(headerID, chunkID, batch)
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // BatchRemoveChunkBlockIndexByChunkID provides a mock function with given fields: chunkID, batch
    32  func (_m *Headers) BatchRemoveChunkBlockIndexByChunkID(chunkID flow.Identifier, batch storage.BatchStorage) error {
    33  	ret := _m.Called(chunkID, batch)
    34  
    35  	var r0 error
    36  	if rf, ok := ret.Get(0).(func(flow.Identifier, storage.BatchStorage) error); ok {
    37  		r0 = rf(chunkID, batch)
    38  	} else {
    39  		r0 = ret.Error(0)
    40  	}
    41  
    42  	return r0
    43  }
    44  
    45  // ByBlockID provides a mock function with given fields: blockID
    46  func (_m *Headers) ByBlockID(blockID flow.Identifier) (*flow.Header, error) {
    47  	ret := _m.Called(blockID)
    48  
    49  	var r0 *flow.Header
    50  	if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Header); ok {
    51  		r0 = rf(blockID)
    52  	} else {
    53  		if ret.Get(0) != nil {
    54  			r0 = ret.Get(0).(*flow.Header)
    55  		}
    56  	}
    57  
    58  	var r1 error
    59  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    60  		r1 = rf(blockID)
    61  	} else {
    62  		r1 = ret.Error(1)
    63  	}
    64  
    65  	return r0, r1
    66  }
    67  
    68  // ByHeight provides a mock function with given fields: height
    69  func (_m *Headers) ByHeight(height uint64) (*flow.Header, error) {
    70  	ret := _m.Called(height)
    71  
    72  	var r0 *flow.Header
    73  	if rf, ok := ret.Get(0).(func(uint64) *flow.Header); ok {
    74  		r0 = rf(height)
    75  	} else {
    76  		if ret.Get(0) != nil {
    77  			r0 = ret.Get(0).(*flow.Header)
    78  		}
    79  	}
    80  
    81  	var r1 error
    82  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
    83  		r1 = rf(height)
    84  	} else {
    85  		r1 = ret.Error(1)
    86  	}
    87  
    88  	return r0, r1
    89  }
    90  
    91  // ByParentID provides a mock function with given fields: parentID
    92  func (_m *Headers) ByParentID(parentID flow.Identifier) ([]*flow.Header, error) {
    93  	ret := _m.Called(parentID)
    94  
    95  	var r0 []*flow.Header
    96  	if rf, ok := ret.Get(0).(func(flow.Identifier) []*flow.Header); ok {
    97  		r0 = rf(parentID)
    98  	} else {
    99  		if ret.Get(0) != nil {
   100  			r0 = ret.Get(0).([]*flow.Header)
   101  		}
   102  	}
   103  
   104  	var r1 error
   105  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
   106  		r1 = rf(parentID)
   107  	} else {
   108  		r1 = ret.Error(1)
   109  	}
   110  
   111  	return r0, r1
   112  }
   113  
   114  // IDByChunkID provides a mock function with given fields: chunkID
   115  func (_m *Headers) IDByChunkID(chunkID flow.Identifier) (flow.Identifier, error) {
   116  	ret := _m.Called(chunkID)
   117  
   118  	var r0 flow.Identifier
   119  	if rf, ok := ret.Get(0).(func(flow.Identifier) flow.Identifier); ok {
   120  		r0 = rf(chunkID)
   121  	} else {
   122  		if ret.Get(0) != nil {
   123  			r0 = ret.Get(0).(flow.Identifier)
   124  		}
   125  	}
   126  
   127  	var r1 error
   128  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
   129  		r1 = rf(chunkID)
   130  	} else {
   131  		r1 = ret.Error(1)
   132  	}
   133  
   134  	return r0, r1
   135  }
   136  
   137  // IndexByChunkID provides a mock function with given fields: headerID, chunkID
   138  func (_m *Headers) IndexByChunkID(headerID flow.Identifier, chunkID flow.Identifier) error {
   139  	ret := _m.Called(headerID, chunkID)
   140  
   141  	var r0 error
   142  	if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier) error); ok {
   143  		r0 = rf(headerID, chunkID)
   144  	} else {
   145  		r0 = ret.Error(0)
   146  	}
   147  
   148  	return r0
   149  }
   150  
   151  // Store provides a mock function with given fields: header
   152  func (_m *Headers) Store(header *flow.Header) error {
   153  	ret := _m.Called(header)
   154  
   155  	var r0 error
   156  	if rf, ok := ret.Get(0).(func(*flow.Header) error); ok {
   157  		r0 = rf(header)
   158  	} else {
   159  		r0 = ret.Error(0)
   160  	}
   161  
   162  	return r0
   163  }
   164  
   165  type mockConstructorTestingTNewHeaders interface {
   166  	mock.TestingT
   167  	Cleanup(func())
   168  }
   169  
   170  // NewHeaders creates a new instance of Headers. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   171  func NewHeaders(t mockConstructorTestingTNewHeaders) *Headers {
   172  	mock := &Headers{}
   173  	mock.Mock.Test(t)
   174  
   175  	t.Cleanup(func() { mock.AssertExpectations(t) })
   176  
   177  	return mock
   178  }