github.com/onflow/flow-go@v0.33.17/engine/execution/state/mock/script_execution_state.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 flow "github.com/onflow/flow-go/model/flow" 7 mock "github.com/stretchr/testify/mock" 8 9 snapshot "github.com/onflow/flow-go/fvm/storage/snapshot" 10 ) 11 12 // ScriptExecutionState is an autogenerated mock type for the ScriptExecutionState type 13 type ScriptExecutionState struct { 14 mock.Mock 15 } 16 17 // CreateStorageSnapshot provides a mock function with given fields: blockID 18 func (_m *ScriptExecutionState) CreateStorageSnapshot(blockID flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error) { 19 ret := _m.Called(blockID) 20 21 var r0 snapshot.StorageSnapshot 22 var r1 *flow.Header 23 var r2 error 24 if rf, ok := ret.Get(0).(func(flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error)); ok { 25 return rf(blockID) 26 } 27 if rf, ok := ret.Get(0).(func(flow.Identifier) snapshot.StorageSnapshot); ok { 28 r0 = rf(blockID) 29 } else { 30 if ret.Get(0) != nil { 31 r0 = ret.Get(0).(snapshot.StorageSnapshot) 32 } 33 } 34 35 if rf, ok := ret.Get(1).(func(flow.Identifier) *flow.Header); ok { 36 r1 = rf(blockID) 37 } else { 38 if ret.Get(1) != nil { 39 r1 = ret.Get(1).(*flow.Header) 40 } 41 } 42 43 if rf, ok := ret.Get(2).(func(flow.Identifier) error); ok { 44 r2 = rf(blockID) 45 } else { 46 r2 = ret.Error(2) 47 } 48 49 return r0, r1, r2 50 } 51 52 // IsBlockExecuted provides a mock function with given fields: height, blockID 53 func (_m *ScriptExecutionState) IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error) { 54 ret := _m.Called(height, blockID) 55 56 var r0 bool 57 var r1 error 58 if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (bool, error)); ok { 59 return rf(height, blockID) 60 } 61 if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) bool); ok { 62 r0 = rf(height, blockID) 63 } else { 64 r0 = ret.Get(0).(bool) 65 } 66 67 if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok { 68 r1 = rf(height, blockID) 69 } else { 70 r1 = ret.Error(1) 71 } 72 73 return r0, r1 74 } 75 76 // NewStorageSnapshot provides a mock function with given fields: commit, blockID, height 77 func (_m *ScriptExecutionState) NewStorageSnapshot(commit flow.StateCommitment, blockID flow.Identifier, height uint64) snapshot.StorageSnapshot { 78 ret := _m.Called(commit, blockID, height) 79 80 var r0 snapshot.StorageSnapshot 81 if rf, ok := ret.Get(0).(func(flow.StateCommitment, flow.Identifier, uint64) snapshot.StorageSnapshot); ok { 82 r0 = rf(commit, blockID, height) 83 } else { 84 if ret.Get(0) != nil { 85 r0 = ret.Get(0).(snapshot.StorageSnapshot) 86 } 87 } 88 89 return r0 90 } 91 92 // StateCommitmentByBlockID provides a mock function with given fields: _a0 93 func (_m *ScriptExecutionState) StateCommitmentByBlockID(_a0 flow.Identifier) (flow.StateCommitment, error) { 94 ret := _m.Called(_a0) 95 96 var r0 flow.StateCommitment 97 var r1 error 98 if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.StateCommitment, error)); ok { 99 return rf(_a0) 100 } 101 if rf, ok := ret.Get(0).(func(flow.Identifier) flow.StateCommitment); ok { 102 r0 = rf(_a0) 103 } else { 104 if ret.Get(0) != nil { 105 r0 = ret.Get(0).(flow.StateCommitment) 106 } 107 } 108 109 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 110 r1 = rf(_a0) 111 } else { 112 r1 = ret.Error(1) 113 } 114 115 return r0, r1 116 } 117 118 type mockConstructorTestingTNewScriptExecutionState interface { 119 mock.TestingT 120 Cleanup(func()) 121 } 122 123 // NewScriptExecutionState creates a new instance of ScriptExecutionState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 124 func NewScriptExecutionState(t mockConstructorTestingTNewScriptExecutionState) *ScriptExecutionState { 125 mock := &ScriptExecutionState{} 126 mock.Mock.Test(t) 127 128 t.Cleanup(func() { mock.AssertExpectations(t) }) 129 130 return mock 131 }