github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/protocol/mock/api.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 context "context" 7 8 access "github.com/onflow/flow-go/access" 9 10 flow "github.com/onflow/flow-go/model/flow" 11 12 mock "github.com/stretchr/testify/mock" 13 ) 14 15 // API is an autogenerated mock type for the API type 16 type API struct { 17 mock.Mock 18 } 19 20 // GetBlockByHeight provides a mock function with given fields: ctx, height 21 func (_m *API) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error) { 22 ret := _m.Called(ctx, height) 23 24 var r0 *flow.Block 25 var r1 error 26 if rf, ok := ret.Get(0).(func(context.Context, uint64) (*flow.Block, error)); ok { 27 return rf(ctx, height) 28 } 29 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Block); ok { 30 r0 = rf(ctx, height) 31 } else { 32 if ret.Get(0) != nil { 33 r0 = ret.Get(0).(*flow.Block) 34 } 35 } 36 37 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 38 r1 = rf(ctx, height) 39 } else { 40 r1 = ret.Error(1) 41 } 42 43 return r0, r1 44 } 45 46 // GetBlockByID provides a mock function with given fields: ctx, id 47 func (_m *API) GetBlockByID(ctx context.Context, id flow.Identifier) (*flow.Block, error) { 48 ret := _m.Called(ctx, id) 49 50 var r0 *flow.Block 51 var r1 error 52 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.Block, error)); ok { 53 return rf(ctx, id) 54 } 55 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Block); ok { 56 r0 = rf(ctx, id) 57 } else { 58 if ret.Get(0) != nil { 59 r0 = ret.Get(0).(*flow.Block) 60 } 61 } 62 63 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 64 r1 = rf(ctx, id) 65 } else { 66 r1 = ret.Error(1) 67 } 68 69 return r0, r1 70 } 71 72 // GetBlockHeaderByHeight provides a mock function with given fields: ctx, height 73 func (_m *API) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.Header, error) { 74 ret := _m.Called(ctx, height) 75 76 var r0 *flow.Header 77 var r1 error 78 if rf, ok := ret.Get(0).(func(context.Context, uint64) (*flow.Header, error)); ok { 79 return rf(ctx, height) 80 } 81 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Header); ok { 82 r0 = rf(ctx, height) 83 } else { 84 if ret.Get(0) != nil { 85 r0 = ret.Get(0).(*flow.Header) 86 } 87 } 88 89 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 90 r1 = rf(ctx, height) 91 } else { 92 r1 = ret.Error(1) 93 } 94 95 return r0, r1 96 } 97 98 // GetBlockHeaderByID provides a mock function with given fields: ctx, id 99 func (_m *API) GetBlockHeaderByID(ctx context.Context, id flow.Identifier) (*flow.Header, error) { 100 ret := _m.Called(ctx, id) 101 102 var r0 *flow.Header 103 var r1 error 104 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.Header, error)); ok { 105 return rf(ctx, id) 106 } 107 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Header); ok { 108 r0 = rf(ctx, id) 109 } else { 110 if ret.Get(0) != nil { 111 r0 = ret.Get(0).(*flow.Header) 112 } 113 } 114 115 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 116 r1 = rf(ctx, id) 117 } else { 118 r1 = ret.Error(1) 119 } 120 121 return r0, r1 122 } 123 124 // GetLatestBlock provides a mock function with given fields: ctx, isSealed 125 func (_m *API) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, error) { 126 ret := _m.Called(ctx, isSealed) 127 128 var r0 *flow.Block 129 var r1 error 130 if rf, ok := ret.Get(0).(func(context.Context, bool) (*flow.Block, error)); ok { 131 return rf(ctx, isSealed) 132 } 133 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Block); ok { 134 r0 = rf(ctx, isSealed) 135 } else { 136 if ret.Get(0) != nil { 137 r0 = ret.Get(0).(*flow.Block) 138 } 139 } 140 141 if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { 142 r1 = rf(ctx, isSealed) 143 } else { 144 r1 = ret.Error(1) 145 } 146 147 return r0, r1 148 } 149 150 // GetLatestBlockHeader provides a mock function with given fields: ctx, isSealed 151 func (_m *API) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.Header, error) { 152 ret := _m.Called(ctx, isSealed) 153 154 var r0 *flow.Header 155 var r1 error 156 if rf, ok := ret.Get(0).(func(context.Context, bool) (*flow.Header, error)); ok { 157 return rf(ctx, isSealed) 158 } 159 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Header); ok { 160 r0 = rf(ctx, isSealed) 161 } else { 162 if ret.Get(0) != nil { 163 r0 = ret.Get(0).(*flow.Header) 164 } 165 } 166 167 if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { 168 r1 = rf(ctx, isSealed) 169 } else { 170 r1 = ret.Error(1) 171 } 172 173 return r0, r1 174 } 175 176 // GetLatestProtocolStateSnapshot provides a mock function with given fields: ctx 177 func (_m *API) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error) { 178 ret := _m.Called(ctx) 179 180 var r0 []byte 181 var r1 error 182 if rf, ok := ret.Get(0).(func(context.Context) ([]byte, error)); ok { 183 return rf(ctx) 184 } 185 if rf, ok := ret.Get(0).(func(context.Context) []byte); ok { 186 r0 = rf(ctx) 187 } else { 188 if ret.Get(0) != nil { 189 r0 = ret.Get(0).([]byte) 190 } 191 } 192 193 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 194 r1 = rf(ctx) 195 } else { 196 r1 = ret.Error(1) 197 } 198 199 return r0, r1 200 } 201 202 // GetNetworkParameters provides a mock function with given fields: ctx 203 func (_m *API) GetNetworkParameters(ctx context.Context) access.NetworkParameters { 204 ret := _m.Called(ctx) 205 206 var r0 access.NetworkParameters 207 if rf, ok := ret.Get(0).(func(context.Context) access.NetworkParameters); ok { 208 r0 = rf(ctx) 209 } else { 210 r0 = ret.Get(0).(access.NetworkParameters) 211 } 212 213 return r0 214 } 215 216 // GetNodeVersionInfo provides a mock function with given fields: ctx 217 func (_m *API) GetNodeVersionInfo(ctx context.Context) (*access.NodeVersionInfo, error) { 218 ret := _m.Called(ctx) 219 220 var r0 *access.NodeVersionInfo 221 var r1 error 222 if rf, ok := ret.Get(0).(func(context.Context) (*access.NodeVersionInfo, error)); ok { 223 return rf(ctx) 224 } 225 if rf, ok := ret.Get(0).(func(context.Context) *access.NodeVersionInfo); ok { 226 r0 = rf(ctx) 227 } else { 228 if ret.Get(0) != nil { 229 r0 = ret.Get(0).(*access.NodeVersionInfo) 230 } 231 } 232 233 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 234 r1 = rf(ctx) 235 } else { 236 r1 = ret.Error(1) 237 } 238 239 return r0, r1 240 } 241 242 // GetProtocolStateSnapshotByBlockID provides a mock function with given fields: ctx, blockID 243 func (_m *API) GetProtocolStateSnapshotByBlockID(ctx context.Context, blockID flow.Identifier) ([]byte, error) { 244 ret := _m.Called(ctx, blockID) 245 246 var r0 []byte 247 var r1 error 248 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) ([]byte, error)); ok { 249 return rf(ctx, blockID) 250 } 251 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) []byte); ok { 252 r0 = rf(ctx, blockID) 253 } else { 254 if ret.Get(0) != nil { 255 r0 = ret.Get(0).([]byte) 256 } 257 } 258 259 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 260 r1 = rf(ctx, blockID) 261 } else { 262 r1 = ret.Error(1) 263 } 264 265 return r0, r1 266 } 267 268 // GetProtocolStateSnapshotByHeight provides a mock function with given fields: ctx, blockHeight 269 func (_m *API) GetProtocolStateSnapshotByHeight(ctx context.Context, blockHeight uint64) ([]byte, error) { 270 ret := _m.Called(ctx, blockHeight) 271 272 var r0 []byte 273 var r1 error 274 if rf, ok := ret.Get(0).(func(context.Context, uint64) ([]byte, error)); ok { 275 return rf(ctx, blockHeight) 276 } 277 if rf, ok := ret.Get(0).(func(context.Context, uint64) []byte); ok { 278 r0 = rf(ctx, blockHeight) 279 } else { 280 if ret.Get(0) != nil { 281 r0 = ret.Get(0).([]byte) 282 } 283 } 284 285 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 286 r1 = rf(ctx, blockHeight) 287 } else { 288 r1 = ret.Error(1) 289 } 290 291 return r0, r1 292 } 293 294 type mockConstructorTestingTNewAPI interface { 295 mock.TestingT 296 Cleanup(func()) 297 } 298 299 // NewAPI creates a new instance of API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 300 func NewAPI(t mockConstructorTestingTNewAPI) *API { 301 mock := &API{} 302 mock.Mock.Test(t) 303 304 t.Cleanup(func() { mock.AssertExpectations(t) }) 305 306 return mock 307 }