github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/pace_maker.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 flow "github.com/onflow/flow-go/model/flow" 9 10 mock "github.com/stretchr/testify/mock" 11 12 model "github.com/onflow/flow-go/consensus/hotstuff/model" 13 14 time "time" 15 ) 16 17 // PaceMaker is an autogenerated mock type for the PaceMaker type 18 type PaceMaker struct { 19 mock.Mock 20 } 21 22 // CurView provides a mock function with given fields: 23 func (_m *PaceMaker) CurView() uint64 { 24 ret := _m.Called() 25 26 var r0 uint64 27 if rf, ok := ret.Get(0).(func() uint64); ok { 28 r0 = rf() 29 } else { 30 r0 = ret.Get(0).(uint64) 31 } 32 33 return r0 34 } 35 36 // LastViewTC provides a mock function with given fields: 37 func (_m *PaceMaker) LastViewTC() *flow.TimeoutCertificate { 38 ret := _m.Called() 39 40 var r0 *flow.TimeoutCertificate 41 if rf, ok := ret.Get(0).(func() *flow.TimeoutCertificate); ok { 42 r0 = rf() 43 } else { 44 if ret.Get(0) != nil { 45 r0 = ret.Get(0).(*flow.TimeoutCertificate) 46 } 47 } 48 49 return r0 50 } 51 52 // NewestQC provides a mock function with given fields: 53 func (_m *PaceMaker) NewestQC() *flow.QuorumCertificate { 54 ret := _m.Called() 55 56 var r0 *flow.QuorumCertificate 57 if rf, ok := ret.Get(0).(func() *flow.QuorumCertificate); ok { 58 r0 = rf() 59 } else { 60 if ret.Get(0) != nil { 61 r0 = ret.Get(0).(*flow.QuorumCertificate) 62 } 63 } 64 65 return r0 66 } 67 68 // ProcessQC provides a mock function with given fields: qc 69 func (_m *PaceMaker) ProcessQC(qc *flow.QuorumCertificate) (*model.NewViewEvent, error) { 70 ret := _m.Called(qc) 71 72 var r0 *model.NewViewEvent 73 var r1 error 74 if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) (*model.NewViewEvent, error)); ok { 75 return rf(qc) 76 } 77 if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) *model.NewViewEvent); ok { 78 r0 = rf(qc) 79 } else { 80 if ret.Get(0) != nil { 81 r0 = ret.Get(0).(*model.NewViewEvent) 82 } 83 } 84 85 if rf, ok := ret.Get(1).(func(*flow.QuorumCertificate) error); ok { 86 r1 = rf(qc) 87 } else { 88 r1 = ret.Error(1) 89 } 90 91 return r0, r1 92 } 93 94 // ProcessTC provides a mock function with given fields: tc 95 func (_m *PaceMaker) ProcessTC(tc *flow.TimeoutCertificate) (*model.NewViewEvent, error) { 96 ret := _m.Called(tc) 97 98 var r0 *model.NewViewEvent 99 var r1 error 100 if rf, ok := ret.Get(0).(func(*flow.TimeoutCertificate) (*model.NewViewEvent, error)); ok { 101 return rf(tc) 102 } 103 if rf, ok := ret.Get(0).(func(*flow.TimeoutCertificate) *model.NewViewEvent); ok { 104 r0 = rf(tc) 105 } else { 106 if ret.Get(0) != nil { 107 r0 = ret.Get(0).(*model.NewViewEvent) 108 } 109 } 110 111 if rf, ok := ret.Get(1).(func(*flow.TimeoutCertificate) error); ok { 112 r1 = rf(tc) 113 } else { 114 r1 = ret.Error(1) 115 } 116 117 return r0, r1 118 } 119 120 // Start provides a mock function with given fields: ctx 121 func (_m *PaceMaker) Start(ctx context.Context) { 122 _m.Called(ctx) 123 } 124 125 // TargetPublicationTime provides a mock function with given fields: proposalView, timeViewEntered, parentBlockId 126 func (_m *PaceMaker) TargetPublicationTime(proposalView uint64, timeViewEntered time.Time, parentBlockId flow.Identifier) time.Time { 127 ret := _m.Called(proposalView, timeViewEntered, parentBlockId) 128 129 var r0 time.Time 130 if rf, ok := ret.Get(0).(func(uint64, time.Time, flow.Identifier) time.Time); ok { 131 r0 = rf(proposalView, timeViewEntered, parentBlockId) 132 } else { 133 r0 = ret.Get(0).(time.Time) 134 } 135 136 return r0 137 } 138 139 // TimeoutChannel provides a mock function with given fields: 140 func (_m *PaceMaker) TimeoutChannel() <-chan time.Time { 141 ret := _m.Called() 142 143 var r0 <-chan time.Time 144 if rf, ok := ret.Get(0).(func() <-chan time.Time); ok { 145 r0 = rf() 146 } else { 147 if ret.Get(0) != nil { 148 r0 = ret.Get(0).(<-chan time.Time) 149 } 150 } 151 152 return r0 153 } 154 155 type mockConstructorTestingTNewPaceMaker interface { 156 mock.TestingT 157 Cleanup(func()) 158 } 159 160 // NewPaceMaker creates a new instance of PaceMaker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 161 func NewPaceMaker(t mockConstructorTestingTNewPaceMaker) *PaceMaker { 162 mock := &PaceMaker{} 163 mock.Mock.Test(t) 164 165 t.Cleanup(func() { mock.AssertExpectations(t) }) 166 167 return mock 168 }