github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/mock/snapshot.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 protocol "github.com/onflow/flow-go/state/protocol" 10 ) 11 12 // Snapshot is an autogenerated mock type for the Snapshot type 13 type Snapshot struct { 14 mock.Mock 15 } 16 17 // Commit provides a mock function with given fields: 18 func (_m *Snapshot) Commit() (flow.StateCommitment, error) { 19 ret := _m.Called() 20 21 var r0 flow.StateCommitment 22 var r1 error 23 if rf, ok := ret.Get(0).(func() (flow.StateCommitment, error)); ok { 24 return rf() 25 } 26 if rf, ok := ret.Get(0).(func() flow.StateCommitment); ok { 27 r0 = rf() 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(flow.StateCommitment) 31 } 32 } 33 34 if rf, ok := ret.Get(1).(func() error); ok { 35 r1 = rf() 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 // Descendants provides a mock function with given fields: 44 func (_m *Snapshot) Descendants() ([]flow.Identifier, error) { 45 ret := _m.Called() 46 47 var r0 []flow.Identifier 48 var r1 error 49 if rf, ok := ret.Get(0).(func() ([]flow.Identifier, error)); ok { 50 return rf() 51 } 52 if rf, ok := ret.Get(0).(func() []flow.Identifier); ok { 53 r0 = rf() 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).([]flow.Identifier) 57 } 58 } 59 60 if rf, ok := ret.Get(1).(func() error); ok { 61 r1 = rf() 62 } else { 63 r1 = ret.Error(1) 64 } 65 66 return r0, r1 67 } 68 69 // EpochProtocolState provides a mock function with given fields: 70 func (_m *Snapshot) EpochProtocolState() (protocol.DynamicProtocolState, error) { 71 ret := _m.Called() 72 73 var r0 protocol.DynamicProtocolState 74 var r1 error 75 if rf, ok := ret.Get(0).(func() (protocol.DynamicProtocolState, error)); ok { 76 return rf() 77 } 78 if rf, ok := ret.Get(0).(func() protocol.DynamicProtocolState); ok { 79 r0 = rf() 80 } else { 81 if ret.Get(0) != nil { 82 r0 = ret.Get(0).(protocol.DynamicProtocolState) 83 } 84 } 85 86 if rf, ok := ret.Get(1).(func() error); ok { 87 r1 = rf() 88 } else { 89 r1 = ret.Error(1) 90 } 91 92 return r0, r1 93 } 94 95 // Epochs provides a mock function with given fields: 96 func (_m *Snapshot) Epochs() protocol.EpochQuery { 97 ret := _m.Called() 98 99 var r0 protocol.EpochQuery 100 if rf, ok := ret.Get(0).(func() protocol.EpochQuery); ok { 101 r0 = rf() 102 } else { 103 if ret.Get(0) != nil { 104 r0 = ret.Get(0).(protocol.EpochQuery) 105 } 106 } 107 108 return r0 109 } 110 111 // Head provides a mock function with given fields: 112 func (_m *Snapshot) Head() (*flow.Header, error) { 113 ret := _m.Called() 114 115 var r0 *flow.Header 116 var r1 error 117 if rf, ok := ret.Get(0).(func() (*flow.Header, error)); ok { 118 return rf() 119 } 120 if rf, ok := ret.Get(0).(func() *flow.Header); ok { 121 r0 = rf() 122 } else { 123 if ret.Get(0) != nil { 124 r0 = ret.Get(0).(*flow.Header) 125 } 126 } 127 128 if rf, ok := ret.Get(1).(func() error); ok { 129 r1 = rf() 130 } else { 131 r1 = ret.Error(1) 132 } 133 134 return r0, r1 135 } 136 137 // Identities provides a mock function with given fields: selector 138 func (_m *Snapshot) Identities(selector flow.IdentityFilter[flow.Identity]) (flow.GenericIdentityList[flow.Identity], error) { 139 ret := _m.Called(selector) 140 141 var r0 flow.GenericIdentityList[flow.Identity] 142 var r1 error 143 if rf, ok := ret.Get(0).(func(flow.IdentityFilter[flow.Identity]) (flow.GenericIdentityList[flow.Identity], error)); ok { 144 return rf(selector) 145 } 146 if rf, ok := ret.Get(0).(func(flow.IdentityFilter[flow.Identity]) flow.GenericIdentityList[flow.Identity]); ok { 147 r0 = rf(selector) 148 } else { 149 if ret.Get(0) != nil { 150 r0 = ret.Get(0).(flow.GenericIdentityList[flow.Identity]) 151 } 152 } 153 154 if rf, ok := ret.Get(1).(func(flow.IdentityFilter[flow.Identity]) error); ok { 155 r1 = rf(selector) 156 } else { 157 r1 = ret.Error(1) 158 } 159 160 return r0, r1 161 } 162 163 // Identity provides a mock function with given fields: nodeID 164 func (_m *Snapshot) Identity(nodeID flow.Identifier) (*flow.Identity, error) { 165 ret := _m.Called(nodeID) 166 167 var r0 *flow.Identity 168 var r1 error 169 if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.Identity, error)); ok { 170 return rf(nodeID) 171 } 172 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Identity); ok { 173 r0 = rf(nodeID) 174 } else { 175 if ret.Get(0) != nil { 176 r0 = ret.Get(0).(*flow.Identity) 177 } 178 } 179 180 if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok { 181 r1 = rf(nodeID) 182 } else { 183 r1 = ret.Error(1) 184 } 185 186 return r0, r1 187 } 188 189 // Params provides a mock function with given fields: 190 func (_m *Snapshot) Params() protocol.GlobalParams { 191 ret := _m.Called() 192 193 var r0 protocol.GlobalParams 194 if rf, ok := ret.Get(0).(func() protocol.GlobalParams); ok { 195 r0 = rf() 196 } else { 197 if ret.Get(0) != nil { 198 r0 = ret.Get(0).(protocol.GlobalParams) 199 } 200 } 201 202 return r0 203 } 204 205 // Phase provides a mock function with given fields: 206 func (_m *Snapshot) Phase() (flow.EpochPhase, error) { 207 ret := _m.Called() 208 209 var r0 flow.EpochPhase 210 var r1 error 211 if rf, ok := ret.Get(0).(func() (flow.EpochPhase, error)); ok { 212 return rf() 213 } 214 if rf, ok := ret.Get(0).(func() flow.EpochPhase); ok { 215 r0 = rf() 216 } else { 217 r0 = ret.Get(0).(flow.EpochPhase) 218 } 219 220 if rf, ok := ret.Get(1).(func() error); ok { 221 r1 = rf() 222 } else { 223 r1 = ret.Error(1) 224 } 225 226 return r0, r1 227 } 228 229 // ProtocolState provides a mock function with given fields: 230 func (_m *Snapshot) ProtocolState() (protocol.KVStoreReader, error) { 231 ret := _m.Called() 232 233 var r0 protocol.KVStoreReader 234 var r1 error 235 if rf, ok := ret.Get(0).(func() (protocol.KVStoreReader, error)); ok { 236 return rf() 237 } 238 if rf, ok := ret.Get(0).(func() protocol.KVStoreReader); ok { 239 r0 = rf() 240 } else { 241 if ret.Get(0) != nil { 242 r0 = ret.Get(0).(protocol.KVStoreReader) 243 } 244 } 245 246 if rf, ok := ret.Get(1).(func() error); ok { 247 r1 = rf() 248 } else { 249 r1 = ret.Error(1) 250 } 251 252 return r0, r1 253 } 254 255 // QuorumCertificate provides a mock function with given fields: 256 func (_m *Snapshot) QuorumCertificate() (*flow.QuorumCertificate, error) { 257 ret := _m.Called() 258 259 var r0 *flow.QuorumCertificate 260 var r1 error 261 if rf, ok := ret.Get(0).(func() (*flow.QuorumCertificate, error)); ok { 262 return rf() 263 } 264 if rf, ok := ret.Get(0).(func() *flow.QuorumCertificate); ok { 265 r0 = rf() 266 } else { 267 if ret.Get(0) != nil { 268 r0 = ret.Get(0).(*flow.QuorumCertificate) 269 } 270 } 271 272 if rf, ok := ret.Get(1).(func() error); ok { 273 r1 = rf() 274 } else { 275 r1 = ret.Error(1) 276 } 277 278 return r0, r1 279 } 280 281 // RandomSource provides a mock function with given fields: 282 func (_m *Snapshot) RandomSource() ([]byte, error) { 283 ret := _m.Called() 284 285 var r0 []byte 286 var r1 error 287 if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { 288 return rf() 289 } 290 if rf, ok := ret.Get(0).(func() []byte); ok { 291 r0 = rf() 292 } else { 293 if ret.Get(0) != nil { 294 r0 = ret.Get(0).([]byte) 295 } 296 } 297 298 if rf, ok := ret.Get(1).(func() error); ok { 299 r1 = rf() 300 } else { 301 r1 = ret.Error(1) 302 } 303 304 return r0, r1 305 } 306 307 // SealedResult provides a mock function with given fields: 308 func (_m *Snapshot) SealedResult() (*flow.ExecutionResult, *flow.Seal, error) { 309 ret := _m.Called() 310 311 var r0 *flow.ExecutionResult 312 var r1 *flow.Seal 313 var r2 error 314 if rf, ok := ret.Get(0).(func() (*flow.ExecutionResult, *flow.Seal, error)); ok { 315 return rf() 316 } 317 if rf, ok := ret.Get(0).(func() *flow.ExecutionResult); ok { 318 r0 = rf() 319 } else { 320 if ret.Get(0) != nil { 321 r0 = ret.Get(0).(*flow.ExecutionResult) 322 } 323 } 324 325 if rf, ok := ret.Get(1).(func() *flow.Seal); ok { 326 r1 = rf() 327 } else { 328 if ret.Get(1) != nil { 329 r1 = ret.Get(1).(*flow.Seal) 330 } 331 } 332 333 if rf, ok := ret.Get(2).(func() error); ok { 334 r2 = rf() 335 } else { 336 r2 = ret.Error(2) 337 } 338 339 return r0, r1, r2 340 } 341 342 // SealingSegment provides a mock function with given fields: 343 func (_m *Snapshot) SealingSegment() (*flow.SealingSegment, error) { 344 ret := _m.Called() 345 346 var r0 *flow.SealingSegment 347 var r1 error 348 if rf, ok := ret.Get(0).(func() (*flow.SealingSegment, error)); ok { 349 return rf() 350 } 351 if rf, ok := ret.Get(0).(func() *flow.SealingSegment); ok { 352 r0 = rf() 353 } else { 354 if ret.Get(0) != nil { 355 r0 = ret.Get(0).(*flow.SealingSegment) 356 } 357 } 358 359 if rf, ok := ret.Get(1).(func() error); ok { 360 r1 = rf() 361 } else { 362 r1 = ret.Error(1) 363 } 364 365 return r0, r1 366 } 367 368 // VersionBeacon provides a mock function with given fields: 369 func (_m *Snapshot) VersionBeacon() (*flow.SealedVersionBeacon, error) { 370 ret := _m.Called() 371 372 var r0 *flow.SealedVersionBeacon 373 var r1 error 374 if rf, ok := ret.Get(0).(func() (*flow.SealedVersionBeacon, error)); ok { 375 return rf() 376 } 377 if rf, ok := ret.Get(0).(func() *flow.SealedVersionBeacon); ok { 378 r0 = rf() 379 } else { 380 if ret.Get(0) != nil { 381 r0 = ret.Get(0).(*flow.SealedVersionBeacon) 382 } 383 } 384 385 if rf, ok := ret.Get(1).(func() error); ok { 386 r1 = rf() 387 } else { 388 r1 = ret.Error(1) 389 } 390 391 return r0, r1 392 } 393 394 type mockConstructorTestingTNewSnapshot interface { 395 mock.TestingT 396 Cleanup(func()) 397 } 398 399 // NewSnapshot creates a new instance of Snapshot. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 400 func NewSnapshot(t mockConstructorTestingTNewSnapshot) *Snapshot { 401 mock := &Snapshot{} 402 mock.Mock.Test(t) 403 404 t.Cleanup(func() { mock.AssertExpectations(t) }) 405 406 return mock 407 }