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