github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/execution/state/mock/read_only_execution_state.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 mock "github.com/stretchr/testify/mock" 10 11 snapshot "github.com/onflow/flow-go/fvm/storage/snapshot" 12 ) 13 14 // ReadOnlyExecutionState is an autogenerated mock type for the ReadOnlyExecutionState type 15 type ReadOnlyExecutionState struct { 16 mock.Mock 17 } 18 19 // ChunkDataPackByChunkID provides a mock function with given fields: _a0 20 func (_m *ReadOnlyExecutionState) ChunkDataPackByChunkID(_a0 flow.Identifier) (*flow.ChunkDataPack, error) { 21 ret := _m.Called(_a0) 22 23 var r0 *flow.ChunkDataPack 24 var r1 error 25 if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.ChunkDataPack, error)); ok { 26 return rf(_a0) 27 } 28 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.ChunkDataPack); ok { 29 r0 = rf(_a0) 30 } else { 31 if ret.Get(0) != nil { 32 r0 = ret.Get(0).(*flow.ChunkDataPack) 33 } 34 } 35 36 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 37 r1 = rf(_a0) 38 } else { 39 r1 = ret.Error(1) 40 } 41 42 return r0, r1 43 } 44 45 // CreateStorageSnapshot provides a mock function with given fields: blockID 46 func (_m *ReadOnlyExecutionState) CreateStorageSnapshot(blockID flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error) { 47 ret := _m.Called(blockID) 48 49 var r0 snapshot.StorageSnapshot 50 var r1 *flow.Header 51 var r2 error 52 if rf, ok := ret.Get(0).(func(flow.Identifier) (snapshot.StorageSnapshot, *flow.Header, error)); ok { 53 return rf(blockID) 54 } 55 if rf, ok := ret.Get(0).(func(flow.Identifier) snapshot.StorageSnapshot); ok { 56 r0 = rf(blockID) 57 } else { 58 if ret.Get(0) != nil { 59 r0 = ret.Get(0).(snapshot.StorageSnapshot) 60 } 61 } 62 63 if rf, ok := ret.Get(1).(func(flow.Identifier) *flow.Header); ok { 64 r1 = rf(blockID) 65 } else { 66 if ret.Get(1) != nil { 67 r1 = ret.Get(1).(*flow.Header) 68 } 69 } 70 71 if rf, ok := ret.Get(2).(func(flow.Identifier) error); ok { 72 r2 = rf(blockID) 73 } else { 74 r2 = ret.Error(2) 75 } 76 77 return r0, r1, r2 78 } 79 80 // GetExecutionResultID provides a mock function with given fields: _a0, _a1 81 func (_m *ReadOnlyExecutionState) GetExecutionResultID(_a0 context.Context, _a1 flow.Identifier) (flow.Identifier, error) { 82 ret := _m.Called(_a0, _a1) 83 84 var r0 flow.Identifier 85 var r1 error 86 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) (flow.Identifier, error)); ok { 87 return rf(_a0, _a1) 88 } 89 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) flow.Identifier); ok { 90 r0 = rf(_a0, _a1) 91 } else { 92 if ret.Get(0) != nil { 93 r0 = ret.Get(0).(flow.Identifier) 94 } 95 } 96 97 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 98 r1 = rf(_a0, _a1) 99 } else { 100 r1 = ret.Error(1) 101 } 102 103 return r0, r1 104 } 105 106 // GetHighestExecutedBlockID provides a mock function with given fields: _a0 107 func (_m *ReadOnlyExecutionState) GetHighestExecutedBlockID(_a0 context.Context) (uint64, flow.Identifier, error) { 108 ret := _m.Called(_a0) 109 110 var r0 uint64 111 var r1 flow.Identifier 112 var r2 error 113 if rf, ok := ret.Get(0).(func(context.Context) (uint64, flow.Identifier, error)); ok { 114 return rf(_a0) 115 } 116 if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { 117 r0 = rf(_a0) 118 } else { 119 r0 = ret.Get(0).(uint64) 120 } 121 122 if rf, ok := ret.Get(1).(func(context.Context) flow.Identifier); ok { 123 r1 = rf(_a0) 124 } else { 125 if ret.Get(1) != nil { 126 r1 = ret.Get(1).(flow.Identifier) 127 } 128 } 129 130 if rf, ok := ret.Get(2).(func(context.Context) error); ok { 131 r2 = rf(_a0) 132 } else { 133 r2 = ret.Error(2) 134 } 135 136 return r0, r1, r2 137 } 138 139 // IsBlockExecuted provides a mock function with given fields: height, blockID 140 func (_m *ReadOnlyExecutionState) IsBlockExecuted(height uint64, blockID flow.Identifier) (bool, error) { 141 ret := _m.Called(height, blockID) 142 143 var r0 bool 144 var r1 error 145 if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (bool, error)); ok { 146 return rf(height, blockID) 147 } 148 if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) bool); ok { 149 r0 = rf(height, blockID) 150 } else { 151 r0 = ret.Get(0).(bool) 152 } 153 154 if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok { 155 r1 = rf(height, blockID) 156 } else { 157 r1 = ret.Error(1) 158 } 159 160 return r0, r1 161 } 162 163 // NewStorageSnapshot provides a mock function with given fields: commit, blockID, height 164 func (_m *ReadOnlyExecutionState) NewStorageSnapshot(commit flow.StateCommitment, blockID flow.Identifier, height uint64) snapshot.StorageSnapshot { 165 ret := _m.Called(commit, blockID, height) 166 167 var r0 snapshot.StorageSnapshot 168 if rf, ok := ret.Get(0).(func(flow.StateCommitment, flow.Identifier, uint64) snapshot.StorageSnapshot); ok { 169 r0 = rf(commit, blockID, height) 170 } else { 171 if ret.Get(0) != nil { 172 r0 = ret.Get(0).(snapshot.StorageSnapshot) 173 } 174 } 175 176 return r0 177 } 178 179 // StateCommitmentByBlockID provides a mock function with given fields: _a0 180 func (_m *ReadOnlyExecutionState) StateCommitmentByBlockID(_a0 flow.Identifier) (flow.StateCommitment, error) { 181 ret := _m.Called(_a0) 182 183 var r0 flow.StateCommitment 184 var r1 error 185 if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.StateCommitment, error)); ok { 186 return rf(_a0) 187 } 188 if rf, ok := ret.Get(0).(func(flow.Identifier) flow.StateCommitment); ok { 189 r0 = rf(_a0) 190 } else { 191 if ret.Get(0) != nil { 192 r0 = ret.Get(0).(flow.StateCommitment) 193 } 194 } 195 196 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 197 r1 = rf(_a0) 198 } else { 199 r1 = ret.Error(1) 200 } 201 202 return r0, r1 203 } 204 205 type mockConstructorTestingTNewReadOnlyExecutionState interface { 206 mock.TestingT 207 Cleanup(func()) 208 } 209 210 // NewReadOnlyExecutionState creates a new instance of ReadOnlyExecutionState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 211 func NewReadOnlyExecutionState(t mockConstructorTestingTNewReadOnlyExecutionState) *ReadOnlyExecutionState { 212 mock := &ReadOnlyExecutionState{} 213 mock.Mock.Test(t) 214 215 t.Cleanup(func() { mock.AssertExpectations(t) }) 216 217 return mock 218 }