github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/mocks/pace_maker.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  	time "time"
    13  )
    14  
    15  // PaceMaker is an autogenerated mock type for the PaceMaker type
    16  type PaceMaker struct {
    17  	mock.Mock
    18  }
    19  
    20  // BlockRateDelay provides a mock function with given fields:
    21  func (_m *PaceMaker) BlockRateDelay() time.Duration {
    22  	ret := _m.Called()
    23  
    24  	var r0 time.Duration
    25  	if rf, ok := ret.Get(0).(func() time.Duration); ok {
    26  		r0 = rf()
    27  	} else {
    28  		r0 = ret.Get(0).(time.Duration)
    29  	}
    30  
    31  	return r0
    32  }
    33  
    34  // CurView provides a mock function with given fields:
    35  func (_m *PaceMaker) CurView() uint64 {
    36  	ret := _m.Called()
    37  
    38  	var r0 uint64
    39  	if rf, ok := ret.Get(0).(func() uint64); ok {
    40  		r0 = rf()
    41  	} else {
    42  		r0 = ret.Get(0).(uint64)
    43  	}
    44  
    45  	return r0
    46  }
    47  
    48  // OnTimeout provides a mock function with given fields:
    49  func (_m *PaceMaker) OnTimeout() *model.NewViewEvent {
    50  	ret := _m.Called()
    51  
    52  	var r0 *model.NewViewEvent
    53  	if rf, ok := ret.Get(0).(func() *model.NewViewEvent); ok {
    54  		r0 = rf()
    55  	} else {
    56  		if ret.Get(0) != nil {
    57  			r0 = ret.Get(0).(*model.NewViewEvent)
    58  		}
    59  	}
    60  
    61  	return r0
    62  }
    63  
    64  // Start provides a mock function with given fields:
    65  func (_m *PaceMaker) Start() {
    66  	_m.Called()
    67  }
    68  
    69  // TimeoutChannel provides a mock function with given fields:
    70  func (_m *PaceMaker) TimeoutChannel() <-chan time.Time {
    71  	ret := _m.Called()
    72  
    73  	var r0 <-chan time.Time
    74  	if rf, ok := ret.Get(0).(func() <-chan time.Time); ok {
    75  		r0 = rf()
    76  	} else {
    77  		if ret.Get(0) != nil {
    78  			r0 = ret.Get(0).(<-chan time.Time)
    79  		}
    80  	}
    81  
    82  	return r0
    83  }
    84  
    85  // UpdateCurViewWithBlock provides a mock function with given fields: block, isLeaderForNextView
    86  func (_m *PaceMaker) UpdateCurViewWithBlock(block *model.Block, isLeaderForNextView bool) (*model.NewViewEvent, bool) {
    87  	ret := _m.Called(block, isLeaderForNextView)
    88  
    89  	var r0 *model.NewViewEvent
    90  	if rf, ok := ret.Get(0).(func(*model.Block, bool) *model.NewViewEvent); ok {
    91  		r0 = rf(block, isLeaderForNextView)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(*model.NewViewEvent)
    95  		}
    96  	}
    97  
    98  	var r1 bool
    99  	if rf, ok := ret.Get(1).(func(*model.Block, bool) bool); ok {
   100  		r1 = rf(block, isLeaderForNextView)
   101  	} else {
   102  		r1 = ret.Get(1).(bool)
   103  	}
   104  
   105  	return r0, r1
   106  }
   107  
   108  // UpdateCurViewWithQC provides a mock function with given fields: qc
   109  func (_m *PaceMaker) UpdateCurViewWithQC(qc *flow.QuorumCertificate) (*model.NewViewEvent, bool) {
   110  	ret := _m.Called(qc)
   111  
   112  	var r0 *model.NewViewEvent
   113  	if rf, ok := ret.Get(0).(func(*flow.QuorumCertificate) *model.NewViewEvent); ok {
   114  		r0 = rf(qc)
   115  	} else {
   116  		if ret.Get(0) != nil {
   117  			r0 = ret.Get(0).(*model.NewViewEvent)
   118  		}
   119  	}
   120  
   121  	var r1 bool
   122  	if rf, ok := ret.Get(1).(func(*flow.QuorumCertificate) bool); ok {
   123  		r1 = rf(qc)
   124  	} else {
   125  		r1 = ret.Get(1).(bool)
   126  	}
   127  
   128  	return r0, r1
   129  }
   130  
   131  type mockConstructorTestingTNewPaceMaker interface {
   132  	mock.TestingT
   133  	Cleanup(func())
   134  }
   135  
   136  // 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.
   137  func NewPaceMaker(t mockConstructorTestingTNewPaceMaker) *PaceMaker {
   138  	mock := &PaceMaker{}
   139  	mock.Mock.Test(t)
   140  
   141  	t.Cleanup(func() { mock.AssertExpectations(t) })
   142  
   143  	return mock
   144  }