github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mock/pending_block_buffer.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 flow "github.com/onflow/flow-go/model/flow" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // PendingBlockBuffer is an autogenerated mock type for the PendingBlockBuffer type 11 type PendingBlockBuffer struct { 12 mock.Mock 13 } 14 15 // Add provides a mock function with given fields: block 16 func (_m *PendingBlockBuffer) Add(block flow.Slashable[*flow.Block]) bool { 17 ret := _m.Called(block) 18 19 var r0 bool 20 if rf, ok := ret.Get(0).(func(flow.Slashable[*flow.Block]) bool); ok { 21 r0 = rf(block) 22 } else { 23 r0 = ret.Get(0).(bool) 24 } 25 26 return r0 27 } 28 29 // ByID provides a mock function with given fields: blockID 30 func (_m *PendingBlockBuffer) ByID(blockID flow.Identifier) (flow.Slashable[*flow.Block], bool) { 31 ret := _m.Called(blockID) 32 33 var r0 flow.Slashable[*flow.Block] 34 var r1 bool 35 if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.Slashable[*flow.Block], bool)); ok { 36 return rf(blockID) 37 } 38 if rf, ok := ret.Get(0).(func(flow.Identifier) flow.Slashable[*flow.Block]); ok { 39 r0 = rf(blockID) 40 } else { 41 r0 = ret.Get(0).(flow.Slashable[*flow.Block]) 42 } 43 44 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 45 r1 = rf(blockID) 46 } else { 47 r1 = ret.Get(1).(bool) 48 } 49 50 return r0, r1 51 } 52 53 // ByParentID provides a mock function with given fields: parentID 54 func (_m *PendingBlockBuffer) ByParentID(parentID flow.Identifier) ([]flow.Slashable[*flow.Block], bool) { 55 ret := _m.Called(parentID) 56 57 var r0 []flow.Slashable[*flow.Block] 58 var r1 bool 59 if rf, ok := ret.Get(0).(func(flow.Identifier) ([]flow.Slashable[*flow.Block], bool)); ok { 60 return rf(parentID) 61 } 62 if rf, ok := ret.Get(0).(func(flow.Identifier) []flow.Slashable[*flow.Block]); ok { 63 r0 = rf(parentID) 64 } else { 65 if ret.Get(0) != nil { 66 r0 = ret.Get(0).([]flow.Slashable[*flow.Block]) 67 } 68 } 69 70 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 71 r1 = rf(parentID) 72 } else { 73 r1 = ret.Get(1).(bool) 74 } 75 76 return r0, r1 77 } 78 79 // DropForParent provides a mock function with given fields: parentID 80 func (_m *PendingBlockBuffer) DropForParent(parentID flow.Identifier) { 81 _m.Called(parentID) 82 } 83 84 // PruneByView provides a mock function with given fields: view 85 func (_m *PendingBlockBuffer) PruneByView(view uint64) { 86 _m.Called(view) 87 } 88 89 // Size provides a mock function with given fields: 90 func (_m *PendingBlockBuffer) Size() uint { 91 ret := _m.Called() 92 93 var r0 uint 94 if rf, ok := ret.Get(0).(func() uint); ok { 95 r0 = rf() 96 } else { 97 r0 = ret.Get(0).(uint) 98 } 99 100 return r0 101 } 102 103 type mockConstructorTestingTNewPendingBlockBuffer interface { 104 mock.TestingT 105 Cleanup(func()) 106 } 107 108 // NewPendingBlockBuffer creates a new instance of PendingBlockBuffer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 109 func NewPendingBlockBuffer(t mockConstructorTestingTNewPendingBlockBuffer) *PendingBlockBuffer { 110 mock := &PendingBlockBuffer{} 111 mock.Mock.Test(t) 112 113 t.Cleanup(func() { mock.AssertExpectations(t) }) 114 115 return mock 116 }