github.com/onflow/flow-go@v0.33.17/engine/execution/mock/script_executor.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 flow "github.com/onflow/flow-go/model/flow" 9 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // ScriptExecutor is an autogenerated mock type for the ScriptExecutor type 14 type ScriptExecutor struct { 15 mock.Mock 16 } 17 18 // ExecuteScriptAtBlockID provides a mock function with given fields: ctx, script, arguments, blockID 19 func (_m *ScriptExecutor) ExecuteScriptAtBlockID(ctx context.Context, script []byte, arguments [][]byte, blockID flow.Identifier) ([]byte, error) { 20 ret := _m.Called(ctx, script, arguments, blockID) 21 22 var r0 []byte 23 var r1 error 24 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, flow.Identifier) ([]byte, error)); ok { 25 return rf(ctx, script, arguments, blockID) 26 } 27 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, flow.Identifier) []byte); ok { 28 r0 = rf(ctx, script, arguments, blockID) 29 } else { 30 if ret.Get(0) != nil { 31 r0 = ret.Get(0).([]byte) 32 } 33 } 34 35 if rf, ok := ret.Get(1).(func(context.Context, []byte, [][]byte, flow.Identifier) error); ok { 36 r1 = rf(ctx, script, arguments, blockID) 37 } else { 38 r1 = ret.Error(1) 39 } 40 41 return r0, r1 42 } 43 44 // GetAccount provides a mock function with given fields: ctx, address, blockID 45 func (_m *ScriptExecutor) GetAccount(ctx context.Context, address flow.Address, blockID flow.Identifier) (*flow.Account, error) { 46 ret := _m.Called(ctx, address, blockID) 47 48 var r0 *flow.Account 49 var r1 error 50 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, flow.Identifier) (*flow.Account, error)); ok { 51 return rf(ctx, address, blockID) 52 } 53 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, flow.Identifier) *flow.Account); ok { 54 r0 = rf(ctx, address, blockID) 55 } else { 56 if ret.Get(0) != nil { 57 r0 = ret.Get(0).(*flow.Account) 58 } 59 } 60 61 if rf, ok := ret.Get(1).(func(context.Context, flow.Address, flow.Identifier) error); ok { 62 r1 = rf(ctx, address, blockID) 63 } else { 64 r1 = ret.Error(1) 65 } 66 67 return r0, r1 68 } 69 70 // GetRegisterAtBlockID provides a mock function with given fields: ctx, owner, key, blockID 71 func (_m *ScriptExecutor) GetRegisterAtBlockID(ctx context.Context, owner []byte, key []byte, blockID flow.Identifier) ([]byte, error) { 72 ret := _m.Called(ctx, owner, key, blockID) 73 74 var r0 []byte 75 var r1 error 76 if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte, flow.Identifier) ([]byte, error)); ok { 77 return rf(ctx, owner, key, blockID) 78 } 79 if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte, flow.Identifier) []byte); ok { 80 r0 = rf(ctx, owner, key, blockID) 81 } else { 82 if ret.Get(0) != nil { 83 r0 = ret.Get(0).([]byte) 84 } 85 } 86 87 if rf, ok := ret.Get(1).(func(context.Context, []byte, []byte, flow.Identifier) error); ok { 88 r1 = rf(ctx, owner, key, blockID) 89 } else { 90 r1 = ret.Error(1) 91 } 92 93 return r0, r1 94 } 95 96 type mockConstructorTestingTNewScriptExecutor interface { 97 mock.TestingT 98 Cleanup(func()) 99 } 100 101 // NewScriptExecutor creates a new instance of ScriptExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 102 func NewScriptExecutor(t mockConstructorTestingTNewScriptExecutor) *ScriptExecutor { 103 mock := &ScriptExecutor{} 104 mock.Mock.Test(t) 105 106 t.Cleanup(func() { mock.AssertExpectations(t) }) 107 108 return mock 109 }