github.com/koko1123/flow-go-1@v0.29.6/access/mock/api.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 context "context" 7 8 access "github.com/koko1123/flow-go-1/access" 9 10 flow "github.com/koko1123/flow-go-1/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 // ExecuteScriptAtBlockHeight provides a mock function with given fields: ctx, blockHeight, script, arguments 21 func (_m *API) ExecuteScriptAtBlockHeight(ctx context.Context, blockHeight uint64, script []byte, arguments [][]byte) ([]byte, error) { 22 ret := _m.Called(ctx, blockHeight, script, arguments) 23 24 var r0 []byte 25 if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, [][]byte) []byte); ok { 26 r0 = rf(ctx, blockHeight, script, arguments) 27 } else { 28 if ret.Get(0) != nil { 29 r0 = ret.Get(0).([]byte) 30 } 31 } 32 33 var r1 error 34 if rf, ok := ret.Get(1).(func(context.Context, uint64, []byte, [][]byte) error); ok { 35 r1 = rf(ctx, blockHeight, script, arguments) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 // ExecuteScriptAtBlockID provides a mock function with given fields: ctx, blockID, script, arguments 44 func (_m *API) ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, arguments [][]byte) ([]byte, error) { 45 ret := _m.Called(ctx, blockID, script, arguments) 46 47 var r0 []byte 48 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, []byte, [][]byte) []byte); ok { 49 r0 = rf(ctx, blockID, script, arguments) 50 } else { 51 if ret.Get(0) != nil { 52 r0 = ret.Get(0).([]byte) 53 } 54 } 55 56 var r1 error 57 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, []byte, [][]byte) error); ok { 58 r1 = rf(ctx, blockID, script, arguments) 59 } else { 60 r1 = ret.Error(1) 61 } 62 63 return r0, r1 64 } 65 66 // ExecuteScriptAtLatestBlock provides a mock function with given fields: ctx, script, arguments 67 func (_m *API) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte, arguments [][]byte) ([]byte, error) { 68 ret := _m.Called(ctx, script, arguments) 69 70 var r0 []byte 71 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte) []byte); ok { 72 r0 = rf(ctx, script, arguments) 73 } else { 74 if ret.Get(0) != nil { 75 r0 = ret.Get(0).([]byte) 76 } 77 } 78 79 var r1 error 80 if rf, ok := ret.Get(1).(func(context.Context, []byte, [][]byte) error); ok { 81 r1 = rf(ctx, script, arguments) 82 } else { 83 r1 = ret.Error(1) 84 } 85 86 return r0, r1 87 } 88 89 // GetAccount provides a mock function with given fields: ctx, address 90 func (_m *API) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error) { 91 ret := _m.Called(ctx, address) 92 93 var r0 *flow.Account 94 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) *flow.Account); ok { 95 r0 = rf(ctx, address) 96 } else { 97 if ret.Get(0) != nil { 98 r0 = ret.Get(0).(*flow.Account) 99 } 100 } 101 102 var r1 error 103 if rf, ok := ret.Get(1).(func(context.Context, flow.Address) error); ok { 104 r1 = rf(ctx, address) 105 } else { 106 r1 = ret.Error(1) 107 } 108 109 return r0, r1 110 } 111 112 // GetAccountAtBlockHeight provides a mock function with given fields: ctx, address, height 113 func (_m *API) GetAccountAtBlockHeight(ctx context.Context, address flow.Address, height uint64) (*flow.Account, error) { 114 ret := _m.Called(ctx, address, height) 115 116 var r0 *flow.Account 117 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, uint64) *flow.Account); ok { 118 r0 = rf(ctx, address, height) 119 } else { 120 if ret.Get(0) != nil { 121 r0 = ret.Get(0).(*flow.Account) 122 } 123 } 124 125 var r1 error 126 if rf, ok := ret.Get(1).(func(context.Context, flow.Address, uint64) error); ok { 127 r1 = rf(ctx, address, height) 128 } else { 129 r1 = ret.Error(1) 130 } 131 132 return r0, r1 133 } 134 135 // GetAccountAtLatestBlock provides a mock function with given fields: ctx, address 136 func (_m *API) GetAccountAtLatestBlock(ctx context.Context, address flow.Address) (*flow.Account, error) { 137 ret := _m.Called(ctx, address) 138 139 var r0 *flow.Account 140 if rf, ok := ret.Get(0).(func(context.Context, flow.Address) *flow.Account); ok { 141 r0 = rf(ctx, address) 142 } else { 143 if ret.Get(0) != nil { 144 r0 = ret.Get(0).(*flow.Account) 145 } 146 } 147 148 var r1 error 149 if rf, ok := ret.Get(1).(func(context.Context, flow.Address) error); ok { 150 r1 = rf(ctx, address) 151 } else { 152 r1 = ret.Error(1) 153 } 154 155 return r0, r1 156 } 157 158 // GetBlockByHeight provides a mock function with given fields: ctx, height 159 func (_m *API) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, flow.BlockStatus, error) { 160 ret := _m.Called(ctx, height) 161 162 var r0 *flow.Block 163 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Block); ok { 164 r0 = rf(ctx, height) 165 } else { 166 if ret.Get(0) != nil { 167 r0 = ret.Get(0).(*flow.Block) 168 } 169 } 170 171 var r1 flow.BlockStatus 172 if rf, ok := ret.Get(1).(func(context.Context, uint64) flow.BlockStatus); ok { 173 r1 = rf(ctx, height) 174 } else { 175 r1 = ret.Get(1).(flow.BlockStatus) 176 } 177 178 var r2 error 179 if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { 180 r2 = rf(ctx, height) 181 } else { 182 r2 = ret.Error(2) 183 } 184 185 return r0, r1, r2 186 } 187 188 // GetBlockByID provides a mock function with given fields: ctx, id 189 func (_m *API) GetBlockByID(ctx context.Context, id flow.Identifier) (*flow.Block, flow.BlockStatus, error) { 190 ret := _m.Called(ctx, id) 191 192 var r0 *flow.Block 193 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Block); ok { 194 r0 = rf(ctx, id) 195 } else { 196 if ret.Get(0) != nil { 197 r0 = ret.Get(0).(*flow.Block) 198 } 199 } 200 201 var r1 flow.BlockStatus 202 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) flow.BlockStatus); ok { 203 r1 = rf(ctx, id) 204 } else { 205 r1 = ret.Get(1).(flow.BlockStatus) 206 } 207 208 var r2 error 209 if rf, ok := ret.Get(2).(func(context.Context, flow.Identifier) error); ok { 210 r2 = rf(ctx, id) 211 } else { 212 r2 = ret.Error(2) 213 } 214 215 return r0, r1, r2 216 } 217 218 // GetBlockHeaderByHeight provides a mock function with given fields: ctx, height 219 func (_m *API) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.Header, flow.BlockStatus, error) { 220 ret := _m.Called(ctx, height) 221 222 var r0 *flow.Header 223 if rf, ok := ret.Get(0).(func(context.Context, uint64) *flow.Header); ok { 224 r0 = rf(ctx, height) 225 } else { 226 if ret.Get(0) != nil { 227 r0 = ret.Get(0).(*flow.Header) 228 } 229 } 230 231 var r1 flow.BlockStatus 232 if rf, ok := ret.Get(1).(func(context.Context, uint64) flow.BlockStatus); ok { 233 r1 = rf(ctx, height) 234 } else { 235 r1 = ret.Get(1).(flow.BlockStatus) 236 } 237 238 var r2 error 239 if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { 240 r2 = rf(ctx, height) 241 } else { 242 r2 = ret.Error(2) 243 } 244 245 return r0, r1, r2 246 } 247 248 // GetBlockHeaderByID provides a mock function with given fields: ctx, id 249 func (_m *API) GetBlockHeaderByID(ctx context.Context, id flow.Identifier) (*flow.Header, flow.BlockStatus, error) { 250 ret := _m.Called(ctx, id) 251 252 var r0 *flow.Header 253 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.Header); ok { 254 r0 = rf(ctx, id) 255 } else { 256 if ret.Get(0) != nil { 257 r0 = ret.Get(0).(*flow.Header) 258 } 259 } 260 261 var r1 flow.BlockStatus 262 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) flow.BlockStatus); ok { 263 r1 = rf(ctx, id) 264 } else { 265 r1 = ret.Get(1).(flow.BlockStatus) 266 } 267 268 var r2 error 269 if rf, ok := ret.Get(2).(func(context.Context, flow.Identifier) error); ok { 270 r2 = rf(ctx, id) 271 } else { 272 r2 = ret.Error(2) 273 } 274 275 return r0, r1, r2 276 } 277 278 // GetCollectionByID provides a mock function with given fields: ctx, id 279 func (_m *API) GetCollectionByID(ctx context.Context, id flow.Identifier) (*flow.LightCollection, error) { 280 ret := _m.Called(ctx, id) 281 282 var r0 *flow.LightCollection 283 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.LightCollection); ok { 284 r0 = rf(ctx, id) 285 } else { 286 if ret.Get(0) != nil { 287 r0 = ret.Get(0).(*flow.LightCollection) 288 } 289 } 290 291 var r1 error 292 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 293 r1 = rf(ctx, id) 294 } else { 295 r1 = ret.Error(1) 296 } 297 298 return r0, r1 299 } 300 301 // GetEventsForBlockIDs provides a mock function with given fields: ctx, eventType, blockIDs 302 func (_m *API) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]flow.BlockEvents, error) { 303 ret := _m.Called(ctx, eventType, blockIDs) 304 305 var r0 []flow.BlockEvents 306 if rf, ok := ret.Get(0).(func(context.Context, string, []flow.Identifier) []flow.BlockEvents); ok { 307 r0 = rf(ctx, eventType, blockIDs) 308 } else { 309 if ret.Get(0) != nil { 310 r0 = ret.Get(0).([]flow.BlockEvents) 311 } 312 } 313 314 var r1 error 315 if rf, ok := ret.Get(1).(func(context.Context, string, []flow.Identifier) error); ok { 316 r1 = rf(ctx, eventType, blockIDs) 317 } else { 318 r1 = ret.Error(1) 319 } 320 321 return r0, r1 322 } 323 324 // GetEventsForHeightRange provides a mock function with given fields: ctx, eventType, startHeight, endHeight 325 func (_m *API) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight uint64, endHeight uint64) ([]flow.BlockEvents, error) { 326 ret := _m.Called(ctx, eventType, startHeight, endHeight) 327 328 var r0 []flow.BlockEvents 329 if rf, ok := ret.Get(0).(func(context.Context, string, uint64, uint64) []flow.BlockEvents); ok { 330 r0 = rf(ctx, eventType, startHeight, endHeight) 331 } else { 332 if ret.Get(0) != nil { 333 r0 = ret.Get(0).([]flow.BlockEvents) 334 } 335 } 336 337 var r1 error 338 if rf, ok := ret.Get(1).(func(context.Context, string, uint64, uint64) error); ok { 339 r1 = rf(ctx, eventType, startHeight, endHeight) 340 } else { 341 r1 = ret.Error(1) 342 } 343 344 return r0, r1 345 } 346 347 // GetExecutionResultByID provides a mock function with given fields: ctx, id 348 func (_m *API) GetExecutionResultByID(ctx context.Context, id flow.Identifier) (*flow.ExecutionResult, error) { 349 ret := _m.Called(ctx, id) 350 351 var r0 *flow.ExecutionResult 352 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.ExecutionResult); ok { 353 r0 = rf(ctx, id) 354 } else { 355 if ret.Get(0) != nil { 356 r0 = ret.Get(0).(*flow.ExecutionResult) 357 } 358 } 359 360 var r1 error 361 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 362 r1 = rf(ctx, id) 363 } else { 364 r1 = ret.Error(1) 365 } 366 367 return r0, r1 368 } 369 370 // GetExecutionResultForBlockID provides a mock function with given fields: ctx, blockID 371 func (_m *API) GetExecutionResultForBlockID(ctx context.Context, blockID flow.Identifier) (*flow.ExecutionResult, error) { 372 ret := _m.Called(ctx, blockID) 373 374 var r0 *flow.ExecutionResult 375 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.ExecutionResult); ok { 376 r0 = rf(ctx, blockID) 377 } else { 378 if ret.Get(0) != nil { 379 r0 = ret.Get(0).(*flow.ExecutionResult) 380 } 381 } 382 383 var r1 error 384 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 385 r1 = rf(ctx, blockID) 386 } else { 387 r1 = ret.Error(1) 388 } 389 390 return r0, r1 391 } 392 393 // GetLatestBlock provides a mock function with given fields: ctx, isSealed 394 func (_m *API) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, flow.BlockStatus, error) { 395 ret := _m.Called(ctx, isSealed) 396 397 var r0 *flow.Block 398 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Block); ok { 399 r0 = rf(ctx, isSealed) 400 } else { 401 if ret.Get(0) != nil { 402 r0 = ret.Get(0).(*flow.Block) 403 } 404 } 405 406 var r1 flow.BlockStatus 407 if rf, ok := ret.Get(1).(func(context.Context, bool) flow.BlockStatus); ok { 408 r1 = rf(ctx, isSealed) 409 } else { 410 r1 = ret.Get(1).(flow.BlockStatus) 411 } 412 413 var r2 error 414 if rf, ok := ret.Get(2).(func(context.Context, bool) error); ok { 415 r2 = rf(ctx, isSealed) 416 } else { 417 r2 = ret.Error(2) 418 } 419 420 return r0, r1, r2 421 } 422 423 // GetLatestBlockHeader provides a mock function with given fields: ctx, isSealed 424 func (_m *API) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.Header, flow.BlockStatus, error) { 425 ret := _m.Called(ctx, isSealed) 426 427 var r0 *flow.Header 428 if rf, ok := ret.Get(0).(func(context.Context, bool) *flow.Header); ok { 429 r0 = rf(ctx, isSealed) 430 } else { 431 if ret.Get(0) != nil { 432 r0 = ret.Get(0).(*flow.Header) 433 } 434 } 435 436 var r1 flow.BlockStatus 437 if rf, ok := ret.Get(1).(func(context.Context, bool) flow.BlockStatus); ok { 438 r1 = rf(ctx, isSealed) 439 } else { 440 r1 = ret.Get(1).(flow.BlockStatus) 441 } 442 443 var r2 error 444 if rf, ok := ret.Get(2).(func(context.Context, bool) error); ok { 445 r2 = rf(ctx, isSealed) 446 } else { 447 r2 = ret.Error(2) 448 } 449 450 return r0, r1, r2 451 } 452 453 // GetLatestProtocolStateSnapshot provides a mock function with given fields: ctx 454 func (_m *API) GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error) { 455 ret := _m.Called(ctx) 456 457 var r0 []byte 458 if rf, ok := ret.Get(0).(func(context.Context) []byte); ok { 459 r0 = rf(ctx) 460 } else { 461 if ret.Get(0) != nil { 462 r0 = ret.Get(0).([]byte) 463 } 464 } 465 466 var r1 error 467 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 468 r1 = rf(ctx) 469 } else { 470 r1 = ret.Error(1) 471 } 472 473 return r0, r1 474 } 475 476 // GetNetworkParameters provides a mock function with given fields: ctx 477 func (_m *API) GetNetworkParameters(ctx context.Context) access.NetworkParameters { 478 ret := _m.Called(ctx) 479 480 var r0 access.NetworkParameters 481 if rf, ok := ret.Get(0).(func(context.Context) access.NetworkParameters); ok { 482 r0 = rf(ctx) 483 } else { 484 r0 = ret.Get(0).(access.NetworkParameters) 485 } 486 487 return r0 488 } 489 490 // GetTransaction provides a mock function with given fields: ctx, id 491 func (_m *API) GetTransaction(ctx context.Context, id flow.Identifier) (*flow.TransactionBody, error) { 492 ret := _m.Called(ctx, id) 493 494 var r0 *flow.TransactionBody 495 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *flow.TransactionBody); ok { 496 r0 = rf(ctx, id) 497 } else { 498 if ret.Get(0) != nil { 499 r0 = ret.Get(0).(*flow.TransactionBody) 500 } 501 } 502 503 var r1 error 504 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 505 r1 = rf(ctx, id) 506 } else { 507 r1 = ret.Error(1) 508 } 509 510 return r0, r1 511 } 512 513 // GetTransactionResult provides a mock function with given fields: ctx, id 514 func (_m *API) GetTransactionResult(ctx context.Context, id flow.Identifier) (*access.TransactionResult, error) { 515 ret := _m.Called(ctx, id) 516 517 var r0 *access.TransactionResult 518 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *access.TransactionResult); ok { 519 r0 = rf(ctx, id) 520 } else { 521 if ret.Get(0) != nil { 522 r0 = ret.Get(0).(*access.TransactionResult) 523 } 524 } 525 526 var r1 error 527 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 528 r1 = rf(ctx, id) 529 } else { 530 r1 = ret.Error(1) 531 } 532 533 return r0, r1 534 } 535 536 // GetTransactionResultByIndex provides a mock function with given fields: ctx, blockID, index 537 func (_m *API) GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32) (*access.TransactionResult, error) { 538 ret := _m.Called(ctx, blockID, index) 539 540 var r0 *access.TransactionResult 541 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, uint32) *access.TransactionResult); ok { 542 r0 = rf(ctx, blockID, index) 543 } else { 544 if ret.Get(0) != nil { 545 r0 = ret.Get(0).(*access.TransactionResult) 546 } 547 } 548 549 var r1 error 550 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, uint32) error); ok { 551 r1 = rf(ctx, blockID, index) 552 } else { 553 r1 = ret.Error(1) 554 } 555 556 return r0, r1 557 } 558 559 // GetTransactionResultsByBlockID provides a mock function with given fields: ctx, blockID 560 func (_m *API) GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*access.TransactionResult, error) { 561 ret := _m.Called(ctx, blockID) 562 563 var r0 []*access.TransactionResult 564 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) []*access.TransactionResult); ok { 565 r0 = rf(ctx, blockID) 566 } else { 567 if ret.Get(0) != nil { 568 r0 = ret.Get(0).([]*access.TransactionResult) 569 } 570 } 571 572 var r1 error 573 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 574 r1 = rf(ctx, blockID) 575 } else { 576 r1 = ret.Error(1) 577 } 578 579 return r0, r1 580 } 581 582 // GetTransactionsByBlockID provides a mock function with given fields: ctx, blockID 583 func (_m *API) GetTransactionsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionBody, error) { 584 ret := _m.Called(ctx, blockID) 585 586 var r0 []*flow.TransactionBody 587 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) []*flow.TransactionBody); ok { 588 r0 = rf(ctx, blockID) 589 } else { 590 if ret.Get(0) != nil { 591 r0 = ret.Get(0).([]*flow.TransactionBody) 592 } 593 } 594 595 var r1 error 596 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 597 r1 = rf(ctx, blockID) 598 } else { 599 r1 = ret.Error(1) 600 } 601 602 return r0, r1 603 } 604 605 // Ping provides a mock function with given fields: ctx 606 func (_m *API) Ping(ctx context.Context) error { 607 ret := _m.Called(ctx) 608 609 var r0 error 610 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 611 r0 = rf(ctx) 612 } else { 613 r0 = ret.Error(0) 614 } 615 616 return r0 617 } 618 619 // SendTransaction provides a mock function with given fields: ctx, tx 620 func (_m *API) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error { 621 ret := _m.Called(ctx, tx) 622 623 var r0 error 624 if rf, ok := ret.Get(0).(func(context.Context, *flow.TransactionBody) error); ok { 625 r0 = rf(ctx, tx) 626 } else { 627 r0 = ret.Error(0) 628 } 629 630 return r0 631 } 632 633 type mockConstructorTestingTNewAPI interface { 634 mock.TestingT 635 Cleanup(func()) 636 } 637 638 // 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. 639 func NewAPI(t mockConstructorTestingTNewAPI) *API { 640 mock := &API{} 641 mock.Mock.Test(t) 642 643 t.Cleanup(func() { mock.AssertExpectations(t) }) 644 645 return mock 646 }