github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/forks.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  
    14  // Forks is an autogenerated mock type for the Forks type
    15  type Forks struct {
    16  	mock.Mock
    17  }
    18  
    19  // AddCertifiedBlock provides a mock function with given fields: certifiedBlock
    20  func (_m *Forks) AddCertifiedBlock(certifiedBlock *model.CertifiedBlock) error {
    21  	ret := _m.Called(certifiedBlock)
    22  
    23  	var r0 error
    24  	if rf, ok := ret.Get(0).(func(*model.CertifiedBlock) error); ok {
    25  		r0 = rf(certifiedBlock)
    26  	} else {
    27  		r0 = ret.Error(0)
    28  	}
    29  
    30  	return r0
    31  }
    32  
    33  // AddValidatedBlock provides a mock function with given fields: proposal
    34  func (_m *Forks) AddValidatedBlock(proposal *model.Block) error {
    35  	ret := _m.Called(proposal)
    36  
    37  	var r0 error
    38  	if rf, ok := ret.Get(0).(func(*model.Block) error); ok {
    39  		r0 = rf(proposal)
    40  	} else {
    41  		r0 = ret.Error(0)
    42  	}
    43  
    44  	return r0
    45  }
    46  
    47  // FinalityProof provides a mock function with given fields:
    48  func (_m *Forks) FinalityProof() (*hotstuff.FinalityProof, bool) {
    49  	ret := _m.Called()
    50  
    51  	var r0 *hotstuff.FinalityProof
    52  	var r1 bool
    53  	if rf, ok := ret.Get(0).(func() (*hotstuff.FinalityProof, bool)); ok {
    54  		return rf()
    55  	}
    56  	if rf, ok := ret.Get(0).(func() *hotstuff.FinalityProof); ok {
    57  		r0 = rf()
    58  	} else {
    59  		if ret.Get(0) != nil {
    60  			r0 = ret.Get(0).(*hotstuff.FinalityProof)
    61  		}
    62  	}
    63  
    64  	if rf, ok := ret.Get(1).(func() bool); ok {
    65  		r1 = rf()
    66  	} else {
    67  		r1 = ret.Get(1).(bool)
    68  	}
    69  
    70  	return r0, r1
    71  }
    72  
    73  // FinalizedBlock provides a mock function with given fields:
    74  func (_m *Forks) FinalizedBlock() *model.Block {
    75  	ret := _m.Called()
    76  
    77  	var r0 *model.Block
    78  	if rf, ok := ret.Get(0).(func() *model.Block); ok {
    79  		r0 = rf()
    80  	} else {
    81  		if ret.Get(0) != nil {
    82  			r0 = ret.Get(0).(*model.Block)
    83  		}
    84  	}
    85  
    86  	return r0
    87  }
    88  
    89  // FinalizedView provides a mock function with given fields:
    90  func (_m *Forks) FinalizedView() uint64 {
    91  	ret := _m.Called()
    92  
    93  	var r0 uint64
    94  	if rf, ok := ret.Get(0).(func() uint64); ok {
    95  		r0 = rf()
    96  	} else {
    97  		r0 = ret.Get(0).(uint64)
    98  	}
    99  
   100  	return r0
   101  }
   102  
   103  // GetBlock provides a mock function with given fields: blockID
   104  func (_m *Forks) GetBlock(blockID flow.Identifier) (*model.Block, bool) {
   105  	ret := _m.Called(blockID)
   106  
   107  	var r0 *model.Block
   108  	var r1 bool
   109  	if rf, ok := ret.Get(0).(func(flow.Identifier) (*model.Block, bool)); ok {
   110  		return rf(blockID)
   111  	}
   112  	if rf, ok := ret.Get(0).(func(flow.Identifier) *model.Block); ok {
   113  		r0 = rf(blockID)
   114  	} else {
   115  		if ret.Get(0) != nil {
   116  			r0 = ret.Get(0).(*model.Block)
   117  		}
   118  	}
   119  
   120  	if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok {
   121  		r1 = rf(blockID)
   122  	} else {
   123  		r1 = ret.Get(1).(bool)
   124  	}
   125  
   126  	return r0, r1
   127  }
   128  
   129  // GetBlocksForView provides a mock function with given fields: view
   130  func (_m *Forks) GetBlocksForView(view uint64) []*model.Block {
   131  	ret := _m.Called(view)
   132  
   133  	var r0 []*model.Block
   134  	if rf, ok := ret.Get(0).(func(uint64) []*model.Block); ok {
   135  		r0 = rf(view)
   136  	} else {
   137  		if ret.Get(0) != nil {
   138  			r0 = ret.Get(0).([]*model.Block)
   139  		}
   140  	}
   141  
   142  	return r0
   143  }
   144  
   145  type mockConstructorTestingTNewForks interface {
   146  	mock.TestingT
   147  	Cleanup(func())
   148  }
   149  
   150  // NewForks creates a new instance of Forks. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   151  func NewForks(t mockConstructorTestingTNewForks) *Forks {
   152  	mock := &Forks{}
   153  	mock.Mock.Test(t)
   154  
   155  	t.Cleanup(func() { mock.AssertExpectations(t) })
   156  
   157  	return mock
   158  }