github.com/onflow/flow-go@v0.33.17/access/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 entities "github.com/onflow/flow/protobuf/go/flow/entities" 11 12 flow "github.com/onflow/flow-go/model/flow" 13 14 mock "github.com/stretchr/testify/mock" 15 ) 16 17 // API is an autogenerated mock type for the API type 18 type API struct { 19 mock.Mock 20 } 21 22 // ExecuteScriptAtBlockHeight provides a mock function with given fields: ctx, blockHeight, script, arguments 23 func (_m *API) ExecuteScriptAtBlockHeight(ctx context.Context, blockHeight uint64, script []byte, arguments [][]byte) ([]byte, error) { 24 ret := _m.Called(ctx, blockHeight, script, arguments) 25 26 var r0 []byte 27 var r1 error 28 if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, [][]byte) ([]byte, error)); ok { 29 return rf(ctx, blockHeight, script, arguments) 30 } 31 if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, [][]byte) []byte); ok { 32 r0 = rf(ctx, blockHeight, script, arguments) 33 } else { 34 if ret.Get(0) != nil { 35 r0 = ret.Get(0).([]byte) 36 } 37 } 38 39 if rf, ok := ret.Get(1).(func(context.Context, uint64, []byte, [][]byte) error); ok { 40 r1 = rf(ctx, blockHeight, script, arguments) 41 } else { 42 r1 = ret.Error(1) 43 } 44 45 return r0, r1 46 } 47 48 // ExecuteScriptAtBlockID provides a mock function with given fields: ctx, blockID, script, arguments 49 func (_m *API) ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, arguments [][]byte) ([]byte, error) { 50 ret := _m.Called(ctx, blockID, script, arguments) 51 52 var r0 []byte 53 var r1 error 54 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, []byte, [][]byte) ([]byte, error)); ok { 55 return rf(ctx, blockID, script, arguments) 56 } 57 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, []byte, [][]byte) []byte); ok { 58 r0 = rf(ctx, blockID, script, arguments) 59 } else { 60 if ret.Get(0) != nil { 61 r0 = ret.Get(0).([]byte) 62 } 63 } 64 65 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, []byte, [][]byte) error); ok { 66 r1 = rf(ctx, blockID, script, arguments) 67 } else { 68 r1 = ret.Error(1) 69 } 70 71 return r0, r1 72 } 73 74 // ExecuteScriptAtLatestBlock provides a mock function with given fields: ctx, script, arguments 75 func (_m *API) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte, arguments [][]byte) ([]byte, error) { 76 ret := _m.Called(ctx, script, arguments) 77 78 var r0 []byte 79 var r1 error 80 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte) ([]byte, error)); ok { 81 return rf(ctx, script, arguments) 82 } 83 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte) []byte); ok { 84 r0 = rf(ctx, script, arguments) 85 } else { 86 if ret.Get(0) != nil { 87 r0 = ret.Get(0).([]byte) 88 } 89 } 90 91 if rf, ok := ret.Get(1).(func(context.Context, []byte, [][]byte) error); ok { 92 r1 = rf(ctx, script, arguments) 93 } else { 94 r1 = ret.Error(1) 95 } 96 97 return r0, r1 98 } 99 100 // GetAccount provides a mock function with given fields: ctx, address 101 func (_m *API) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error) { 102 ret := _m.Called(ctx, address) 103 104 var r0 *flow.Account 105 var r1 error 106 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) (*flow.Account, error)); ok { 107 return rf(ctx, address) 108 } 109 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) *flow.Account); ok { 110 r0 = rf(ctx, address) 111 } else { 112 if ret.Get(0) != nil { 113 r0 = ret.Get(0).(*flow.Account) 114 } 115 } 116 117 if rf, ok := ret.Get(1).(func(context.Context, flow.Address) error); ok { 118 r1 = rf(ctx, address) 119 } else { 120 r1 = ret.Error(1) 121 } 122 123 return r0, r1 124 } 125 126 // GetAccountAtBlockHeight provides a mock function with given fields: ctx, address, height 127 func (_m *API) GetAccountAtBlockHeight(ctx context.Context, address flow.Address, height uint64) (*flow.Account, error) { 128 ret := _m.Called(ctx, address, height) 129 130 var r0 *flow.Account 131 var r1 error 132 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, uint64) (*flow.Account, error)); ok { 133 return rf(ctx, address, height) 134 } 135 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, uint64) *flow.Account); ok { 136 r0 = rf(ctx, address, height) 137 } else { 138 if ret.Get(0) != nil { 139 r0 = ret.Get(0).(*flow.Account) 140 } 141 } 142 143 if rf, ok := ret.Get(1).(func(context.Context, flow.Address, uint64) error); ok { 144 r1 = rf(ctx, address, height) 145 } else { 146 r1 = ret.Error(1) 147 } 148 149 return r0, r1 150 } 151 152 // GetAccountAtLatestBlock provides a mock function with given fields: ctx, address 153 func (_m *API) GetAccountAtLatestBlock(ctx context.Context, address flow.Address) (*flow.Account, error) { 154 ret := _m.Called(ctx, address) 155 156 var r0 *flow.Account 157 var r1 error 158 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) (*flow.Account, error)); ok { 159 return rf(ctx, address) 160 } 161 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) *flow.Account); ok { 162 r0 = rf(ctx, address) 163 } else { 164 if ret.Get(0) != nil { 165 r0 = ret.Get(0).(*flow.Account) 166 } 167 } 168 169 if rf, ok := ret.Get(1).(func(context.Context, flow.Address) error); ok { 170 r1 = rf(ctx, address) 171 } else { 172 r1 = ret.Error(1) 173 } 174 175 return r0, r1 176 } 177 178 // GetBlockByHeight provides a mock function with given fields: ctx, height 179 func (_m *API) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, flow.BlockStatus, error) { 180 ret := _m.Called(ctx, height) 181 182 var r0 *flow.Block 183 var r1 flow.BlockStatus 184 var r2 error 185 if rf, ok := ret.Get(0).(func(context.Context, uint64) (*flow.Block, flow.BlockStatus, error)); ok { 186 return rf(ctx, height) 187 } 188 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Block); ok { 189 r0 = rf(ctx, height) 190 } else { 191 if ret.Get(0) != nil { 192 r0 = ret.Get(0).(*flow.Block) 193 } 194 } 195 196 if rf, ok := ret.Get(1).(func(context.Context, uint64) flow.BlockStatus); ok { 197 r1 = rf(ctx, height) 198 } else { 199 r1 = ret.Get(1).(flow.BlockStatus) 200 } 201 202 if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { 203 r2 = rf(ctx, height) 204 } else { 205 r2 = ret.Error(2) 206 } 207 208 return r0, r1, r2 209 } 210 211 // GetBlockByID provides a mock function with given fields: ctx, id 212 func (_m *API) GetBlockByID(ctx context.Context, id flow.Identifier) (*flow.Block, flow.BlockStatus, error) { 213 ret := _m.Called(ctx, id) 214 215 var r0 *flow.Block 216 var r1 flow.BlockStatus 217 var r2 error 218 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.Block, flow.BlockStatus, error)); ok { 219 return rf(ctx, id) 220 } 221 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Block); ok { 222 r0 = rf(ctx, id) 223 } else { 224 if ret.Get(0) != nil { 225 r0 = ret.Get(0).(*flow.Block) 226 } 227 } 228 229 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) flow.BlockStatus); ok { 230 r1 = rf(ctx, id) 231 } else { 232 r1 = ret.Get(1).(flow.BlockStatus) 233 } 234 235 if rf, ok := ret.Get(2).(func(context.Context, flow.Identifier) error); ok { 236 r2 = rf(ctx, id) 237 } else { 238 r2 = ret.Error(2) 239 } 240 241 return r0, r1, r2 242 } 243 244 // GetBlockHeaderByHeight provides a mock function with given fields: ctx, height 245 func (_m *API) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.Header, flow.BlockStatus, error) { 246 ret := _m.Called(ctx, height) 247 248 var r0 *flow.Header 249 var r1 flow.BlockStatus 250 var r2 error 251 if rf, ok := ret.Get(0).(func(context.Context, uint64) (*flow.Header, flow.BlockStatus, error)); ok { 252 return rf(ctx, height) 253 } 254 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Header); ok { 255 r0 = rf(ctx, height) 256 } else { 257 if ret.Get(0) != nil { 258 r0 = ret.Get(0).(*flow.Header) 259 } 260 } 261 262 if rf, ok := ret.Get(1).(func(context.Context, uint64) flow.BlockStatus); ok { 263 r1 = rf(ctx, height) 264 } else { 265 r1 = ret.Get(1).(flow.BlockStatus) 266 } 267 268 if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { 269 r2 = rf(ctx, height) 270 } else { 271 r2 = ret.Error(2) 272 } 273 274 return r0, r1, r2 275 } 276 277 // GetBlockHeaderByID provides a mock function with given fields: ctx, id 278 func (_m *API) GetBlockHeaderByID(ctx context.Context, id flow.Identifier) (*flow.Header, flow.BlockStatus, error) { 279 ret := _m.Called(ctx, id) 280 281 var r0 *flow.Header 282 var r1 flow.BlockStatus 283 var r2 error 284 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.Header, flow.BlockStatus, error)); ok { 285 return rf(ctx, id) 286 } 287 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Header); ok { 288 r0 = rf(ctx, id) 289 } else { 290 if ret.Get(0) != nil { 291 r0 = ret.Get(0).(*flow.Header) 292 } 293 } 294 295 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) flow.BlockStatus); ok { 296 r1 = rf(ctx, id) 297 } else { 298 r1 = ret.Get(1).(flow.BlockStatus) 299 } 300 301 if rf, ok := ret.Get(2).(func(context.Context, flow.Identifier) error); ok { 302 r2 = rf(ctx, id) 303 } else { 304 r2 = ret.Error(2) 305 } 306 307 return r0, r1, r2 308 } 309 310 // GetCollectionByID provides a mock function with given fields: ctx, id 311 func (_m *API) GetCollectionByID(ctx context.Context, id flow.Identifier) (*flow.LightCollection, error) { 312 ret := _m.Called(ctx, id) 313 314 var r0 *flow.LightCollection 315 var r1 error 316 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.LightCollection, error)); ok { 317 return rf(ctx, id) 318 } 319 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.LightCollection); ok { 320 r0 = rf(ctx, id) 321 } else { 322 if ret.Get(0) != nil { 323 r0 = ret.Get(0).(*flow.LightCollection) 324 } 325 } 326 327 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 328 r1 = rf(ctx, id) 329 } else { 330 r1 = ret.Error(1) 331 } 332 333 return r0, r1 334 } 335 336 // GetEventsForBlockIDs provides a mock function with given fields: ctx, eventType, blockIDs, requiredEventEncodingVersion 337 func (_m *API) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) ([]flow.BlockEvents, error) { 338 ret := _m.Called(ctx, eventType, blockIDs, requiredEventEncodingVersion) 339 340 var r0 []flow.BlockEvents 341 var r1 error 342 if rf, ok := ret.Get(0).(func(context.Context, string, []flow.Identifier, entities.EventEncodingVersion) ([]flow.BlockEvents, error)); ok { 343 return rf(ctx, eventType, blockIDs, requiredEventEncodingVersion) 344 } 345 if rf, ok := ret.Get(0).(func(context.Context, string, []flow.Identifier, entities.EventEncodingVersion) []flow.BlockEvents); ok { 346 r0 = rf(ctx, eventType, blockIDs, requiredEventEncodingVersion) 347 } else { 348 if ret.Get(0) != nil { 349 r0 = ret.Get(0).([]flow.BlockEvents) 350 } 351 } 352 353 if rf, ok := ret.Get(1).(func(context.Context, string, []flow.Identifier, entities.EventEncodingVersion) error); ok { 354 r1 = rf(ctx, eventType, blockIDs, requiredEventEncodingVersion) 355 } else { 356 r1 = ret.Error(1) 357 } 358 359 return r0, r1 360 } 361 362 // GetEventsForHeightRange provides a mock function with given fields: ctx, eventType, startHeight, endHeight, requiredEventEncodingVersion 363 func (_m *API) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight uint64, endHeight uint64, requiredEventEncodingVersion entities.EventEncodingVersion) ([]flow.BlockEvents, error) { 364 ret := _m.Called(ctx, eventType, startHeight, endHeight, requiredEventEncodingVersion) 365 366 var r0 []flow.BlockEvents 367 var r1 error 368 if rf, ok := ret.Get(0).(func(context.Context, string, uint64, uint64, entities.EventEncodingVersion) ([]flow.BlockEvents, error)); ok { 369 return rf(ctx, eventType, startHeight, endHeight, requiredEventEncodingVersion) 370 } 371 if rf, ok := ret.Get(0).(func(context.Context, string, uint64, uint64, entities.EventEncodingVersion) []flow.BlockEvents); ok { 372 r0 = rf(ctx, eventType, startHeight, endHeight, requiredEventEncodingVersion) 373 } else { 374 if ret.Get(0) != nil { 375 r0 = ret.Get(0).([]flow.BlockEvents) 376 } 377 } 378 379 if rf, ok := ret.Get(1).(func(context.Context, string, uint64, uint64, entities.EventEncodingVersion) error); ok { 380 r1 = rf(ctx, eventType, startHeight, endHeight, requiredEventEncodingVersion) 381 } else { 382 r1 = ret.Error(1) 383 } 384 385 return r0, r1 386 } 387 388 // GetExecutionResultByID provides a mock function with given fields: ctx, id 389 func (_m *API) GetExecutionResultByID(ctx context.Context, id flow.Identifier) (*flow.ExecutionResult, error) { 390 ret := _m.Called(ctx, id) 391 392 var r0 *flow.ExecutionResult 393 var r1 error 394 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.ExecutionResult, error)); ok { 395 return rf(ctx, id) 396 } 397 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.ExecutionResult); ok { 398 r0 = rf(ctx, id) 399 } else { 400 if ret.Get(0) != nil { 401 r0 = ret.Get(0).(*flow.ExecutionResult) 402 } 403 } 404 405 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 406 r1 = rf(ctx, id) 407 } else { 408 r1 = ret.Error(1) 409 } 410 411 return r0, r1 412 } 413 414 // GetExecutionResultForBlockID provides a mock function with given fields: ctx, blockID 415 func (_m *API) GetExecutionResultForBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionResult, error) { 416 ret := _m.Called(ctx, blockID) 417 418 var r0 *flow.ExecutionResult 419 var r1 error 420 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.ExecutionResult, error)); ok { 421 return rf(ctx, blockID) 422 } 423 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.ExecutionResult); ok { 424 r0 = rf(ctx, blockID) 425 } else { 426 if ret.Get(0) != nil { 427 r0 = ret.Get(0).(*flow.ExecutionResult) 428 } 429 } 430 431 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 432 r1 = rf(ctx, blockID) 433 } else { 434 r1 = ret.Error(1) 435 } 436 437 return r0, r1 438 } 439 440 // GetLatestBlock provides a mock function with given fields: ctx, isSealed 441 func (_m *API) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, flow.BlockStatus, error) { 442 ret := _m.Called(ctx, isSealed) 443 444 var r0 *flow.Block 445 var r1 flow.BlockStatus 446 var r2 error 447 if rf, ok := ret.Get(0).(func(context.Context, bool) (*flow.Block, flow.BlockStatus, error)); ok { 448 return rf(ctx, isSealed) 449 } 450 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Block); ok { 451 r0 = rf(ctx, isSealed) 452 } else { 453 if ret.Get(0) != nil { 454 r0 = ret.Get(0).(*flow.Block) 455 } 456 } 457 458 if rf, ok := ret.Get(1).(func(context.Context, bool) flow.BlockStatus); ok { 459 r1 = rf(ctx, isSealed) 460 } else { 461 r1 = ret.Get(1).(flow.BlockStatus) 462 } 463 464 if rf, ok := ret.Get(2).(func(context.Context, bool) error); ok { 465 r2 = rf(ctx, isSealed) 466 } else { 467 r2 = ret.Error(2) 468 } 469 470 return r0, r1, r2 471 } 472 473 // GetLatestBlockHeader provides a mock function with given fields: ctx, isSealed 474 func (_m *API) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.Header, flow.BlockStatus, error) { 475 ret := _m.Called(ctx, isSealed) 476 477 var r0 *flow.Header 478 var r1 flow.BlockStatus 479 var r2 error 480 if rf, ok := ret.Get(0).(func(context.Context, bool) (*flow.Header, flow.BlockStatus, error)); ok { 481 return rf(ctx, isSealed) 482 } 483 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Header); ok { 484 r0 = rf(ctx, isSealed) 485 } else { 486 if ret.Get(0) != nil { 487 r0 = ret.Get(0).(*flow.Header) 488 } 489 } 490 491 if rf, ok := ret.Get(1).(func(context.Context, bool) flow.BlockStatus); ok { 492 r1 = rf(ctx, isSealed) 493 } else { 494 r1 = ret.Get(1).(flow.BlockStatus) 495 } 496 497 if rf, ok := ret.Get(2).(func(context.Context, bool) error); ok { 498 r2 = rf(ctx, isSealed) 499 } else { 500 r2 = ret.Error(2) 501 } 502 503 return r0, r1, r2 504 } 505 506 // GetLatestProtocolStateSnapshot provides a mock function with given fields: ctx 507 func (_m *API) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error) { 508 ret := _m.Called(ctx) 509 510 var r0 []byte 511 var r1 error 512 if rf, ok := ret.Get(0).(func(context.Context) ([]byte, error)); ok { 513 return rf(ctx) 514 } 515 if rf, ok := ret.Get(0).(func(context.Context) []byte); ok { 516 r0 = rf(ctx) 517 } else { 518 if ret.Get(0) != nil { 519 r0 = ret.Get(0).([]byte) 520 } 521 } 522 523 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 524 r1 = rf(ctx) 525 } else { 526 r1 = ret.Error(1) 527 } 528 529 return r0, r1 530 } 531 532 // GetNetworkParameters provides a mock function with given fields: ctx 533 func (_m *API) GetNetworkParameters(ctx context.Context) access.NetworkParameters { 534 ret := _m.Called(ctx) 535 536 var r0 access.NetworkParameters 537 if rf, ok := ret.Get(0).(func(context.Context) access.NetworkParameters); ok { 538 r0 = rf(ctx) 539 } else { 540 r0 = ret.Get(0).(access.NetworkParameters) 541 } 542 543 return r0 544 } 545 546 // GetNodeVersionInfo provides a mock function with given fields: ctx 547 func (_m *API) GetNodeVersionInfo(ctx context.Context) (*access.NodeVersionInfo, error) { 548 ret := _m.Called(ctx) 549 550 var r0 *access.NodeVersionInfo 551 var r1 error 552 if rf, ok := ret.Get(0).(func(context.Context) (*access.NodeVersionInfo, error)); ok { 553 return rf(ctx) 554 } 555 if rf, ok := ret.Get(0).(func(context.Context) *access.NodeVersionInfo); ok { 556 r0 = rf(ctx) 557 } else { 558 if ret.Get(0) != nil { 559 r0 = ret.Get(0).(*access.NodeVersionInfo) 560 } 561 } 562 563 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 564 r1 = rf(ctx) 565 } else { 566 r1 = ret.Error(1) 567 } 568 569 return r0, r1 570 } 571 572 // GetProtocolStateSnapshotByBlockID provides a mock function with given fields: ctx, blockID 573 func (_m *API) GetProtocolStateSnapshotByBlockID(ctx context.Context, blockID flow.Identifier) ([]byte, error) { 574 ret := _m.Called(ctx, blockID) 575 576 var r0 []byte 577 var r1 error 578 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) ([]byte, error)); ok { 579 return rf(ctx, blockID) 580 } 581 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) []byte); ok { 582 r0 = rf(ctx, blockID) 583 } else { 584 if ret.Get(0) != nil { 585 r0 = ret.Get(0).([]byte) 586 } 587 } 588 589 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 590 r1 = rf(ctx, blockID) 591 } else { 592 r1 = ret.Error(1) 593 } 594 595 return r0, r1 596 } 597 598 // GetProtocolStateSnapshotByHeight provides a mock function with given fields: ctx, blockHeight 599 func (_m *API) GetProtocolStateSnapshotByHeight(ctx context.Context, blockHeight uint64) ([]byte, error) { 600 ret := _m.Called(ctx, blockHeight) 601 602 var r0 []byte 603 var r1 error 604 if rf, ok := ret.Get(0).(func(context.Context, uint64) ([]byte, error)); ok { 605 return rf(ctx, blockHeight) 606 } 607 if rf, ok := ret.Get(0).(func(context.Context, uint64) []byte); ok { 608 r0 = rf(ctx, blockHeight) 609 } else { 610 if ret.Get(0) != nil { 611 r0 = ret.Get(0).([]byte) 612 } 613 } 614 615 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 616 r1 = rf(ctx, blockHeight) 617 } else { 618 r1 = ret.Error(1) 619 } 620 621 return r0, r1 622 } 623 624 // GetSystemTransaction provides a mock function with given fields: ctx, blockID 625 func (_m *API) GetSystemTransaction(ctx context.Context, blockID flow.Identifier) (*flow.TransactionBody, error) { 626 ret := _m.Called(ctx, blockID) 627 628 var r0 *flow.TransactionBody 629 var r1 error 630 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.TransactionBody, error)); ok { 631 return rf(ctx, blockID) 632 } 633 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.TransactionBody); ok { 634 r0 = rf(ctx, blockID) 635 } else { 636 if ret.Get(0) != nil { 637 r0 = ret.Get(0).(*flow.TransactionBody) 638 } 639 } 640 641 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 642 r1 = rf(ctx, blockID) 643 } else { 644 r1 = ret.Error(1) 645 } 646 647 return r0, r1 648 } 649 650 // GetSystemTransactionResult provides a mock function with given fields: ctx, blockID, requiredEventEncodingVersion 651 func (_m *API) GetSystemTransactionResult(ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) (*access.TransactionResult, error) { 652 ret := _m.Called(ctx, blockID, requiredEventEncodingVersion) 653 654 var r0 *access.TransactionResult 655 var r1 error 656 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) (*access.TransactionResult, error)); ok { 657 return rf(ctx, blockID, requiredEventEncodingVersion) 658 } 659 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) *access.TransactionResult); ok { 660 r0 = rf(ctx, blockID, requiredEventEncodingVersion) 661 } else { 662 if ret.Get(0) != nil { 663 r0 = ret.Get(0).(*access.TransactionResult) 664 } 665 } 666 667 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) error); ok { 668 r1 = rf(ctx, blockID, requiredEventEncodingVersion) 669 } else { 670 r1 = ret.Error(1) 671 } 672 673 return r0, r1 674 } 675 676 // GetTransaction provides a mock function with given fields: ctx, id 677 func (_m *API) GetTransaction(ctx context.Context, id flow.Identifier) (*flow.TransactionBody, error) { 678 ret := _m.Called(ctx, id) 679 680 var r0 *flow.TransactionBody 681 var r1 error 682 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (*flow.TransactionBody, error)); ok { 683 return rf(ctx, id) 684 } 685 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.TransactionBody); ok { 686 r0 = rf(ctx, id) 687 } else { 688 if ret.Get(0) != nil { 689 r0 = ret.Get(0).(*flow.TransactionBody) 690 } 691 } 692 693 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 694 r1 = rf(ctx, id) 695 } else { 696 r1 = ret.Error(1) 697 } 698 699 return r0, r1 700 } 701 702 // GetTransactionResult provides a mock function with given fields: ctx, id, blockID, collectionID, requiredEventEncodingVersion 703 func (_m *API) GetTransactionResult(ctx context.Context, id flow.Identifier, blockID flow.Identifier, collectionID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) (*access.TransactionResult, error) { 704 ret := _m.Called(ctx, id, blockID, collectionID, requiredEventEncodingVersion) 705 706 var r0 *access.TransactionResult 707 var r1 error 708 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, flow.Identifier, flow.Identifier, entities.EventEncodingVersion) (*access.TransactionResult, error)); ok { 709 return rf(ctx, id, blockID, collectionID, requiredEventEncodingVersion) 710 } 711 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, flow.Identifier, flow.Identifier, entities.EventEncodingVersion) *access.TransactionResult); ok { 712 r0 = rf(ctx, id, blockID, collectionID, requiredEventEncodingVersion) 713 } else { 714 if ret.Get(0) != nil { 715 r0 = ret.Get(0).(*access.TransactionResult) 716 } 717 } 718 719 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, flow.Identifier, flow.Identifier, entities.EventEncodingVersion) error); ok { 720 r1 = rf(ctx, id, blockID, collectionID, requiredEventEncodingVersion) 721 } else { 722 r1 = ret.Error(1) 723 } 724 725 return r0, r1 726 } 727 728 // GetTransactionResultByIndex provides a mock function with given fields: ctx, blockID, index, requiredEventEncodingVersion 729 func (_m *API) GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32, requiredEventEncodingVersion entities.EventEncodingVersion) (*access.TransactionResult, error) { 730 ret := _m.Called(ctx, blockID, index, requiredEventEncodingVersion) 731 732 var r0 *access.TransactionResult 733 var r1 error 734 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, uint32, entities.EventEncodingVersion) (*access.TransactionResult, error)); ok { 735 return rf(ctx, blockID, index, requiredEventEncodingVersion) 736 } 737 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, uint32, entities.EventEncodingVersion) *access.TransactionResult); ok { 738 r0 = rf(ctx, blockID, index, requiredEventEncodingVersion) 739 } else { 740 if ret.Get(0) != nil { 741 r0 = ret.Get(0).(*access.TransactionResult) 742 } 743 } 744 745 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, uint32, entities.EventEncodingVersion) error); ok { 746 r1 = rf(ctx, blockID, index, requiredEventEncodingVersion) 747 } else { 748 r1 = ret.Error(1) 749 } 750 751 return r0, r1 752 } 753 754 // GetTransactionResultsByBlockID provides a mock function with given fields: ctx, blockID, requiredEventEncodingVersion 755 func (_m *API) GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) ([]*access.TransactionResult, error) { 756 ret := _m.Called(ctx, blockID, requiredEventEncodingVersion) 757 758 var r0 []*access.TransactionResult 759 var r1 error 760 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) ([]*access.TransactionResult, error)); ok { 761 return rf(ctx, blockID, requiredEventEncodingVersion) 762 } 763 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) []*access.TransactionResult); ok { 764 r0 = rf(ctx, blockID, requiredEventEncodingVersion) 765 } else { 766 if ret.Get(0) != nil { 767 r0 = ret.Get(0).([]*access.TransactionResult) 768 } 769 } 770 771 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, entities.EventEncodingVersion) error); ok { 772 r1 = rf(ctx, blockID, requiredEventEncodingVersion) 773 } else { 774 r1 = ret.Error(1) 775 } 776 777 return r0, r1 778 } 779 780 // GetTransactionsByBlockID provides a mock function with given fields: ctx, blockID 781 func (_m *API) GetTransactionsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionBody, error) { 782 ret := _m.Called(ctx, blockID) 783 784 var r0 []*flow.TransactionBody 785 var r1 error 786 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) ([]*flow.TransactionBody, error)); ok { 787 return rf(ctx, blockID) 788 } 789 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) []*flow.TransactionBody); ok { 790 r0 = rf(ctx, blockID) 791 } else { 792 if ret.Get(0) != nil { 793 r0 = ret.Get(0).([]*flow.TransactionBody) 794 } 795 } 796 797 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 798 r1 = rf(ctx, blockID) 799 } else { 800 r1 = ret.Error(1) 801 } 802 803 return r0, r1 804 } 805 806 // Ping provides a mock function with given fields: ctx 807 func (_m *API) Ping(ctx context.Context) error { 808 ret := _m.Called(ctx) 809 810 var r0 error 811 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 812 r0 = rf(ctx) 813 } else { 814 r0 = ret.Error(0) 815 } 816 817 return r0 818 } 819 820 // SendTransaction provides a mock function with given fields: ctx, tx 821 func (_m *API) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error { 822 ret := _m.Called(ctx, tx) 823 824 var r0 error 825 if rf, ok := ret.Get(0).(func(context.Context, *flow.TransactionBody) error); ok { 826 r0 = rf(ctx, tx) 827 } else { 828 r0 = ret.Error(0) 829 } 830 831 return r0 832 } 833 834 type mockConstructorTestingTNewAPI interface { 835 mock.TestingT 836 Cleanup(func()) 837 } 838 839 // 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. 840 func NewAPI(t mockConstructorTestingTNewAPI) *API { 841 mock := &API{} 842 mock.Mock.Test(t) 843 844 t.Cleanup(func() { mock.AssertExpectations(t) }) 845 846 return mock 847 }