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