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