github.com/onflow/flow-go@v0.33.17/consensus/hotstuff/mocks/timeout_collectors.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 hotstuff "github.com/onflow/flow-go/consensus/hotstuff" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // TimeoutCollectors is an autogenerated mock type for the TimeoutCollectors type 11 type TimeoutCollectors struct { 12 mock.Mock 13 } 14 15 // GetOrCreateCollector provides a mock function with given fields: view 16 func (_m *TimeoutCollectors) GetOrCreateCollector(view uint64) (hotstuff.TimeoutCollector, bool, error) { 17 ret := _m.Called(view) 18 19 var r0 hotstuff.TimeoutCollector 20 var r1 bool 21 var r2 error 22 if rf, ok := ret.Get(0).(func(uint64) (hotstuff.TimeoutCollector, bool, error)); ok { 23 return rf(view) 24 } 25 if rf, ok := ret.Get(0).(func(uint64) hotstuff.TimeoutCollector); ok { 26 r0 = rf(view) 27 } else { 28 if ret.Get(0) != nil { 29 r0 = ret.Get(0).(hotstuff.TimeoutCollector) 30 } 31 } 32 33 if rf, ok := ret.Get(1).(func(uint64) bool); ok { 34 r1 = rf(view) 35 } else { 36 r1 = ret.Get(1).(bool) 37 } 38 39 if rf, ok := ret.Get(2).(func(uint64) error); ok { 40 r2 = rf(view) 41 } else { 42 r2 = ret.Error(2) 43 } 44 45 return r0, r1, r2 46 } 47 48 // PruneUpToView provides a mock function with given fields: lowestRetainedView 49 func (_m *TimeoutCollectors) PruneUpToView(lowestRetainedView uint64) { 50 _m.Called(lowestRetainedView) 51 } 52 53 type mockConstructorTestingTNewTimeoutCollectors interface { 54 mock.TestingT 55 Cleanup(func()) 56 } 57 58 // NewTimeoutCollectors creates a new instance of TimeoutCollectors. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 59 func NewTimeoutCollectors(t mockConstructorTestingTNewTimeoutCollectors) *TimeoutCollectors { 60 mock := &TimeoutCollectors{} 61 mock.Mock.Test(t) 62 63 t.Cleanup(func() { mock.AssertExpectations(t) }) 64 65 return mock 66 }