github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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  // DuplicateMessageCount provides a mock function with given fields: _a0
    60  func (_m *PubSubTracer) DuplicateMessageCount(_a0 peer.ID) float64 {
    61  	ret := _m.Called(_a0)
    62  
    63  	var r0 float64
    64  	if rf, ok := ret.Get(0).(func(peer.ID) float64); ok {
    65  		r0 = rf(_a0)
    66  	} else {
    67  		r0 = ret.Get(0).(float64)
    68  	}
    69  
    70  	return r0
    71  }
    72  
    73  // GetLocalMeshPeers provides a mock function with given fields: topic
    74  func (_m *PubSubTracer) GetLocalMeshPeers(topic channels.Topic) []peer.ID {
    75  	ret := _m.Called(topic)
    76  
    77  	var r0 []peer.ID
    78  	if rf, ok := ret.Get(0).(func(channels.Topic) []peer.ID); ok {
    79  		r0 = rf(topic)
    80  	} else {
    81  		if ret.Get(0) != nil {
    82  			r0 = ret.Get(0).([]peer.ID)
    83  		}
    84  	}
    85  
    86  	return r0
    87  }
    88  
    89  // Graft provides a mock function with given fields: p, topic
    90  func (_m *PubSubTracer) Graft(p peer.ID, topic string) {
    91  	_m.Called(p, topic)
    92  }
    93  
    94  // Join provides a mock function with given fields: topic
    95  func (_m *PubSubTracer) Join(topic string) {
    96  	_m.Called(topic)
    97  }
    98  
    99  // LastHighestIHaveRPCSize provides a mock function with given fields:
   100  func (_m *PubSubTracer) LastHighestIHaveRPCSize() int64 {
   101  	ret := _m.Called()
   102  
   103  	var r0 int64
   104  	if rf, ok := ret.Get(0).(func() int64); ok {
   105  		r0 = rf()
   106  	} else {
   107  		r0 = ret.Get(0).(int64)
   108  	}
   109  
   110  	return r0
   111  }
   112  
   113  // Leave provides a mock function with given fields: topic
   114  func (_m *PubSubTracer) Leave(topic string) {
   115  	_m.Called(topic)
   116  }
   117  
   118  // Prune provides a mock function with given fields: p, topic
   119  func (_m *PubSubTracer) Prune(p peer.ID, topic string) {
   120  	_m.Called(p, topic)
   121  }
   122  
   123  // Ready provides a mock function with given fields:
   124  func (_m *PubSubTracer) Ready() <-chan struct{} {
   125  	ret := _m.Called()
   126  
   127  	var r0 <-chan struct{}
   128  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
   129  		r0 = rf()
   130  	} else {
   131  		if ret.Get(0) != nil {
   132  			r0 = ret.Get(0).(<-chan struct{})
   133  		}
   134  	}
   135  
   136  	return r0
   137  }
   138  
   139  // RecvRPC provides a mock function with given fields: rpc
   140  func (_m *PubSubTracer) RecvRPC(rpc *pubsub.RPC) {
   141  	_m.Called(rpc)
   142  }
   143  
   144  // RejectMessage provides a mock function with given fields: msg, reason
   145  func (_m *PubSubTracer) RejectMessage(msg *pubsub.Message, reason string) {
   146  	_m.Called(msg, reason)
   147  }
   148  
   149  // RemovePeer provides a mock function with given fields: p
   150  func (_m *PubSubTracer) RemovePeer(p peer.ID) {
   151  	_m.Called(p)
   152  }
   153  
   154  // SendRPC provides a mock function with given fields: rpc, p
   155  func (_m *PubSubTracer) SendRPC(rpc *pubsub.RPC, p peer.ID) {
   156  	_m.Called(rpc, p)
   157  }
   158  
   159  // Start provides a mock function with given fields: _a0
   160  func (_m *PubSubTracer) Start(_a0 irrecoverable.SignalerContext) {
   161  	_m.Called(_a0)
   162  }
   163  
   164  // ThrottlePeer provides a mock function with given fields: p
   165  func (_m *PubSubTracer) ThrottlePeer(p peer.ID) {
   166  	_m.Called(p)
   167  }
   168  
   169  // UndeliverableMessage provides a mock function with given fields: msg
   170  func (_m *PubSubTracer) UndeliverableMessage(msg *pubsub.Message) {
   171  	_m.Called(msg)
   172  }
   173  
   174  // ValidateMessage provides a mock function with given fields: msg
   175  func (_m *PubSubTracer) ValidateMessage(msg *pubsub.Message) {
   176  	_m.Called(msg)
   177  }
   178  
   179  // WasIHaveRPCSent provides a mock function with given fields: messageID
   180  func (_m *PubSubTracer) WasIHaveRPCSent(messageID string) bool {
   181  	ret := _m.Called(messageID)
   182  
   183  	var r0 bool
   184  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   185  		r0 = rf(messageID)
   186  	} else {
   187  		r0 = ret.Get(0).(bool)
   188  	}
   189  
   190  	return r0
   191  }
   192  
   193  type mockConstructorTestingTNewPubSubTracer interface {
   194  	mock.TestingT
   195  	Cleanup(func())
   196  }
   197  
   198  // 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.
   199  func NewPubSubTracer(t mockConstructorTestingTNewPubSubTracer) *PubSubTracer {
   200  	mock := &PubSubTracer{}
   201  	mock.Mock.Test(t)
   202  
   203  	t.Cleanup(func() { mock.AssertExpectations(t) })
   204  
   205  	return mock
   206  }