github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/mocks/validator.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  
    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, block
    33  func (_m *Validator) ValidateQC(qc *flow.QuorumCertificate, block *model.Block) error {
    34  	ret := _m.Called(qc, block)
    35  
    36  	var r0 error
    37  	if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate, *model.Block) error); ok {
    38  		r0 = rf(qc, block)
    39  	} else {
    40  		r0 = ret.Error(0)
    41  	}
    42  
    43  	return r0
    44  }
    45  
    46  // ValidateVote provides a mock function with given fields: vote, block
    47  func (_m *Validator) ValidateVote(vote *model.Vote, block *model.Block) (*flow.Identity, error) {
    48  	ret := _m.Called(vote, block)
    49  
    50  	var r0 *flow.Identity
    51  	if rf, ok := ret.Get(0).(func(*model.Vote, *model.Block) *flow.Identity); ok {
    52  		r0 = rf(vote, block)
    53  	} else {
    54  		if ret.Get(0) != nil {
    55  			r0 = ret.Get(0).(*flow.Identity)
    56  		}
    57  	}
    58  
    59  	var r1 error
    60  	if rf, ok := ret.Get(1).(func(*model.Vote, *model.Block) error); ok {
    61  		r1 = rf(vote, block)
    62  	} else {
    63  		r1 = ret.Error(1)
    64  	}
    65  
    66  	return r0, r1
    67  }
    68  
    69  type mockConstructorTestingTNewValidator interface {
    70  	mock.TestingT
    71  	Cleanup(func())
    72  }
    73  
    74  // 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.
    75  func NewValidator(t mockConstructorTestingTNewValidator) *Validator {
    76  	mock := &Validator{}
    77  	mock.Mock.Test(t)
    78  
    79  	t.Cleanup(func() { mock.AssertExpectations(t) })
    80  
    81  	return mock
    82  }