github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/disallow_list_cache.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 network "github.com/onflow/flow-go/network" 7 mock "github.com/stretchr/testify/mock" 8 9 peer "github.com/libp2p/go-libp2p/core/peer" 10 ) 11 12 // DisallowListCache is an autogenerated mock type for the DisallowListCache type 13 type DisallowListCache struct { 14 mock.Mock 15 } 16 17 // AllowFor provides a mock function with given fields: peerID, cause 18 func (_m *DisallowListCache) AllowFor(peerID peer.ID, cause network.DisallowListedCause) []network.DisallowListedCause { 19 ret := _m.Called(peerID, cause) 20 21 var r0 []network.DisallowListedCause 22 if rf, ok := ret.Get(0).(func(peer.ID, network.DisallowListedCause) []network.DisallowListedCause); ok { 23 r0 = rf(peerID, cause) 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).([]network.DisallowListedCause) 27 } 28 } 29 30 return r0 31 } 32 33 // DisallowFor provides a mock function with given fields: peerID, cause 34 func (_m *DisallowListCache) DisallowFor(peerID peer.ID, cause network.DisallowListedCause) ([]network.DisallowListedCause, error) { 35 ret := _m.Called(peerID, cause) 36 37 var r0 []network.DisallowListedCause 38 var r1 error 39 if rf, ok := ret.Get(0).(func(peer.ID, network.DisallowListedCause) ([]network.DisallowListedCause, error)); ok { 40 return rf(peerID, cause) 41 } 42 if rf, ok := ret.Get(0).(func(peer.ID, network.DisallowListedCause) []network.DisallowListedCause); ok { 43 r0 = rf(peerID, cause) 44 } else { 45 if ret.Get(0) != nil { 46 r0 = ret.Get(0).([]network.DisallowListedCause) 47 } 48 } 49 50 if rf, ok := ret.Get(1).(func(peer.ID, network.DisallowListedCause) error); ok { 51 r1 = rf(peerID, cause) 52 } else { 53 r1 = ret.Error(1) 54 } 55 56 return r0, r1 57 } 58 59 // IsDisallowListed provides a mock function with given fields: peerID 60 func (_m *DisallowListCache) IsDisallowListed(peerID peer.ID) ([]network.DisallowListedCause, bool) { 61 ret := _m.Called(peerID) 62 63 var r0 []network.DisallowListedCause 64 var r1 bool 65 if rf, ok := ret.Get(0).(func(peer.ID) ([]network.DisallowListedCause, bool)); ok { 66 return rf(peerID) 67 } 68 if rf, ok := ret.Get(0).(func(peer.ID) []network.DisallowListedCause); ok { 69 r0 = rf(peerID) 70 } else { 71 if ret.Get(0) != nil { 72 r0 = ret.Get(0).([]network.DisallowListedCause) 73 } 74 } 75 76 if rf, ok := ret.Get(1).(func(peer.ID) bool); ok { 77 r1 = rf(peerID) 78 } else { 79 r1 = ret.Get(1).(bool) 80 } 81 82 return r0, r1 83 } 84 85 type mockConstructorTestingTNewDisallowListCache interface { 86 mock.TestingT 87 Cleanup(func()) 88 } 89 90 // NewDisallowListCache creates a new instance of DisallowListCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 91 func NewDisallowListCache(t mockConstructorTestingTNewDisallowListCache) *DisallowListCache { 92 mock := &DisallowListCache{} 93 mock.Mock.Test(t) 94 95 t.Cleanup(func() { mock.AssertExpectations(t) }) 96 97 return mock 98 }