github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/mocks/event_handler.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 flow "github.com/koko1123/flow-go-1/model/flow" 7 8 mock "github.com/stretchr/testify/mock" 9 10 model "github.com/koko1123/flow-go-1/consensus/hotstuff/model" 11 12 time "time" 13 ) 14 15 // EventHandler is an autogenerated mock type for the EventHandler type 16 type EventHandler struct { 17 mock.Mock 18 } 19 20 // OnLocalTimeout provides a mock function with given fields: 21 func (_m *EventHandler) OnLocalTimeout() error { 22 ret := _m.Called() 23 24 var r0 error 25 if rf, ok := ret.Get(0).(func() error); ok { 26 r0 = rf() 27 } else { 28 r0 = ret.Error(0) 29 } 30 31 return r0 32 } 33 34 // OnQCConstructed provides a mock function with given fields: qc 35 func (_m *EventHandler) OnQCConstructed(qc *flow.QuorumCertificate) error { 36 ret := _m.Called(qc) 37 38 var r0 error 39 if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) error); ok { 40 r0 = rf(qc) 41 } else { 42 r0 = ret.Error(0) 43 } 44 45 return r0 46 } 47 48 // OnReceiveProposal provides a mock function with given fields: proposal 49 func (_m *EventHandler) OnReceiveProposal(proposal *model.Proposal) error { 50 ret := _m.Called(proposal) 51 52 var r0 error 53 if rf, ok := ret.Get(0).(func(*model.Proposal) error); ok { 54 r0 = rf(proposal) 55 } else { 56 r0 = ret.Error(0) 57 } 58 59 return r0 60 } 61 62 // Start provides a mock function with given fields: 63 func (_m *EventHandler) Start() error { 64 ret := _m.Called() 65 66 var r0 error 67 if rf, ok := ret.Get(0).(func() error); ok { 68 r0 = rf() 69 } else { 70 r0 = ret.Error(0) 71 } 72 73 return r0 74 } 75 76 // TimeoutChannel provides a mock function with given fields: 77 func (_m *EventHandler) TimeoutChannel() <-chan time.Time { 78 ret := _m.Called() 79 80 var r0 <-chan time.Time 81 if rf, ok := ret.Get(0).(func() <-chan time.Time); ok { 82 r0 = rf() 83 } else { 84 if ret.Get(0) != nil { 85 r0 = ret.Get(0).(<-chan time.Time) 86 } 87 } 88 89 return r0 90 } 91 92 type mockConstructorTestingTNewEventHandler interface { 93 mock.TestingT 94 Cleanup(func()) 95 } 96 97 // NewEventHandler creates a new instance of EventHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 98 func NewEventHandler(t mockConstructorTestingTNewEventHandler) *EventHandler { 99 mock := &EventHandler{} 100 mock.Mock.Test(t) 101 102 t.Cleanup(func() { mock.AssertExpectations(t) }) 103 104 return mock 105 }