github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/collection/epochmgr/mock/epoch_components_factory.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 component "github.com/onflow/flow-go/module/component" 7 cluster "github.com/onflow/flow-go/state/cluster" 8 9 hotstuff "github.com/onflow/flow-go/consensus/hotstuff" 10 11 mock "github.com/stretchr/testify/mock" 12 13 module "github.com/onflow/flow-go/module" 14 15 protocol "github.com/onflow/flow-go/state/protocol" 16 ) 17 18 // EpochComponentsFactory is an autogenerated mock type for the EpochComponentsFactory type 19 type EpochComponentsFactory struct { 20 mock.Mock 21 } 22 23 // Create provides a mock function with given fields: epoch 24 func (_m *EpochComponentsFactory) Create(epoch protocol.Epoch) (cluster.State, component.Component, module.ReadyDoneAware, module.HotStuff, hotstuff.VoteAggregator, hotstuff.TimeoutAggregator, component.Component, error) { 25 ret := _m.Called(epoch) 26 27 var r0 cluster.State 28 var r1 component.Component 29 var r2 module.ReadyDoneAware 30 var r3 module.HotStuff 31 var r4 hotstuff.VoteAggregator 32 var r5 hotstuff.TimeoutAggregator 33 var r6 component.Component 34 var r7 error 35 if rf, ok := ret.Get(0).(func(protocol.Epoch) (cluster.State, component.Component, module.ReadyDoneAware, module.HotStuff, hotstuff.VoteAggregator, hotstuff.TimeoutAggregator, component.Component, error)); ok { 36 return rf(epoch) 37 } 38 if rf, ok := ret.Get(0).(func(protocol.Epoch) cluster.State); ok { 39 r0 = rf(epoch) 40 } else { 41 if ret.Get(0) != nil { 42 r0 = ret.Get(0).(cluster.State) 43 } 44 } 45 46 if rf, ok := ret.Get(1).(func(protocol.Epoch) component.Component); ok { 47 r1 = rf(epoch) 48 } else { 49 if ret.Get(1) != nil { 50 r1 = ret.Get(1).(component.Component) 51 } 52 } 53 54 if rf, ok := ret.Get(2).(func(protocol.Epoch) module.ReadyDoneAware); ok { 55 r2 = rf(epoch) 56 } else { 57 if ret.Get(2) != nil { 58 r2 = ret.Get(2).(module.ReadyDoneAware) 59 } 60 } 61 62 if rf, ok := ret.Get(3).(func(protocol.Epoch) module.HotStuff); ok { 63 r3 = rf(epoch) 64 } else { 65 if ret.Get(3) != nil { 66 r3 = ret.Get(3).(module.HotStuff) 67 } 68 } 69 70 if rf, ok := ret.Get(4).(func(protocol.Epoch) hotstuff.VoteAggregator); ok { 71 r4 = rf(epoch) 72 } else { 73 if ret.Get(4) != nil { 74 r4 = ret.Get(4).(hotstuff.VoteAggregator) 75 } 76 } 77 78 if rf, ok := ret.Get(5).(func(protocol.Epoch) hotstuff.TimeoutAggregator); ok { 79 r5 = rf(epoch) 80 } else { 81 if ret.Get(5) != nil { 82 r5 = ret.Get(5).(hotstuff.TimeoutAggregator) 83 } 84 } 85 86 if rf, ok := ret.Get(6).(func(protocol.Epoch) component.Component); ok { 87 r6 = rf(epoch) 88 } else { 89 if ret.Get(6) != nil { 90 r6 = ret.Get(6).(component.Component) 91 } 92 } 93 94 if rf, ok := ret.Get(7).(func(protocol.Epoch) error); ok { 95 r7 = rf(epoch) 96 } else { 97 r7 = ret.Error(7) 98 } 99 100 return r0, r1, r2, r3, r4, r5, r6, r7 101 } 102 103 type mockConstructorTestingTNewEpochComponentsFactory interface { 104 mock.TestingT 105 Cleanup(func()) 106 } 107 108 // NewEpochComponentsFactory creates a new instance of EpochComponentsFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 109 func NewEpochComponentsFactory(t mockConstructorTestingTNewEpochComponentsFactory) *EpochComponentsFactory { 110 mock := &EpochComponentsFactory{} 111 mock.Mock.Test(t) 112 113 t.Cleanup(func() { mock.AssertExpectations(t) }) 114 115 return mock 116 }