github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/mocks/forks_reader.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  // ForksReader is an autogenerated mock type for the ForksReader type
    14  type ForksReader struct {
    15  	mock.Mock
    16  }
    17  
    18  // FinalizedBlock provides a mock function with given fields:
    19  func (_m *ForksReader) FinalizedBlock() *model.Block {
    20  	ret := _m.Called()
    21  
    22  	var r0 *model.Block
    23  	if rf, ok := ret.Get(0).(func() *model.Block); ok {
    24  		r0 = rf()
    25  	} else {
    26  		if ret.Get(0) != nil {
    27  			r0 = ret.Get(0).(*model.Block)
    28  		}
    29  	}
    30  
    31  	return r0
    32  }
    33  
    34  // FinalizedView provides a mock function with given fields:
    35  func (_m *ForksReader) FinalizedView() 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  // GetBlock provides a mock function with given fields: id
    49  func (_m *ForksReader) GetBlock(id flow.Identifier) (*model.Block, bool) {
    50  	ret := _m.Called(id)
    51  
    52  	var r0 *model.Block
    53  	if rf, ok := ret.Get(0).(func(flow.Identifier) *model.Block); ok {
    54  		r0 = rf(id)
    55  	} else {
    56  		if ret.Get(0) != nil {
    57  			r0 = ret.Get(0).(*model.Block)
    58  		}
    59  	}
    60  
    61  	var r1 bool
    62  	if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok {
    63  		r1 = rf(id)
    64  	} else {
    65  		r1 = ret.Get(1).(bool)
    66  	}
    67  
    68  	return r0, r1
    69  }
    70  
    71  // GetBlocksForView provides a mock function with given fields: view
    72  func (_m *ForksReader) GetBlocksForView(view uint64) []*model.Block {
    73  	ret := _m.Called(view)
    74  
    75  	var r0 []*model.Block
    76  	if rf, ok := ret.Get(0).(func(uint64) []*model.Block); ok {
    77  		r0 = rf(view)
    78  	} else {
    79  		if ret.Get(0) != nil {
    80  			r0 = ret.Get(0).([]*model.Block)
    81  		}
    82  	}
    83  
    84  	return r0
    85  }
    86  
    87  // IsSafeBlock provides a mock function with given fields: block
    88  func (_m *ForksReader) IsSafeBlock(block *model.Block) bool {
    89  	ret := _m.Called(block)
    90  
    91  	var r0 bool
    92  	if rf, ok := ret.Get(0).(func(*model.Block) bool); ok {
    93  		r0 = rf(block)
    94  	} else {
    95  		r0 = ret.Get(0).(bool)
    96  	}
    97  
    98  	return r0
    99  }
   100  
   101  type mockConstructorTestingTNewForksReader interface {
   102  	mock.TestingT
   103  	Cleanup(func())
   104  }
   105  
   106  // NewForksReader creates a new instance of ForksReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   107  func NewForksReader(t mockConstructorTestingTNewForksReader) *ForksReader {
   108  	mock := &ForksReader{}
   109  	mock.Mock.Test(t)
   110  
   111  	t.Cleanup(func() { mock.AssertExpectations(t) })
   112  
   113  	return mock
   114  }