github.com/koko1123/flow-go-1@v0.29.6/module/mock/pending_block_buffer.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 flow "github.com/koko1123/flow-go-1/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: originID, block 16 func (_m *PendingBlockBuffer) Add(originID flow.Identifier, block *flow.Block) bool { 17 ret := _m.Called(originID, block) 18 19 var r0 bool 20 if rf, ok := ret.Get(0).(func(flow.Identifier, *flow.Block) bool); ok { 21 r0 = rf(originID, 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 if rf, ok := ret.Get(0).(func(flow.Identifier) flow.Slashable[flow.Block]); ok { 35 r0 = rf(blockID) 36 } else { 37 r0 = ret.Get(0).(flow.Slashable[flow.Block]) 38 } 39 40 var r1 bool 41 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 42 r1 = rf(blockID) 43 } else { 44 r1 = ret.Get(1).(bool) 45 } 46 47 return r0, r1 48 } 49 50 // ByParentID provides a mock function with given fields: parentID 51 func (_m *PendingBlockBuffer) ByParentID(parentID flow.Identifier) ([]flow.Slashable[flow.Block], bool) { 52 ret := _m.Called(parentID) 53 54 var r0 []flow.Slashable[flow.Block] 55 if rf, ok := ret.Get(0).(func(flow.Identifier) []flow.Slashable[flow.Block]); ok { 56 r0 = rf(parentID) 57 } else { 58 if ret.Get(0) != nil { 59 r0 = ret.Get(0).([]flow.Slashable[flow.Block]) 60 } 61 } 62 63 var r1 bool 64 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 65 r1 = rf(parentID) 66 } else { 67 r1 = ret.Get(1).(bool) 68 } 69 70 return r0, r1 71 } 72 73 // DropForParent provides a mock function with given fields: parentID 74 func (_m *PendingBlockBuffer) DropForParent(parentID flow.Identifier) { 75 _m.Called(parentID) 76 } 77 78 // PruneByView provides a mock function with given fields: view 79 func (_m *PendingBlockBuffer) PruneByView(view uint64) { 80 _m.Called(view) 81 } 82 83 // Size provides a mock function with given fields: 84 func (_m *PendingBlockBuffer) Size() uint { 85 ret := _m.Called() 86 87 var r0 uint 88 if rf, ok := ret.Get(0).(func() uint); ok { 89 r0 = rf() 90 } else { 91 r0 = ret.Get(0).(uint) 92 } 93 94 return r0 95 } 96 97 type mockConstructorTestingTNewPendingBlockBuffer interface { 98 mock.TestingT 99 Cleanup(func()) 100 } 101 102 // 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. 103 func NewPendingBlockBuffer(t mockConstructorTestingTNewPendingBlockBuffer) *PendingBlockBuffer { 104 mock := &PendingBlockBuffer{} 105 mock.Mock.Test(t) 106 107 t.Cleanup(func() { mock.AssertExpectations(t) }) 108 109 return mock 110 }