github.com/koko1123/flow-go-1@v0.29.6/fvm/environment/mock/environment.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 atree "github.com/onflow/atree" 7 ast "github.com/onflow/cadence/runtime/ast" 8 9 attribute "go.opentelemetry.io/otel/attribute" 10 11 cadence "github.com/onflow/cadence" 12 13 common "github.com/onflow/cadence/runtime/common" 14 15 derived "github.com/koko1123/flow-go-1/fvm/derived" 16 17 flow "github.com/koko1123/flow-go-1/model/flow" 18 19 interpreter "github.com/onflow/cadence/runtime/interpreter" 20 21 meter "github.com/koko1123/flow-go-1/fvm/meter" 22 23 mock "github.com/stretchr/testify/mock" 24 25 oteltrace "go.opentelemetry.io/otel/trace" 26 27 runtime "github.com/koko1123/flow-go-1/fvm/runtime" 28 29 sema "github.com/onflow/cadence/runtime/sema" 30 31 stdlib "github.com/onflow/cadence/runtime/stdlib" 32 33 time "time" 34 35 trace "github.com/koko1123/flow-go-1/module/trace" 36 37 tracing "github.com/koko1123/flow-go-1/fvm/tracing" 38 39 zerolog "github.com/rs/zerolog" 40 ) 41 42 // Environment is an autogenerated mock type for the Environment type 43 type Environment struct { 44 mock.Mock 45 } 46 47 // AccountKeysCount provides a mock function with given fields: address 48 func (_m *Environment) AccountKeysCount(address common.Address) (uint64, error) { 49 ret := _m.Called(address) 50 51 var r0 uint64 52 if rf, ok := ret.Get(0).(func(common.Address) uint64); ok { 53 r0 = rf(address) 54 } else { 55 r0 = ret.Get(0).(uint64) 56 } 57 58 var r1 error 59 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 60 r1 = rf(address) 61 } else { 62 r1 = ret.Error(1) 63 } 64 65 return r0, r1 66 } 67 68 // AccountsStorageCapacity provides a mock function with given fields: addresses, payer, maxTxFees 69 func (_m *Environment) AccountsStorageCapacity(addresses []common.Address, payer common.Address, maxTxFees uint64) (cadence.Value, error) { 70 ret := _m.Called(addresses, payer, maxTxFees) 71 72 var r0 cadence.Value 73 if rf, ok := ret.Get(0).(func([]common.Address, common.Address, uint64) cadence.Value); ok { 74 r0 = rf(addresses, payer, maxTxFees) 75 } else { 76 if ret.Get(0) != nil { 77 r0 = ret.Get(0).(cadence.Value) 78 } 79 } 80 81 var r1 error 82 if rf, ok := ret.Get(1).(func([]common.Address, common.Address, uint64) error); ok { 83 r1 = rf(addresses, payer, maxTxFees) 84 } else { 85 r1 = ret.Error(1) 86 } 87 88 return r0, r1 89 } 90 91 // AddAccountKey provides a mock function with given fields: address, publicKey, hashAlgo, weight 92 func (_m *Environment) AddAccountKey(address common.Address, publicKey *stdlib.PublicKey, hashAlgo sema.HashAlgorithm, weight int) (*stdlib.AccountKey, error) { 93 ret := _m.Called(address, publicKey, hashAlgo, weight) 94 95 var r0 *stdlib.AccountKey 96 if rf, ok := ret.Get(0).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) *stdlib.AccountKey); ok { 97 r0 = rf(address, publicKey, hashAlgo, weight) 98 } else { 99 if ret.Get(0) != nil { 100 r0 = ret.Get(0).(*stdlib.AccountKey) 101 } 102 } 103 104 var r1 error 105 if rf, ok := ret.Get(1).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) error); ok { 106 r1 = rf(address, publicKey, hashAlgo, weight) 107 } else { 108 r1 = ret.Error(1) 109 } 110 111 return r0, r1 112 } 113 114 // AddEncodedAccountKey provides a mock function with given fields: address, publicKey 115 func (_m *Environment) AddEncodedAccountKey(address common.Address, publicKey []byte) error { 116 ret := _m.Called(address, publicKey) 117 118 var r0 error 119 if rf, ok := ret.Get(0).(func(common.Address, []byte) error); ok { 120 r0 = rf(address, publicKey) 121 } else { 122 r0 = ret.Error(0) 123 } 124 125 return r0 126 } 127 128 // AllocateStorageIndex provides a mock function with given fields: owner 129 func (_m *Environment) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error) { 130 ret := _m.Called(owner) 131 132 var r0 atree.StorageIndex 133 if rf, ok := ret.Get(0).(func([]byte) atree.StorageIndex); ok { 134 r0 = rf(owner) 135 } else { 136 if ret.Get(0) != nil { 137 r0 = ret.Get(0).(atree.StorageIndex) 138 } 139 } 140 141 var r1 error 142 if rf, ok := ret.Get(1).(func([]byte) error); ok { 143 r1 = rf(owner) 144 } else { 145 r1 = ret.Error(1) 146 } 147 148 return r0, r1 149 } 150 151 // BLSAggregatePublicKeys provides a mock function with given fields: publicKeys 152 func (_m *Environment) BLSAggregatePublicKeys(publicKeys []*stdlib.PublicKey) (*stdlib.PublicKey, error) { 153 ret := _m.Called(publicKeys) 154 155 var r0 *stdlib.PublicKey 156 if rf, ok := ret.Get(0).(func([]*stdlib.PublicKey) *stdlib.PublicKey); ok { 157 r0 = rf(publicKeys) 158 } else { 159 if ret.Get(0) != nil { 160 r0 = ret.Get(0).(*stdlib.PublicKey) 161 } 162 } 163 164 var r1 error 165 if rf, ok := ret.Get(1).(func([]*stdlib.PublicKey) error); ok { 166 r1 = rf(publicKeys) 167 } else { 168 r1 = ret.Error(1) 169 } 170 171 return r0, r1 172 } 173 174 // BLSAggregateSignatures provides a mock function with given fields: signatures 175 func (_m *Environment) BLSAggregateSignatures(signatures [][]byte) ([]byte, error) { 176 ret := _m.Called(signatures) 177 178 var r0 []byte 179 if rf, ok := ret.Get(0).(func([][]byte) []byte); ok { 180 r0 = rf(signatures) 181 } else { 182 if ret.Get(0) != nil { 183 r0 = ret.Get(0).([]byte) 184 } 185 } 186 187 var r1 error 188 if rf, ok := ret.Get(1).(func([][]byte) error); ok { 189 r1 = rf(signatures) 190 } else { 191 r1 = ret.Error(1) 192 } 193 194 return r0, r1 195 } 196 197 // BLSVerifyPOP provides a mock function with given fields: publicKey, signature 198 func (_m *Environment) BLSVerifyPOP(publicKey *stdlib.PublicKey, signature []byte) (bool, error) { 199 ret := _m.Called(publicKey, signature) 200 201 var r0 bool 202 if rf, ok := ret.Get(0).(func(*stdlib.PublicKey, []byte) bool); ok { 203 r0 = rf(publicKey, signature) 204 } else { 205 r0 = ret.Get(0).(bool) 206 } 207 208 var r1 error 209 if rf, ok := ret.Get(1).(func(*stdlib.PublicKey, []byte) error); ok { 210 r1 = rf(publicKey, signature) 211 } else { 212 r1 = ret.Error(1) 213 } 214 215 return r0, r1 216 } 217 218 // BorrowCadenceRuntime provides a mock function with given fields: 219 func (_m *Environment) BorrowCadenceRuntime() *runtime.ReusableCadenceRuntime { 220 ret := _m.Called() 221 222 var r0 *runtime.ReusableCadenceRuntime 223 if rf, ok := ret.Get(0).(func() *runtime.ReusableCadenceRuntime); ok { 224 r0 = rf() 225 } else { 226 if ret.Get(0) != nil { 227 r0 = ret.Get(0).(*runtime.ReusableCadenceRuntime) 228 } 229 } 230 231 return r0 232 } 233 234 // CheckPayerBalanceAndGetMaxTxFees provides a mock function with given fields: payer, inclusionEffort, executionEffort 235 func (_m *Environment) CheckPayerBalanceAndGetMaxTxFees(payer flow.Address, inclusionEffort uint64, executionEffort uint64) (cadence.Value, error) { 236 ret := _m.Called(payer, inclusionEffort, executionEffort) 237 238 var r0 cadence.Value 239 if rf, ok := ret.Get(0).(func(flow.Address, uint64, uint64) cadence.Value); ok { 240 r0 = rf(payer, inclusionEffort, executionEffort) 241 } else { 242 if ret.Get(0) != nil { 243 r0 = ret.Get(0).(cadence.Value) 244 } 245 } 246 247 var r1 error 248 if rf, ok := ret.Get(1).(func(flow.Address, uint64, uint64) error); ok { 249 r1 = rf(payer, inclusionEffort, executionEffort) 250 } else { 251 r1 = ret.Error(1) 252 } 253 254 return r0, r1 255 } 256 257 // ComputationIntensities provides a mock function with given fields: 258 func (_m *Environment) ComputationIntensities() meter.MeteredComputationIntensities { 259 ret := _m.Called() 260 261 var r0 meter.MeteredComputationIntensities 262 if rf, ok := ret.Get(0).(func() meter.MeteredComputationIntensities); ok { 263 r0 = rf() 264 } else { 265 if ret.Get(0) != nil { 266 r0 = ret.Get(0).(meter.MeteredComputationIntensities) 267 } 268 } 269 270 return r0 271 } 272 273 // ComputationUsed provides a mock function with given fields: 274 func (_m *Environment) ComputationUsed() uint64 { 275 ret := _m.Called() 276 277 var r0 uint64 278 if rf, ok := ret.Get(0).(func() uint64); ok { 279 r0 = rf() 280 } else { 281 r0 = ret.Get(0).(uint64) 282 } 283 284 return r0 285 } 286 287 // CreateAccount provides a mock function with given fields: payer 288 func (_m *Environment) CreateAccount(payer common.Address) (common.Address, error) { 289 ret := _m.Called(payer) 290 291 var r0 common.Address 292 if rf, ok := ret.Get(0).(func(common.Address) common.Address); ok { 293 r0 = rf(payer) 294 } else { 295 if ret.Get(0) != nil { 296 r0 = ret.Get(0).(common.Address) 297 } 298 } 299 300 var r1 error 301 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 302 r1 = rf(payer) 303 } else { 304 r1 = ret.Error(1) 305 } 306 307 return r0, r1 308 } 309 310 // DecodeArgument provides a mock function with given fields: argument, argumentType 311 func (_m *Environment) DecodeArgument(argument []byte, argumentType cadence.Type) (cadence.Value, error) { 312 ret := _m.Called(argument, argumentType) 313 314 var r0 cadence.Value 315 if rf, ok := ret.Get(0).(func([]byte, cadence.Type) cadence.Value); ok { 316 r0 = rf(argument, argumentType) 317 } else { 318 if ret.Get(0) != nil { 319 r0 = ret.Get(0).(cadence.Value) 320 } 321 } 322 323 var r1 error 324 if rf, ok := ret.Get(1).(func([]byte, cadence.Type) error); ok { 325 r1 = rf(argument, argumentType) 326 } else { 327 r1 = ret.Error(1) 328 } 329 330 return r0, r1 331 } 332 333 // DeductTransactionFees provides a mock function with given fields: payer, inclusionEffort, executionEffort 334 func (_m *Environment) DeductTransactionFees(payer flow.Address, inclusionEffort uint64, executionEffort uint64) (cadence.Value, error) { 335 ret := _m.Called(payer, inclusionEffort, executionEffort) 336 337 var r0 cadence.Value 338 if rf, ok := ret.Get(0).(func(flow.Address, uint64, uint64) cadence.Value); ok { 339 r0 = rf(payer, inclusionEffort, executionEffort) 340 } else { 341 if ret.Get(0) != nil { 342 r0 = ret.Get(0).(cadence.Value) 343 } 344 } 345 346 var r1 error 347 if rf, ok := ret.Get(1).(func(flow.Address, uint64, uint64) error); ok { 348 r1 = rf(payer, inclusionEffort, executionEffort) 349 } else { 350 r1 = ret.Error(1) 351 } 352 353 return r0, r1 354 } 355 356 // EmitEvent provides a mock function with given fields: _a0 357 func (_m *Environment) EmitEvent(_a0 cadence.Event) error { 358 ret := _m.Called(_a0) 359 360 var r0 error 361 if rf, ok := ret.Get(0).(func(cadence.Event) error); ok { 362 r0 = rf(_a0) 363 } else { 364 r0 = ret.Error(0) 365 } 366 367 return r0 368 } 369 370 // Events provides a mock function with given fields: 371 func (_m *Environment) Events() []flow.Event { 372 ret := _m.Called() 373 374 var r0 []flow.Event 375 if rf, ok := ret.Get(0).(func() []flow.Event); ok { 376 r0 = rf() 377 } else { 378 if ret.Get(0) != nil { 379 r0 = ret.Get(0).([]flow.Event) 380 } 381 } 382 383 return r0 384 } 385 386 // FlushPendingUpdates provides a mock function with given fields: 387 func (_m *Environment) FlushPendingUpdates() (derived.TransactionInvalidator, error) { 388 ret := _m.Called() 389 390 var r0 derived.TransactionInvalidator 391 if rf, ok := ret.Get(0).(func() derived.TransactionInvalidator); ok { 392 r0 = rf() 393 } else { 394 if ret.Get(0) != nil { 395 r0 = ret.Get(0).(derived.TransactionInvalidator) 396 } 397 } 398 399 var r1 error 400 if rf, ok := ret.Get(1).(func() error); ok { 401 r1 = rf() 402 } else { 403 r1 = ret.Error(1) 404 } 405 406 return r0, r1 407 } 408 409 // FrozenAccounts provides a mock function with given fields: 410 func (_m *Environment) FrozenAccounts() []common.Address { 411 ret := _m.Called() 412 413 var r0 []common.Address 414 if rf, ok := ret.Get(0).(func() []common.Address); ok { 415 r0 = rf() 416 } else { 417 if ret.Get(0) != nil { 418 r0 = ret.Get(0).([]common.Address) 419 } 420 } 421 422 return r0 423 } 424 425 // GenerateUUID provides a mock function with given fields: 426 func (_m *Environment) GenerateUUID() (uint64, error) { 427 ret := _m.Called() 428 429 var r0 uint64 430 if rf, ok := ret.Get(0).(func() uint64); ok { 431 r0 = rf() 432 } else { 433 r0 = ret.Get(0).(uint64) 434 } 435 436 var r1 error 437 if rf, ok := ret.Get(1).(func() error); ok { 438 r1 = rf() 439 } else { 440 r1 = ret.Error(1) 441 } 442 443 return r0, r1 444 } 445 446 // GetAccount provides a mock function with given fields: address 447 func (_m *Environment) GetAccount(address flow.Address) (*flow.Account, error) { 448 ret := _m.Called(address) 449 450 var r0 *flow.Account 451 if rf, ok := ret.Get(0).(func(flow.Address) *flow.Account); ok { 452 r0 = rf(address) 453 } else { 454 if ret.Get(0) != nil { 455 r0 = ret.Get(0).(*flow.Account) 456 } 457 } 458 459 var r1 error 460 if rf, ok := ret.Get(1).(func(flow.Address) error); ok { 461 r1 = rf(address) 462 } else { 463 r1 = ret.Error(1) 464 } 465 466 return r0, r1 467 } 468 469 // GetAccountAvailableBalance provides a mock function with given fields: address 470 func (_m *Environment) GetAccountAvailableBalance(address common.Address) (uint64, error) { 471 ret := _m.Called(address) 472 473 var r0 uint64 474 if rf, ok := ret.Get(0).(func(common.Address) uint64); ok { 475 r0 = rf(address) 476 } else { 477 r0 = ret.Get(0).(uint64) 478 } 479 480 var r1 error 481 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 482 r1 = rf(address) 483 } else { 484 r1 = ret.Error(1) 485 } 486 487 return r0, r1 488 } 489 490 // GetAccountBalance provides a mock function with given fields: address 491 func (_m *Environment) GetAccountBalance(address common.Address) (uint64, error) { 492 ret := _m.Called(address) 493 494 var r0 uint64 495 if rf, ok := ret.Get(0).(func(common.Address) uint64); ok { 496 r0 = rf(address) 497 } else { 498 r0 = ret.Get(0).(uint64) 499 } 500 501 var r1 error 502 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 503 r1 = rf(address) 504 } else { 505 r1 = ret.Error(1) 506 } 507 508 return r0, r1 509 } 510 511 // GetAccountContractCode provides a mock function with given fields: address, name 512 func (_m *Environment) GetAccountContractCode(address common.Address, name string) ([]byte, error) { 513 ret := _m.Called(address, name) 514 515 var r0 []byte 516 if rf, ok := ret.Get(0).(func(common.Address, string) []byte); ok { 517 r0 = rf(address, name) 518 } else { 519 if ret.Get(0) != nil { 520 r0 = ret.Get(0).([]byte) 521 } 522 } 523 524 var r1 error 525 if rf, ok := ret.Get(1).(func(common.Address, string) error); ok { 526 r1 = rf(address, name) 527 } else { 528 r1 = ret.Error(1) 529 } 530 531 return r0, r1 532 } 533 534 // GetAccountContractNames provides a mock function with given fields: address 535 func (_m *Environment) GetAccountContractNames(address common.Address) ([]string, error) { 536 ret := _m.Called(address) 537 538 var r0 []string 539 if rf, ok := ret.Get(0).(func(common.Address) []string); ok { 540 r0 = rf(address) 541 } else { 542 if ret.Get(0) != nil { 543 r0 = ret.Get(0).([]string) 544 } 545 } 546 547 var r1 error 548 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 549 r1 = rf(address) 550 } else { 551 r1 = ret.Error(1) 552 } 553 554 return r0, r1 555 } 556 557 // GetAccountKey provides a mock function with given fields: address, index 558 func (_m *Environment) GetAccountKey(address common.Address, index int) (*stdlib.AccountKey, error) { 559 ret := _m.Called(address, index) 560 561 var r0 *stdlib.AccountKey 562 if rf, ok := ret.Get(0).(func(common.Address, int) *stdlib.AccountKey); ok { 563 r0 = rf(address, index) 564 } else { 565 if ret.Get(0) != nil { 566 r0 = ret.Get(0).(*stdlib.AccountKey) 567 } 568 } 569 570 var r1 error 571 if rf, ok := ret.Get(1).(func(common.Address, int) error); ok { 572 r1 = rf(address, index) 573 } else { 574 r1 = ret.Error(1) 575 } 576 577 return r0, r1 578 } 579 580 // GetBlockAtHeight provides a mock function with given fields: height 581 func (_m *Environment) GetBlockAtHeight(height uint64) (stdlib.Block, bool, error) { 582 ret := _m.Called(height) 583 584 var r0 stdlib.Block 585 if rf, ok := ret.Get(0).(func(uint64) stdlib.Block); ok { 586 r0 = rf(height) 587 } else { 588 r0 = ret.Get(0).(stdlib.Block) 589 } 590 591 var r1 bool 592 if rf, ok := ret.Get(1).(func(uint64) bool); ok { 593 r1 = rf(height) 594 } else { 595 r1 = ret.Get(1).(bool) 596 } 597 598 var r2 error 599 if rf, ok := ret.Get(2).(func(uint64) error); ok { 600 r2 = rf(height) 601 } else { 602 r2 = ret.Error(2) 603 } 604 605 return r0, r1, r2 606 } 607 608 // GetCode provides a mock function with given fields: location 609 func (_m *Environment) GetCode(location common.Location) ([]byte, error) { 610 ret := _m.Called(location) 611 612 var r0 []byte 613 if rf, ok := ret.Get(0).(func(common.Location) []byte); ok { 614 r0 = rf(location) 615 } else { 616 if ret.Get(0) != nil { 617 r0 = ret.Get(0).([]byte) 618 } 619 } 620 621 var r1 error 622 if rf, ok := ret.Get(1).(func(common.Location) error); ok { 623 r1 = rf(location) 624 } else { 625 r1 = ret.Error(1) 626 } 627 628 return r0, r1 629 } 630 631 // GetCurrentBlockHeight provides a mock function with given fields: 632 func (_m *Environment) GetCurrentBlockHeight() (uint64, error) { 633 ret := _m.Called() 634 635 var r0 uint64 636 if rf, ok := ret.Get(0).(func() uint64); ok { 637 r0 = rf() 638 } else { 639 r0 = ret.Get(0).(uint64) 640 } 641 642 var r1 error 643 if rf, ok := ret.Get(1).(func() error); ok { 644 r1 = rf() 645 } else { 646 r1 = ret.Error(1) 647 } 648 649 return r0, r1 650 } 651 652 // GetInterpreterSharedState provides a mock function with given fields: 653 func (_m *Environment) GetInterpreterSharedState() *interpreter.SharedState { 654 ret := _m.Called() 655 656 var r0 *interpreter.SharedState 657 if rf, ok := ret.Get(0).(func() *interpreter.SharedState); ok { 658 r0 = rf() 659 } else { 660 if ret.Get(0) != nil { 661 r0 = ret.Get(0).(*interpreter.SharedState) 662 } 663 } 664 665 return r0 666 } 667 668 // GetProgram provides a mock function with given fields: _a0 669 func (_m *Environment) GetProgram(_a0 common.Location) (*interpreter.Program, error) { 670 ret := _m.Called(_a0) 671 672 var r0 *interpreter.Program 673 if rf, ok := ret.Get(0).(func(common.Location) *interpreter.Program); ok { 674 r0 = rf(_a0) 675 } else { 676 if ret.Get(0) != nil { 677 r0 = ret.Get(0).(*interpreter.Program) 678 } 679 } 680 681 var r1 error 682 if rf, ok := ret.Get(1).(func(common.Location) error); ok { 683 r1 = rf(_a0) 684 } else { 685 r1 = ret.Error(1) 686 } 687 688 return r0, r1 689 } 690 691 // GetSigningAccounts provides a mock function with given fields: 692 func (_m *Environment) GetSigningAccounts() ([]common.Address, error) { 693 ret := _m.Called() 694 695 var r0 []common.Address 696 if rf, ok := ret.Get(0).(func() []common.Address); ok { 697 r0 = rf() 698 } else { 699 if ret.Get(0) != nil { 700 r0 = ret.Get(0).([]common.Address) 701 } 702 } 703 704 var r1 error 705 if rf, ok := ret.Get(1).(func() error); ok { 706 r1 = rf() 707 } else { 708 r1 = ret.Error(1) 709 } 710 711 return r0, r1 712 } 713 714 // GetStorageCapacity provides a mock function with given fields: address 715 func (_m *Environment) GetStorageCapacity(address common.Address) (uint64, error) { 716 ret := _m.Called(address) 717 718 var r0 uint64 719 if rf, ok := ret.Get(0).(func(common.Address) uint64); ok { 720 r0 = rf(address) 721 } else { 722 r0 = ret.Get(0).(uint64) 723 } 724 725 var r1 error 726 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 727 r1 = rf(address) 728 } else { 729 r1 = ret.Error(1) 730 } 731 732 return r0, r1 733 } 734 735 // GetStorageUsed provides a mock function with given fields: address 736 func (_m *Environment) GetStorageUsed(address common.Address) (uint64, error) { 737 ret := _m.Called(address) 738 739 var r0 uint64 740 if rf, ok := ret.Get(0).(func(common.Address) uint64); ok { 741 r0 = rf(address) 742 } else { 743 r0 = ret.Get(0).(uint64) 744 } 745 746 var r1 error 747 if rf, ok := ret.Get(1).(func(common.Address) error); ok { 748 r1 = rf(address) 749 } else { 750 r1 = ret.Error(1) 751 } 752 753 return r0, r1 754 } 755 756 // GetValue provides a mock function with given fields: owner, key 757 func (_m *Environment) GetValue(owner []byte, key []byte) ([]byte, error) { 758 ret := _m.Called(owner, key) 759 760 var r0 []byte 761 if rf, ok := ret.Get(0).(func([]byte, []byte) []byte); ok { 762 r0 = rf(owner, key) 763 } else { 764 if ret.Get(0) != nil { 765 r0 = ret.Get(0).([]byte) 766 } 767 } 768 769 var r1 error 770 if rf, ok := ret.Get(1).(func([]byte, []byte) error); ok { 771 r1 = rf(owner, key) 772 } else { 773 r1 = ret.Error(1) 774 } 775 776 return r0, r1 777 } 778 779 // Hash provides a mock function with given fields: data, tag, hashAlgorithm 780 func (_m *Environment) Hash(data []byte, tag string, hashAlgorithm sema.HashAlgorithm) ([]byte, error) { 781 ret := _m.Called(data, tag, hashAlgorithm) 782 783 var r0 []byte 784 if rf, ok := ret.Get(0).(func([]byte, string, sema.HashAlgorithm) []byte); ok { 785 r0 = rf(data, tag, hashAlgorithm) 786 } else { 787 if ret.Get(0) != nil { 788 r0 = ret.Get(0).([]byte) 789 } 790 } 791 792 var r1 error 793 if rf, ok := ret.Get(1).(func([]byte, string, sema.HashAlgorithm) error); ok { 794 r1 = rf(data, tag, hashAlgorithm) 795 } else { 796 r1 = ret.Error(1) 797 } 798 799 return r0, r1 800 } 801 802 // ImplementationDebugLog provides a mock function with given fields: message 803 func (_m *Environment) ImplementationDebugLog(message string) error { 804 ret := _m.Called(message) 805 806 var r0 error 807 if rf, ok := ret.Get(0).(func(string) error); ok { 808 r0 = rf(message) 809 } else { 810 r0 = ret.Error(0) 811 } 812 813 return r0 814 } 815 816 // IsServiceAccountAuthorizer provides a mock function with given fields: 817 func (_m *Environment) IsServiceAccountAuthorizer() bool { 818 ret := _m.Called() 819 820 var r0 bool 821 if rf, ok := ret.Get(0).(func() bool); ok { 822 r0 = rf() 823 } else { 824 r0 = ret.Get(0).(bool) 825 } 826 827 return r0 828 } 829 830 // LimitAccountStorage provides a mock function with given fields: 831 func (_m *Environment) LimitAccountStorage() bool { 832 ret := _m.Called() 833 834 var r0 bool 835 if rf, ok := ret.Get(0).(func() bool); ok { 836 r0 = rf() 837 } else { 838 r0 = ret.Get(0).(bool) 839 } 840 841 return r0 842 } 843 844 // Logger provides a mock function with given fields: 845 func (_m *Environment) Logger() *zerolog.Logger { 846 ret := _m.Called() 847 848 var r0 *zerolog.Logger 849 if rf, ok := ret.Get(0).(func() *zerolog.Logger); ok { 850 r0 = rf() 851 } else { 852 if ret.Get(0) != nil { 853 r0 = ret.Get(0).(*zerolog.Logger) 854 } 855 } 856 857 return r0 858 } 859 860 // Logs provides a mock function with given fields: 861 func (_m *Environment) Logs() []string { 862 ret := _m.Called() 863 864 var r0 []string 865 if rf, ok := ret.Get(0).(func() []string); ok { 866 r0 = rf() 867 } else { 868 if ret.Get(0) != nil { 869 r0 = ret.Get(0).([]string) 870 } 871 } 872 873 return r0 874 } 875 876 // MemoryEstimate provides a mock function with given fields: 877 func (_m *Environment) MemoryEstimate() uint64 { 878 ret := _m.Called() 879 880 var r0 uint64 881 if rf, ok := ret.Get(0).(func() uint64); ok { 882 r0 = rf() 883 } else { 884 r0 = ret.Get(0).(uint64) 885 } 886 887 return r0 888 } 889 890 // MeterComputation provides a mock function with given fields: operationType, intensity 891 func (_m *Environment) MeterComputation(operationType common.ComputationKind, intensity uint) error { 892 ret := _m.Called(operationType, intensity) 893 894 var r0 error 895 if rf, ok := ret.Get(0).(func(common.ComputationKind, uint) error); ok { 896 r0 = rf(operationType, intensity) 897 } else { 898 r0 = ret.Error(0) 899 } 900 901 return r0 902 } 903 904 // MeterEmittedEvent provides a mock function with given fields: byteSize 905 func (_m *Environment) MeterEmittedEvent(byteSize uint64) error { 906 ret := _m.Called(byteSize) 907 908 var r0 error 909 if rf, ok := ret.Get(0).(func(uint64) error); ok { 910 r0 = rf(byteSize) 911 } else { 912 r0 = ret.Error(0) 913 } 914 915 return r0 916 } 917 918 // MeterMemory provides a mock function with given fields: usage 919 func (_m *Environment) MeterMemory(usage common.MemoryUsage) error { 920 ret := _m.Called(usage) 921 922 var r0 error 923 if rf, ok := ret.Get(0).(func(common.MemoryUsage) error); ok { 924 r0 = rf(usage) 925 } else { 926 r0 = ret.Error(0) 927 } 928 929 return r0 930 } 931 932 // ProgramLog provides a mock function with given fields: _a0 933 func (_m *Environment) ProgramLog(_a0 string) error { 934 ret := _m.Called(_a0) 935 936 var r0 error 937 if rf, ok := ret.Get(0).(func(string) error); ok { 938 r0 = rf(_a0) 939 } else { 940 r0 = ret.Error(0) 941 } 942 943 return r0 944 } 945 946 // RecordTrace provides a mock function with given fields: operation, location, duration, attrs 947 func (_m *Environment) RecordTrace(operation string, location common.Location, duration time.Duration, attrs []attribute.KeyValue) { 948 _m.Called(operation, location, duration, attrs) 949 } 950 951 // RemoveAccountContractCode provides a mock function with given fields: address, name 952 func (_m *Environment) RemoveAccountContractCode(address common.Address, name string) error { 953 ret := _m.Called(address, name) 954 955 var r0 error 956 if rf, ok := ret.Get(0).(func(common.Address, string) error); ok { 957 r0 = rf(address, name) 958 } else { 959 r0 = ret.Error(0) 960 } 961 962 return r0 963 } 964 965 // Reset provides a mock function with given fields: 966 func (_m *Environment) Reset() { 967 _m.Called() 968 } 969 970 // ResolveLocation provides a mock function with given fields: identifiers, location 971 func (_m *Environment) ResolveLocation(identifiers []ast.Identifier, location common.Location) ([]sema.ResolvedLocation, error) { 972 ret := _m.Called(identifiers, location) 973 974 var r0 []sema.ResolvedLocation 975 if rf, ok := ret.Get(0).(func([]ast.Identifier, common.Location) []sema.ResolvedLocation); ok { 976 r0 = rf(identifiers, location) 977 } else { 978 if ret.Get(0) != nil { 979 r0 = ret.Get(0).([]sema.ResolvedLocation) 980 } 981 } 982 983 var r1 error 984 if rf, ok := ret.Get(1).(func([]ast.Identifier, common.Location) error); ok { 985 r1 = rf(identifiers, location) 986 } else { 987 r1 = ret.Error(1) 988 } 989 990 return r0, r1 991 } 992 993 // ResourceOwnerChanged provides a mock function with given fields: _a0, resource, oldOwner, newOwner 994 func (_m *Environment) ResourceOwnerChanged(_a0 *interpreter.Interpreter, resource *interpreter.CompositeValue, oldOwner common.Address, newOwner common.Address) { 995 _m.Called(_a0, resource, oldOwner, newOwner) 996 } 997 998 // ReturnCadenceRuntime provides a mock function with given fields: _a0 999 func (_m *Environment) ReturnCadenceRuntime(_a0 *runtime.ReusableCadenceRuntime) { 1000 _m.Called(_a0) 1001 } 1002 1003 // RevokeAccountKey provides a mock function with given fields: address, index 1004 func (_m *Environment) RevokeAccountKey(address common.Address, index int) (*stdlib.AccountKey, error) { 1005 ret := _m.Called(address, index) 1006 1007 var r0 *stdlib.AccountKey 1008 if rf, ok := ret.Get(0).(func(common.Address, int) *stdlib.AccountKey); ok { 1009 r0 = rf(address, index) 1010 } else { 1011 if ret.Get(0) != nil { 1012 r0 = ret.Get(0).(*stdlib.AccountKey) 1013 } 1014 } 1015 1016 var r1 error 1017 if rf, ok := ret.Get(1).(func(common.Address, int) error); ok { 1018 r1 = rf(address, index) 1019 } else { 1020 r1 = ret.Error(1) 1021 } 1022 1023 return r0, r1 1024 } 1025 1026 // RevokeEncodedAccountKey provides a mock function with given fields: address, index 1027 func (_m *Environment) RevokeEncodedAccountKey(address common.Address, index int) ([]byte, error) { 1028 ret := _m.Called(address, index) 1029 1030 var r0 []byte 1031 if rf, ok := ret.Get(0).(func(common.Address, int) []byte); ok { 1032 r0 = rf(address, index) 1033 } else { 1034 if ret.Get(0) != nil { 1035 r0 = ret.Get(0).([]byte) 1036 } 1037 } 1038 1039 var r1 error 1040 if rf, ok := ret.Get(1).(func(common.Address, int) error); ok { 1041 r1 = rf(address, index) 1042 } else { 1043 r1 = ret.Error(1) 1044 } 1045 1046 return r0, r1 1047 } 1048 1049 // ServiceEvents provides a mock function with given fields: 1050 func (_m *Environment) ServiceEvents() []flow.Event { 1051 ret := _m.Called() 1052 1053 var r0 []flow.Event 1054 if rf, ok := ret.Get(0).(func() []flow.Event); ok { 1055 r0 = rf() 1056 } else { 1057 if ret.Get(0) != nil { 1058 r0 = ret.Get(0).([]flow.Event) 1059 } 1060 } 1061 1062 return r0 1063 } 1064 1065 // SetAccountFrozen provides a mock function with given fields: address, frozen 1066 func (_m *Environment) SetAccountFrozen(address common.Address, frozen bool) error { 1067 ret := _m.Called(address, frozen) 1068 1069 var r0 error 1070 if rf, ok := ret.Get(0).(func(common.Address, bool) error); ok { 1071 r0 = rf(address, frozen) 1072 } else { 1073 r0 = ret.Error(0) 1074 } 1075 1076 return r0 1077 } 1078 1079 // SetInterpreterSharedState provides a mock function with given fields: state 1080 func (_m *Environment) SetInterpreterSharedState(state *interpreter.SharedState) { 1081 _m.Called(state) 1082 } 1083 1084 // SetProgram provides a mock function with given fields: _a0, _a1 1085 func (_m *Environment) SetProgram(_a0 common.Location, _a1 *interpreter.Program) error { 1086 ret := _m.Called(_a0, _a1) 1087 1088 var r0 error 1089 if rf, ok := ret.Get(0).(func(common.Location, *interpreter.Program) error); ok { 1090 r0 = rf(_a0, _a1) 1091 } else { 1092 r0 = ret.Error(0) 1093 } 1094 1095 return r0 1096 } 1097 1098 // SetValue provides a mock function with given fields: owner, key, value 1099 func (_m *Environment) SetValue(owner []byte, key []byte, value []byte) error { 1100 ret := _m.Called(owner, key, value) 1101 1102 var r0 error 1103 if rf, ok := ret.Get(0).(func([]byte, []byte, []byte) error); ok { 1104 r0 = rf(owner, key, value) 1105 } else { 1106 r0 = ret.Error(0) 1107 } 1108 1109 return r0 1110 } 1111 1112 // SigningAccounts provides a mock function with given fields: 1113 func (_m *Environment) SigningAccounts() []common.Address { 1114 ret := _m.Called() 1115 1116 var r0 []common.Address 1117 if rf, ok := ret.Get(0).(func() []common.Address); ok { 1118 r0 = rf() 1119 } else { 1120 if ret.Get(0) != nil { 1121 r0 = ret.Get(0).([]common.Address) 1122 } 1123 } 1124 1125 return r0 1126 } 1127 1128 // StartChildSpan provides a mock function with given fields: name, options 1129 func (_m *Environment) StartChildSpan(name trace.SpanName, options ...oteltrace.SpanStartOption) tracing.TracerSpan { 1130 _va := make([]interface{}, len(options)) 1131 for _i := range options { 1132 _va[_i] = options[_i] 1133 } 1134 var _ca []interface{} 1135 _ca = append(_ca, name) 1136 _ca = append(_ca, _va...) 1137 ret := _m.Called(_ca...) 1138 1139 var r0 tracing.TracerSpan 1140 if rf, ok := ret.Get(0).(func(trace.SpanName, ...oteltrace.SpanStartOption) tracing.TracerSpan); ok { 1141 r0 = rf(name, options...) 1142 } else { 1143 r0 = ret.Get(0).(tracing.TracerSpan) 1144 } 1145 1146 return r0 1147 } 1148 1149 // TotalEmittedEventBytes provides a mock function with given fields: 1150 func (_m *Environment) TotalEmittedEventBytes() uint64 { 1151 ret := _m.Called() 1152 1153 var r0 uint64 1154 if rf, ok := ret.Get(0).(func() uint64); ok { 1155 r0 = rf() 1156 } else { 1157 r0 = ret.Get(0).(uint64) 1158 } 1159 1160 return r0 1161 } 1162 1163 // TransactionFeesEnabled provides a mock function with given fields: 1164 func (_m *Environment) TransactionFeesEnabled() bool { 1165 ret := _m.Called() 1166 1167 var r0 bool 1168 if rf, ok := ret.Get(0).(func() bool); ok { 1169 r0 = rf() 1170 } else { 1171 r0 = ret.Get(0).(bool) 1172 } 1173 1174 return r0 1175 } 1176 1177 // TxID provides a mock function with given fields: 1178 func (_m *Environment) TxID() flow.Identifier { 1179 ret := _m.Called() 1180 1181 var r0 flow.Identifier 1182 if rf, ok := ret.Get(0).(func() flow.Identifier); ok { 1183 r0 = rf() 1184 } else { 1185 if ret.Get(0) != nil { 1186 r0 = ret.Get(0).(flow.Identifier) 1187 } 1188 } 1189 1190 return r0 1191 } 1192 1193 // TxIndex provides a mock function with given fields: 1194 func (_m *Environment) TxIndex() uint32 { 1195 ret := _m.Called() 1196 1197 var r0 uint32 1198 if rf, ok := ret.Get(0).(func() uint32); ok { 1199 r0 = rf() 1200 } else { 1201 r0 = ret.Get(0).(uint32) 1202 } 1203 1204 return r0 1205 } 1206 1207 // UnsafeRandom provides a mock function with given fields: 1208 func (_m *Environment) UnsafeRandom() (uint64, error) { 1209 ret := _m.Called() 1210 1211 var r0 uint64 1212 if rf, ok := ret.Get(0).(func() uint64); ok { 1213 r0 = rf() 1214 } else { 1215 r0 = ret.Get(0).(uint64) 1216 } 1217 1218 var r1 error 1219 if rf, ok := ret.Get(1).(func() error); ok { 1220 r1 = rf() 1221 } else { 1222 r1 = ret.Error(1) 1223 } 1224 1225 return r0, r1 1226 } 1227 1228 // UpdateAccountContractCode provides a mock function with given fields: address, name, code 1229 func (_m *Environment) UpdateAccountContractCode(address common.Address, name string, code []byte) error { 1230 ret := _m.Called(address, name, code) 1231 1232 var r0 error 1233 if rf, ok := ret.Get(0).(func(common.Address, string, []byte) error); ok { 1234 r0 = rf(address, name, code) 1235 } else { 1236 r0 = ret.Error(0) 1237 } 1238 1239 return r0 1240 } 1241 1242 // ValidatePublicKey provides a mock function with given fields: key 1243 func (_m *Environment) ValidatePublicKey(key *stdlib.PublicKey) error { 1244 ret := _m.Called(key) 1245 1246 var r0 error 1247 if rf, ok := ret.Get(0).(func(*stdlib.PublicKey) error); ok { 1248 r0 = rf(key) 1249 } else { 1250 r0 = ret.Error(0) 1251 } 1252 1253 return r0 1254 } 1255 1256 // ValueExists provides a mock function with given fields: owner, key 1257 func (_m *Environment) ValueExists(owner []byte, key []byte) (bool, error) { 1258 ret := _m.Called(owner, key) 1259 1260 var r0 bool 1261 if rf, ok := ret.Get(0).(func([]byte, []byte) bool); ok { 1262 r0 = rf(owner, key) 1263 } else { 1264 r0 = ret.Get(0).(bool) 1265 } 1266 1267 var r1 error 1268 if rf, ok := ret.Get(1).(func([]byte, []byte) error); ok { 1269 r1 = rf(owner, key) 1270 } else { 1271 r1 = ret.Error(1) 1272 } 1273 1274 return r0, r1 1275 } 1276 1277 // VerifySignature provides a mock function with given fields: signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm 1278 func (_m *Environment) VerifySignature(signature []byte, tag string, signedData []byte, publicKey []byte, signatureAlgorithm sema.SignatureAlgorithm, hashAlgorithm sema.HashAlgorithm) (bool, error) { 1279 ret := _m.Called(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 1280 1281 var r0 bool 1282 if rf, ok := ret.Get(0).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) bool); ok { 1283 r0 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 1284 } else { 1285 r0 = ret.Get(0).(bool) 1286 } 1287 1288 var r1 error 1289 if rf, ok := ret.Get(1).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) error); ok { 1290 r1 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 1291 } else { 1292 r1 = ret.Error(1) 1293 } 1294 1295 return r0, r1 1296 } 1297 1298 type mockConstructorTestingTNewEnvironment interface { 1299 mock.TestingT 1300 Cleanup(func()) 1301 } 1302 1303 // NewEnvironment creates a new instance of Environment. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 1304 func NewEnvironment(t mockConstructorTestingTNewEnvironment) *Environment { 1305 mock := &Environment{} 1306 mock.Mock.Test(t) 1307 1308 t.Cleanup(func() { mock.AssertExpectations(t) }) 1309 1310 return mock 1311 }