github.com/koko1123/flow-go-1@v0.29.6/engine/execution/state/mock/read_only_execution_state.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 delta "github.com/koko1123/flow-go-1/engine/execution/state/delta" 9 flow "github.com/koko1123/flow-go-1/model/flow" 10 11 messages "github.com/koko1123/flow-go-1/model/messages" 12 13 mock "github.com/stretchr/testify/mock" 14 ) 15 16 // ReadOnlyExecutionState is an autogenerated mock type for the ReadOnlyExecutionState type 17 type ReadOnlyExecutionState struct { 18 mock.Mock 19 } 20 21 // ChunkDataPackByChunkID provides a mock function with given fields: _a0 22 func (_m *ReadOnlyExecutionState) ChunkDataPackByChunkID(_a0 flow.Identifier) (*flow.ChunkDataPack, error) { 23 ret := _m.Called(_a0) 24 25 var r0 *flow.ChunkDataPack 26 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.ChunkDataPack); ok { 27 r0 = rf(_a0) 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(*flow.ChunkDataPack) 31 } 32 } 33 34 var r1 error 35 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 36 r1 = rf(_a0) 37 } else { 38 r1 = ret.Error(1) 39 } 40 41 return r0, r1 42 } 43 44 // GetBlockIDByChunkID provides a mock function with given fields: chunkID 45 func (_m *ReadOnlyExecutionState) GetBlockIDByChunkID(chunkID flow.Identifier) (flow.Identifier, error) { 46 ret := _m.Called(chunkID) 47 48 var r0 flow.Identifier 49 if rf, ok := ret.Get(0).(func(flow.Identifier) flow.Identifier); ok { 50 r0 = rf(chunkID) 51 } else { 52 if ret.Get(0) != nil { 53 r0 = ret.Get(0).(flow.Identifier) 54 } 55 } 56 57 var r1 error 58 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 59 r1 = rf(chunkID) 60 } else { 61 r1 = ret.Error(1) 62 } 63 64 return r0, r1 65 } 66 67 // GetCollection provides a mock function with given fields: identifier 68 func (_m *ReadOnlyExecutionState) GetCollection(identifier flow.Identifier) (*flow.Collection, error) { 69 ret := _m.Called(identifier) 70 71 var r0 *flow.Collection 72 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Collection); ok { 73 r0 = rf(identifier) 74 } else { 75 if ret.Get(0) != nil { 76 r0 = ret.Get(0).(*flow.Collection) 77 } 78 } 79 80 var r1 error 81 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 82 r1 = rf(identifier) 83 } else { 84 r1 = ret.Error(1) 85 } 86 87 return r0, r1 88 } 89 90 // GetExecutionResultID provides a mock function with given fields: _a0, _a1 91 func (_m *ReadOnlyExecutionState) GetExecutionResultID(_a0 context.Context, _a1 flow.Identifier) (flow.Identifier, error) { 92 ret := _m.Called(_a0, _a1) 93 94 var r0 flow.Identifier 95 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) flow.Identifier); ok { 96 r0 = rf(_a0, _a1) 97 } else { 98 if ret.Get(0) != nil { 99 r0 = ret.Get(0).(flow.Identifier) 100 } 101 } 102 103 var r1 error 104 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 105 r1 = rf(_a0, _a1) 106 } else { 107 r1 = ret.Error(1) 108 } 109 110 return r0, r1 111 } 112 113 // GetHighestExecutedBlockID provides a mock function with given fields: _a0 114 func (_m *ReadOnlyExecutionState) GetHighestExecutedBlockID(_a0 context.Context) (uint64, flow.Identifier, error) { 115 ret := _m.Called(_a0) 116 117 var r0 uint64 118 if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { 119 r0 = rf(_a0) 120 } else { 121 r0 = ret.Get(0).(uint64) 122 } 123 124 var r1 flow.Identifier 125 if rf, ok := ret.Get(1).(func(context.Context) flow.Identifier); ok { 126 r1 = rf(_a0) 127 } else { 128 if ret.Get(1) != nil { 129 r1 = ret.Get(1).(flow.Identifier) 130 } 131 } 132 133 var r2 error 134 if rf, ok := ret.Get(2).(func(context.Context) error); ok { 135 r2 = rf(_a0) 136 } else { 137 r2 = ret.Error(2) 138 } 139 140 return r0, r1, r2 141 } 142 143 // GetProof provides a mock function with given fields: _a0, _a1, _a2 144 func (_m *ReadOnlyExecutionState) GetProof(_a0 context.Context, _a1 flow.StateCommitment, _a2 []flow.RegisterID) ([]byte, error) { 145 ret := _m.Called(_a0, _a1, _a2) 146 147 var r0 []byte 148 if rf, ok := ret.Get(0).(func(context.Context, flow.StateCommitment, []flow.RegisterID) []byte); ok { 149 r0 = rf(_a0, _a1, _a2) 150 } else { 151 if ret.Get(0) != nil { 152 r0 = ret.Get(0).([]byte) 153 } 154 } 155 156 var r1 error 157 if rf, ok := ret.Get(1).(func(context.Context, flow.StateCommitment, []flow.RegisterID) error); ok { 158 r1 = rf(_a0, _a1, _a2) 159 } else { 160 r1 = ret.Error(1) 161 } 162 163 return r0, r1 164 } 165 166 // GetRegisters provides a mock function with given fields: _a0, _a1, _a2 167 func (_m *ReadOnlyExecutionState) GetRegisters(_a0 context.Context, _a1 flow.StateCommitment, _a2 []flow.RegisterID) ([][]byte, error) { 168 ret := _m.Called(_a0, _a1, _a2) 169 170 var r0 [][]byte 171 if rf, ok := ret.Get(0).(func(context.Context, flow.StateCommitment, []flow.RegisterID) [][]byte); ok { 172 r0 = rf(_a0, _a1, _a2) 173 } else { 174 if ret.Get(0) != nil { 175 r0 = ret.Get(0).([][]byte) 176 } 177 } 178 179 var r1 error 180 if rf, ok := ret.Get(1).(func(context.Context, flow.StateCommitment, []flow.RegisterID) error); ok { 181 r1 = rf(_a0, _a1, _a2) 182 } else { 183 r1 = ret.Error(1) 184 } 185 186 return r0, r1 187 } 188 189 // HasState provides a mock function with given fields: _a0 190 func (_m *ReadOnlyExecutionState) HasState(_a0 flow.StateCommitment) bool { 191 ret := _m.Called(_a0) 192 193 var r0 bool 194 if rf, ok := ret.Get(0).(func(flow.StateCommitment) bool); ok { 195 r0 = rf(_a0) 196 } else { 197 r0 = ret.Get(0).(bool) 198 } 199 200 return r0 201 } 202 203 // NewView provides a mock function with given fields: _a0 204 func (_m *ReadOnlyExecutionState) NewView(_a0 flow.StateCommitment) *delta.View { 205 ret := _m.Called(_a0) 206 207 var r0 *delta.View 208 if rf, ok := ret.Get(0).(func(flow.StateCommitment) *delta.View); ok { 209 r0 = rf(_a0) 210 } else { 211 if ret.Get(0) != nil { 212 r0 = ret.Get(0).(*delta.View) 213 } 214 } 215 216 return r0 217 } 218 219 // RetrieveStateDelta provides a mock function with given fields: _a0, _a1 220 func (_m *ReadOnlyExecutionState) RetrieveStateDelta(_a0 context.Context, _a1 flow.Identifier) (*messages.ExecutionStateDelta, error) { 221 ret := _m.Called(_a0, _a1) 222 223 var r0 *messages.ExecutionStateDelta 224 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) *messages.ExecutionStateDelta); ok { 225 r0 = rf(_a0, _a1) 226 } else { 227 if ret.Get(0) != nil { 228 r0 = ret.Get(0).(*messages.ExecutionStateDelta) 229 } 230 } 231 232 var r1 error 233 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 234 r1 = rf(_a0, _a1) 235 } else { 236 r1 = ret.Error(1) 237 } 238 239 return r0, r1 240 } 241 242 // StateCommitmentByBlockID provides a mock function with given fields: _a0, _a1 243 func (_m *ReadOnlyExecutionState) StateCommitmentByBlockID(_a0 context.Context, _a1 flow.Identifier) (flow.StateCommitment, error) { 244 ret := _m.Called(_a0, _a1) 245 246 var r0 flow.StateCommitment 247 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier) flow.StateCommitment); ok { 248 r0 = rf(_a0, _a1) 249 } else { 250 if ret.Get(0) != nil { 251 r0 = ret.Get(0).(flow.StateCommitment) 252 } 253 } 254 255 var r1 error 256 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier) error); ok { 257 r1 = rf(_a0, _a1) 258 } else { 259 r1 = ret.Error(1) 260 } 261 262 return r0, r1 263 } 264 265 type mockConstructorTestingTNewReadOnlyExecutionState interface { 266 mock.TestingT 267 Cleanup(func()) 268 } 269 270 // 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. 271 func NewReadOnlyExecutionState(t mockConstructorTestingTNewReadOnlyExecutionState) *ReadOnlyExecutionState { 272 mock := &ReadOnlyExecutionState{} 273 mock.Mock.Test(t) 274 275 t.Cleanup(func() { mock.AssertExpectations(t) }) 276 277 return mock 278 }