github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/event_handler.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  	hotstuff "github.com/onflow/flow-go/consensus/hotstuff"
     9  	flow "github.com/onflow/flow-go/model/flow"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	model "github.com/onflow/flow-go/consensus/hotstuff/model"
    14  
    15  	time "time"
    16  )
    17  
    18  // EventHandler is an autogenerated mock type for the EventHandler type
    19  type EventHandler struct {
    20  	mock.Mock
    21  }
    22  
    23  // OnLocalTimeout provides a mock function with given fields:
    24  func (_m *EventHandler) OnLocalTimeout() error {
    25  	ret := _m.Called()
    26  
    27  	var r0 error
    28  	if rf, ok := ret.Get(0).(func() error); ok {
    29  		r0 = rf()
    30  	} else {
    31  		r0 = ret.Error(0)
    32  	}
    33  
    34  	return r0
    35  }
    36  
    37  // OnPartialTcCreated provides a mock function with given fields: partialTC
    38  func (_m *EventHandler) OnPartialTcCreated(partialTC *hotstuff.PartialTcCreated) error {
    39  	ret := _m.Called(partialTC)
    40  
    41  	var r0 error
    42  	if rf, ok := ret.Get(0).(func(*hotstuff.PartialTcCreated) error); ok {
    43  		r0 = rf(partialTC)
    44  	} else {
    45  		r0 = ret.Error(0)
    46  	}
    47  
    48  	return r0
    49  }
    50  
    51  // OnReceiveProposal provides a mock function with given fields: proposal
    52  func (_m *EventHandler) OnReceiveProposal(proposal *model.Proposal) error {
    53  	ret := _m.Called(proposal)
    54  
    55  	var r0 error
    56  	if rf, ok := ret.Get(0).(func(*model.Proposal) error); ok {
    57  		r0 = rf(proposal)
    58  	} else {
    59  		r0 = ret.Error(0)
    60  	}
    61  
    62  	return r0
    63  }
    64  
    65  // OnReceiveQc provides a mock function with given fields: qc
    66  func (_m *EventHandler) OnReceiveQc(qc *flow.QuorumCertificate) error {
    67  	ret := _m.Called(qc)
    68  
    69  	var r0 error
    70  	if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) error); ok {
    71  		r0 = rf(qc)
    72  	} else {
    73  		r0 = ret.Error(0)
    74  	}
    75  
    76  	return r0
    77  }
    78  
    79  // OnReceiveTc provides a mock function with given fields: tc
    80  func (_m *EventHandler) OnReceiveTc(tc *flow.TimeoutCertificate) error {
    81  	ret := _m.Called(tc)
    82  
    83  	var r0 error
    84  	if rf, ok := ret.Get(0).(func(*flow.TimeoutCertificate) error); ok {
    85  		r0 = rf(tc)
    86  	} else {
    87  		r0 = ret.Error(0)
    88  	}
    89  
    90  	return r0
    91  }
    92  
    93  // Start provides a mock function with given fields: ctx
    94  func (_m *EventHandler) Start(ctx context.Context) error {
    95  	ret := _m.Called(ctx)
    96  
    97  	var r0 error
    98  	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
    99  		r0 = rf(ctx)
   100  	} else {
   101  		r0 = ret.Error(0)
   102  	}
   103  
   104  	return r0
   105  }
   106  
   107  // TimeoutChannel provides a mock function with given fields:
   108  func (_m *EventHandler) TimeoutChannel() <-chan time.Time {
   109  	ret := _m.Called()
   110  
   111  	var r0 <-chan time.Time
   112  	if rf, ok := ret.Get(0).(func() <-chan time.Time); ok {
   113  		r0 = rf()
   114  	} else {
   115  		if ret.Get(0) != nil {
   116  			r0 = ret.Get(0).(<-chan time.Time)
   117  		}
   118  	}
   119  
   120  	return r0
   121  }
   122  
   123  type mockConstructorTestingTNewEventHandler interface {
   124  	mock.TestingT
   125  	Cleanup(func())
   126  }
   127  
   128  // 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.
   129  func NewEventHandler(t mockConstructorTestingTNewEventHandler) *EventHandler {
   130  	mock := &EventHandler{}
   131  	mock.Mock.Test(t)
   132  
   133  	t.Cleanup(func() { mock.AssertExpectations(t) })
   134  
   135  	return mock
   136  }