github.com/onflow/flow-go@v0.33.17/network/p2p/mock/pub_sub_tracer.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	irrecoverable "github.com/onflow/flow-go/module/irrecoverable"
     7  	channels "github.com/onflow/flow-go/network/channels"
     8  
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	peer "github.com/libp2p/go-libp2p/core/peer"
    12  
    13  	protocol "github.com/libp2p/go-libp2p/core/protocol"
    14  
    15  	pubsub "github.com/libp2p/go-libp2p-pubsub"
    16  )
    17  
    18  // PubSubTracer is an autogenerated mock type for the PubSubTracer type
    19  type PubSubTracer struct {
    20  	mock.Mock
    21  }
    22  
    23  // AddPeer provides a mock function with given fields: p, proto
    24  func (_m *PubSubTracer) AddPeer(p peer.ID, proto protocol.ID) {
    25  	_m.Called(p, proto)
    26  }
    27  
    28  // DeliverMessage provides a mock function with given fields: msg
    29  func (_m *PubSubTracer) DeliverMessage(msg *pubsub.Message) {
    30  	_m.Called(msg)
    31  }
    32  
    33  // Done provides a mock function with given fields:
    34  func (_m *PubSubTracer) Done() <-chan struct{} {
    35  	ret := _m.Called()
    36  
    37  	var r0 <-chan struct{}
    38  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    39  		r0 = rf()
    40  	} else {
    41  		if ret.Get(0) != nil {
    42  			r0 = ret.Get(0).(<-chan struct{})
    43  		}
    44  	}
    45  
    46  	return r0
    47  }
    48  
    49  // DropRPC provides a mock function with given fields: rpc, p
    50  func (_m *PubSubTracer) DropRPC(rpc *pubsub.RPC, p peer.ID) {
    51  	_m.Called(rpc, p)
    52  }
    53  
    54  // DuplicateMessage provides a mock function with given fields: msg
    55  func (_m *PubSubTracer) DuplicateMessage(msg *pubsub.Message) {
    56  	_m.Called(msg)
    57  }
    58  
    59  // GetLocalMeshPeers provides a mock function with given fields: topic
    60  func (_m *PubSubTracer) GetLocalMeshPeers(topic channels.Topic) []peer.ID {
    61  	ret := _m.Called(topic)
    62  
    63  	var r0 []peer.ID
    64  	if rf, ok := ret.Get(0).(func(channels.Topic) []peer.ID); ok {
    65  		r0 = rf(topic)
    66  	} else {
    67  		if ret.Get(0) != nil {
    68  			r0 = ret.Get(0).([]peer.ID)
    69  		}
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  // Graft provides a mock function with given fields: p, topic
    76  func (_m *PubSubTracer) Graft(p peer.ID, topic string) {
    77  	_m.Called(p, topic)
    78  }
    79  
    80  // Join provides a mock function with given fields: topic
    81  func (_m *PubSubTracer) Join(topic string) {
    82  	_m.Called(topic)
    83  }
    84  
    85  // LastHighestIHaveRPCSize provides a mock function with given fields:
    86  func (_m *PubSubTracer) LastHighestIHaveRPCSize() int64 {
    87  	ret := _m.Called()
    88  
    89  	var r0 int64
    90  	if rf, ok := ret.Get(0).(func() int64); ok {
    91  		r0 = rf()
    92  	} else {
    93  		r0 = ret.Get(0).(int64)
    94  	}
    95  
    96  	return r0
    97  }
    98  
    99  // Leave provides a mock function with given fields: topic
   100  func (_m *PubSubTracer) Leave(topic string) {
   101  	_m.Called(topic)
   102  }
   103  
   104  // Prune provides a mock function with given fields: p, topic
   105  func (_m *PubSubTracer) Prune(p peer.ID, topic string) {
   106  	_m.Called(p, topic)
   107  }
   108  
   109  // Ready provides a mock function with given fields:
   110  func (_m *PubSubTracer) Ready() <-chan struct{} {
   111  	ret := _m.Called()
   112  
   113  	var r0 <-chan struct{}
   114  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
   115  		r0 = rf()
   116  	} else {
   117  		if ret.Get(0) != nil {
   118  			r0 = ret.Get(0).(<-chan struct{})
   119  		}
   120  	}
   121  
   122  	return r0
   123  }
   124  
   125  // RecvRPC provides a mock function with given fields: rpc
   126  func (_m *PubSubTracer) RecvRPC(rpc *pubsub.RPC) {
   127  	_m.Called(rpc)
   128  }
   129  
   130  // RejectMessage provides a mock function with given fields: msg, reason
   131  func (_m *PubSubTracer) RejectMessage(msg *pubsub.Message, reason string) {
   132  	_m.Called(msg, reason)
   133  }
   134  
   135  // RemovePeer provides a mock function with given fields: p
   136  func (_m *PubSubTracer) RemovePeer(p peer.ID) {
   137  	_m.Called(p)
   138  }
   139  
   140  // SendRPC provides a mock function with given fields: rpc, p
   141  func (_m *PubSubTracer) SendRPC(rpc *pubsub.RPC, p peer.ID) {
   142  	_m.Called(rpc, p)
   143  }
   144  
   145  // Start provides a mock function with given fields: _a0
   146  func (_m *PubSubTracer) Start(_a0 irrecoverable.SignalerContext) {
   147  	_m.Called(_a0)
   148  }
   149  
   150  // ThrottlePeer provides a mock function with given fields: p
   151  func (_m *PubSubTracer) ThrottlePeer(p peer.ID) {
   152  	_m.Called(p)
   153  }
   154  
   155  // UndeliverableMessage provides a mock function with given fields: msg
   156  func (_m *PubSubTracer) UndeliverableMessage(msg *pubsub.Message) {
   157  	_m.Called(msg)
   158  }
   159  
   160  // ValidateMessage provides a mock function with given fields: msg
   161  func (_m *PubSubTracer) ValidateMessage(msg *pubsub.Message) {
   162  	_m.Called(msg)
   163  }
   164  
   165  // WasIHaveRPCSent provides a mock function with given fields: messageID
   166  func (_m *PubSubTracer) WasIHaveRPCSent(messageID string) bool {
   167  	ret := _m.Called(messageID)
   168  
   169  	var r0 bool
   170  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   171  		r0 = rf(messageID)
   172  	} else {
   173  		r0 = ret.Get(0).(bool)
   174  	}
   175  
   176  	return r0
   177  }
   178  
   179  type mockConstructorTestingTNewPubSubTracer interface {
   180  	mock.TestingT
   181  	Cleanup(func())
   182  }
   183  
   184  // NewPubSubTracer creates a new instance of PubSubTracer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   185  func NewPubSubTracer(t mockConstructorTestingTNewPubSubTracer) *PubSubTracer {
   186  	mock := &PubSubTracer{}
   187  	mock.Mock.Test(t)
   188  
   189  	t.Cleanup(func() { mock.AssertExpectations(t) })
   190  
   191  	return mock
   192  }