github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/protocol_peer_cache.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	mock "github.com/stretchr/testify/mock"
     7  
     8  	peer "github.com/libp2p/go-libp2p/core/peer"
     9  
    10  	protocol "github.com/libp2p/go-libp2p/core/protocol"
    11  )
    12  
    13  // ProtocolPeerCache is an autogenerated mock type for the ProtocolPeerCache type
    14  type ProtocolPeerCache struct {
    15  	mock.Mock
    16  }
    17  
    18  // AddProtocols provides a mock function with given fields: peerID, protocols
    19  func (_m *ProtocolPeerCache) AddProtocols(peerID peer.ID, protocols []protocol.ID) {
    20  	_m.Called(peerID, protocols)
    21  }
    22  
    23  // GetPeers provides a mock function with given fields: pid
    24  func (_m *ProtocolPeerCache) GetPeers(pid protocol.ID) map[peer.ID]struct{} {
    25  	ret := _m.Called(pid)
    26  
    27  	var r0 map[peer.ID]struct{}
    28  	if rf, ok := ret.Get(0).(func(protocol.ID) map[peer.ID]struct{}); ok {
    29  		r0 = rf(pid)
    30  	} else {
    31  		if ret.Get(0) != nil {
    32  			r0 = ret.Get(0).(map[peer.ID]struct{})
    33  		}
    34  	}
    35  
    36  	return r0
    37  }
    38  
    39  // RemovePeer provides a mock function with given fields: peerID
    40  func (_m *ProtocolPeerCache) RemovePeer(peerID peer.ID) {
    41  	_m.Called(peerID)
    42  }
    43  
    44  // RemoveProtocols provides a mock function with given fields: peerID, protocols
    45  func (_m *ProtocolPeerCache) RemoveProtocols(peerID peer.ID, protocols []protocol.ID) {
    46  	_m.Called(peerID, protocols)
    47  }
    48  
    49  type mockConstructorTestingTNewProtocolPeerCache interface {
    50  	mock.TestingT
    51  	Cleanup(func())
    52  }
    53  
    54  // NewProtocolPeerCache creates a new instance of ProtocolPeerCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    55  func NewProtocolPeerCache(t mockConstructorTestingTNewProtocolPeerCache) *ProtocolPeerCache {
    56  	mock := &ProtocolPeerCache{}
    57  	mock.Mock.Test(t)
    58  
    59  	t.Cleanup(func() { mock.AssertExpectations(t) })
    60  
    61  	return mock
    62  }