github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/safety_rules.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 flow "github.com/onflow/flow-go/model/flow" 7 8 mock "github.com/stretchr/testify/mock" 9 10 model "github.com/onflow/flow-go/consensus/hotstuff/model" 11 ) 12 13 // SafetyRules is an autogenerated mock type for the SafetyRules type 14 type SafetyRules struct { 15 mock.Mock 16 } 17 18 // ProduceTimeout provides a mock function with given fields: curView, newestQC, lastViewTC 19 func (_m *SafetyRules) ProduceTimeout(curView uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate) (*model.TimeoutObject, error) { 20 ret := _m.Called(curView, newestQC, lastViewTC) 21 22 var r0 *model.TimeoutObject 23 var r1 error 24 if rf, ok := ret.Get(0).(func(uint64, *flow.QuorumCertificate, *flow.TimeoutCertificate) (*model.TimeoutObject, error)); ok { 25 return rf(curView, newestQC, lastViewTC) 26 } 27 if rf, ok := ret.Get(0).(func(uint64, *flow.QuorumCertificate, *flow.TimeoutCertificate) *model.TimeoutObject); ok { 28 r0 = rf(curView, newestQC, lastViewTC) 29 } else { 30 if ret.Get(0) != nil { 31 r0 = ret.Get(0).(*model.TimeoutObject) 32 } 33 } 34 35 if rf, ok := ret.Get(1).(func(uint64, *flow.QuorumCertificate, *flow.TimeoutCertificate) error); ok { 36 r1 = rf(curView, newestQC, lastViewTC) 37 } else { 38 r1 = ret.Error(1) 39 } 40 41 return r0, r1 42 } 43 44 // ProduceVote provides a mock function with given fields: proposal, curView 45 func (_m *SafetyRules) ProduceVote(proposal *model.Proposal, curView uint64) (*model.Vote, error) { 46 ret := _m.Called(proposal, curView) 47 48 var r0 *model.Vote 49 var r1 error 50 if rf, ok := ret.Get(0).(func(*model.Proposal, uint64) (*model.Vote, error)); ok { 51 return rf(proposal, curView) 52 } 53 if rf, ok := ret.Get(0).(func(*model.Proposal, uint64) *model.Vote); ok { 54 r0 = rf(proposal, curView) 55 } else { 56 if ret.Get(0) != nil { 57 r0 = ret.Get(0).(*model.Vote) 58 } 59 } 60 61 if rf, ok := ret.Get(1).(func(*model.Proposal, uint64) error); ok { 62 r1 = rf(proposal, curView) 63 } else { 64 r1 = ret.Error(1) 65 } 66 67 return r0, r1 68 } 69 70 type mockConstructorTestingTNewSafetyRules interface { 71 mock.TestingT 72 Cleanup(func()) 73 } 74 75 // NewSafetyRules creates a new instance of SafetyRules. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 76 func NewSafetyRules(t mockConstructorTestingTNewSafetyRules) *SafetyRules { 77 mock := &SafetyRules{} 78 mock.Mock.Test(t) 79 80 t.Cleanup(func() { mock.AssertExpectations(t) }) 81 82 return mock 83 }