github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/consumer.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	hotstuff "github.com/onflow/flow-go/consensus/hotstuff"
     7  	flow "github.com/onflow/flow-go/model/flow"
     8  
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	model "github.com/onflow/flow-go/consensus/hotstuff/model"
    12  
    13  	time "time"
    14  )
    15  
    16  // Consumer is an autogenerated mock type for the Consumer type
    17  type Consumer struct {
    18  	mock.Mock
    19  }
    20  
    21  // OnBlockIncorporated provides a mock function with given fields: _a0
    22  func (_m *Consumer) OnBlockIncorporated(_a0 *model.Block) {
    23  	_m.Called(_a0)
    24  }
    25  
    26  // OnCurrentViewDetails provides a mock function with given fields: currentView, finalizedView, currentLeader
    27  func (_m *Consumer) OnCurrentViewDetails(currentView uint64, finalizedView uint64, currentLeader flow.Identifier) {
    28  	_m.Called(currentView, finalizedView, currentLeader)
    29  }
    30  
    31  // OnDoubleProposeDetected provides a mock function with given fields: _a0, _a1
    32  func (_m *Consumer) OnDoubleProposeDetected(_a0 *model.Block, _a1 *model.Block) {
    33  	_m.Called(_a0, _a1)
    34  }
    35  
    36  // OnEventProcessed provides a mock function with given fields:
    37  func (_m *Consumer) OnEventProcessed() {
    38  	_m.Called()
    39  }
    40  
    41  // OnFinalizedBlock provides a mock function with given fields: _a0
    42  func (_m *Consumer) OnFinalizedBlock(_a0 *model.Block) {
    43  	_m.Called(_a0)
    44  }
    45  
    46  // OnInvalidBlockDetected provides a mock function with given fields: err
    47  func (_m *Consumer) OnInvalidBlockDetected(err flow.Slashable[model.InvalidProposalError]) {
    48  	_m.Called(err)
    49  }
    50  
    51  // OnLocalTimeout provides a mock function with given fields: currentView
    52  func (_m *Consumer) OnLocalTimeout(currentView uint64) {
    53  	_m.Called(currentView)
    54  }
    55  
    56  // OnOwnProposal provides a mock function with given fields: proposal, targetPublicationTime
    57  func (_m *Consumer) OnOwnProposal(proposal *flow.Header, targetPublicationTime time.Time) {
    58  	_m.Called(proposal, targetPublicationTime)
    59  }
    60  
    61  // OnOwnTimeout provides a mock function with given fields: timeout
    62  func (_m *Consumer) OnOwnTimeout(timeout *model.TimeoutObject) {
    63  	_m.Called(timeout)
    64  }
    65  
    66  // OnOwnVote provides a mock function with given fields: blockID, view, sigData, recipientID
    67  func (_m *Consumer) OnOwnVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier) {
    68  	_m.Called(blockID, view, sigData, recipientID)
    69  }
    70  
    71  // OnPartialTc provides a mock function with given fields: currentView, partialTc
    72  func (_m *Consumer) OnPartialTc(currentView uint64, partialTc *hotstuff.PartialTcCreated) {
    73  	_m.Called(currentView, partialTc)
    74  }
    75  
    76  // OnQcTriggeredViewChange provides a mock function with given fields: oldView, newView, qc
    77  func (_m *Consumer) OnQcTriggeredViewChange(oldView uint64, newView uint64, qc *flow.QuorumCertificate) {
    78  	_m.Called(oldView, newView, qc)
    79  }
    80  
    81  // OnReceiveProposal provides a mock function with given fields: currentView, proposal
    82  func (_m *Consumer) OnReceiveProposal(currentView uint64, proposal *model.Proposal) {
    83  	_m.Called(currentView, proposal)
    84  }
    85  
    86  // OnReceiveQc provides a mock function with given fields: currentView, qc
    87  func (_m *Consumer) OnReceiveQc(currentView uint64, qc *flow.QuorumCertificate) {
    88  	_m.Called(currentView, qc)
    89  }
    90  
    91  // OnReceiveTc provides a mock function with given fields: currentView, tc
    92  func (_m *Consumer) OnReceiveTc(currentView uint64, tc *flow.TimeoutCertificate) {
    93  	_m.Called(currentView, tc)
    94  }
    95  
    96  // OnStart provides a mock function with given fields: currentView
    97  func (_m *Consumer) OnStart(currentView uint64) {
    98  	_m.Called(currentView)
    99  }
   100  
   101  // OnStartingTimeout provides a mock function with given fields: _a0
   102  func (_m *Consumer) OnStartingTimeout(_a0 model.TimerInfo) {
   103  	_m.Called(_a0)
   104  }
   105  
   106  // OnTcTriggeredViewChange provides a mock function with given fields: oldView, newView, tc
   107  func (_m *Consumer) OnTcTriggeredViewChange(oldView uint64, newView uint64, tc *flow.TimeoutCertificate) {
   108  	_m.Called(oldView, newView, tc)
   109  }
   110  
   111  // OnViewChange provides a mock function with given fields: oldView, newView
   112  func (_m *Consumer) OnViewChange(oldView uint64, newView uint64) {
   113  	_m.Called(oldView, newView)
   114  }
   115  
   116  type mockConstructorTestingTNewConsumer interface {
   117  	mock.TestingT
   118  	Cleanup(func())
   119  }
   120  
   121  // NewConsumer creates a new instance of Consumer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   122  func NewConsumer(t mockConstructorTestingTNewConsumer) *Consumer {
   123  	mock := &Consumer{}
   124  	mock.Mock.Test(t)
   125  
   126  	t.Cleanup(func() { mock.AssertExpectations(t) })
   127  
   128  	return mock
   129  }