github.com/onflow/flow-go@v0.33.17/consensus/hotstuff/mocks/validator.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 // Validator is an autogenerated mock type for the Validator type 14 type Validator struct { 15 mock.Mock 16 } 17 18 // ValidateProposal provides a mock function with given fields: proposal 19 func (_m *Validator) ValidateProposal(proposal *model.Proposal) error { 20 ret := _m.Called(proposal) 21 22 var r0 error 23 if rf, ok := ret.Get(0).(func(*model.Proposal) error); ok { 24 r0 = rf(proposal) 25 } else { 26 r0 = ret.Error(0) 27 } 28 29 return r0 30 } 31 32 // ValidateQC provides a mock function with given fields: qc 33 func (_m *Validator) ValidateQC(qc *flow.QuorumCertificate) error { 34 ret := _m.Called(qc) 35 36 var r0 error 37 if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) error); ok { 38 r0 = rf(qc) 39 } else { 40 r0 = ret.Error(0) 41 } 42 43 return r0 44 } 45 46 // ValidateTC provides a mock function with given fields: tc 47 func (_m *Validator) ValidateTC(tc *flow.TimeoutCertificate) error { 48 ret := _m.Called(tc) 49 50 var r0 error 51 if rf, ok := ret.Get(0).(func(*flow.TimeoutCertificate) error); ok { 52 r0 = rf(tc) 53 } else { 54 r0 = ret.Error(0) 55 } 56 57 return r0 58 } 59 60 // ValidateVote provides a mock function with given fields: vote 61 func (_m *Validator) ValidateVote(vote *model.Vote) (*flow.Identity, error) { 62 ret := _m.Called(vote) 63 64 var r0 *flow.Identity 65 var r1 error 66 if rf, ok := ret.Get(0).(func(*model.Vote) (*flow.Identity, error)); ok { 67 return rf(vote) 68 } 69 if rf, ok := ret.Get(0).(func(*model.Vote) *flow.Identity); ok { 70 r0 = rf(vote) 71 } else { 72 if ret.Get(0) != nil { 73 r0 = ret.Get(0).(*flow.Identity) 74 } 75 } 76 77 if rf, ok := ret.Get(1).(func(*model.Vote) error); ok { 78 r1 = rf(vote) 79 } else { 80 r1 = ret.Error(1) 81 } 82 83 return r0, r1 84 } 85 86 type mockConstructorTestingTNewValidator interface { 87 mock.TestingT 88 Cleanup(func()) 89 } 90 91 // NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 92 func NewValidator(t mockConstructorTestingTNewValidator) *Validator { 93 mock := &Validator{} 94 mock.Mock.Test(t) 95 96 t.Cleanup(func() { mock.AssertExpectations(t) }) 97 98 return mock 99 }