github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/internal/p2p/mocks/connection.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	context "context"
     7  
     8  	conn "github.com/ari-anchor/sei-tendermint/internal/p2p/conn"
     9  
    10  	crypto "github.com/ari-anchor/sei-tendermint/crypto"
    11  
    12  	mock "github.com/stretchr/testify/mock"
    13  
    14  	p2p "github.com/ari-anchor/sei-tendermint/internal/p2p"
    15  
    16  	types "github.com/ari-anchor/sei-tendermint/types"
    17  )
    18  
    19  // Connection is an autogenerated mock type for the Connection type
    20  type Connection struct {
    21  	mock.Mock
    22  }
    23  
    24  // Close provides a mock function with given fields:
    25  func (_m *Connection) Close() error {
    26  	ret := _m.Called()
    27  
    28  	var r0 error
    29  	if rf, ok := ret.Get(0).(func() error); ok {
    30  		r0 = rf()
    31  	} else {
    32  		r0 = ret.Error(0)
    33  	}
    34  
    35  	return r0
    36  }
    37  
    38  // Handshake provides a mock function with given fields: _a0, _a1, _a2
    39  func (_m *Connection) Handshake(_a0 context.Context, _a1 types.NodeInfo, _a2 crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error) {
    40  	ret := _m.Called(_a0, _a1, _a2)
    41  
    42  	var r0 types.NodeInfo
    43  	if rf, ok := ret.Get(0).(func(context.Context, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok {
    44  		r0 = rf(_a0, _a1, _a2)
    45  	} else {
    46  		r0 = ret.Get(0).(types.NodeInfo)
    47  	}
    48  
    49  	var r1 crypto.PubKey
    50  	if rf, ok := ret.Get(1).(func(context.Context, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok {
    51  		r1 = rf(_a0, _a1, _a2)
    52  	} else {
    53  		if ret.Get(1) != nil {
    54  			r1 = ret.Get(1).(crypto.PubKey)
    55  		}
    56  	}
    57  
    58  	var r2 error
    59  	if rf, ok := ret.Get(2).(func(context.Context, types.NodeInfo, crypto.PrivKey) error); ok {
    60  		r2 = rf(_a0, _a1, _a2)
    61  	} else {
    62  		r2 = ret.Error(2)
    63  	}
    64  
    65  	return r0, r1, r2
    66  }
    67  
    68  // LocalEndpoint provides a mock function with given fields:
    69  func (_m *Connection) LocalEndpoint() p2p.Endpoint {
    70  	ret := _m.Called()
    71  
    72  	var r0 p2p.Endpoint
    73  	if rf, ok := ret.Get(0).(func() p2p.Endpoint); ok {
    74  		r0 = rf()
    75  	} else {
    76  		r0 = ret.Get(0).(p2p.Endpoint)
    77  	}
    78  
    79  	return r0
    80  }
    81  
    82  // ReceiveMessage provides a mock function with given fields: _a0
    83  func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byte, error) {
    84  	ret := _m.Called(_a0)
    85  
    86  	var r0 conn.ChannelID
    87  	if rf, ok := ret.Get(0).(func(context.Context) conn.ChannelID); ok {
    88  		r0 = rf(_a0)
    89  	} else {
    90  		r0 = ret.Get(0).(conn.ChannelID)
    91  	}
    92  
    93  	var r1 []byte
    94  	if rf, ok := ret.Get(1).(func(context.Context) []byte); ok {
    95  		r1 = rf(_a0)
    96  	} else {
    97  		if ret.Get(1) != nil {
    98  			r1 = ret.Get(1).([]byte)
    99  		}
   100  	}
   101  
   102  	var r2 error
   103  	if rf, ok := ret.Get(2).(func(context.Context) error); ok {
   104  		r2 = rf(_a0)
   105  	} else {
   106  		r2 = ret.Error(2)
   107  	}
   108  
   109  	return r0, r1, r2
   110  }
   111  
   112  // RemoteEndpoint provides a mock function with given fields:
   113  func (_m *Connection) RemoteEndpoint() p2p.Endpoint {
   114  	ret := _m.Called()
   115  
   116  	var r0 p2p.Endpoint
   117  	if rf, ok := ret.Get(0).(func() p2p.Endpoint); ok {
   118  		r0 = rf()
   119  	} else {
   120  		r0 = ret.Get(0).(p2p.Endpoint)
   121  	}
   122  
   123  	return r0
   124  }
   125  
   126  // SendMessage provides a mock function with given fields: _a0, _a1, _a2
   127  func (_m *Connection) SendMessage(_a0 context.Context, _a1 conn.ChannelID, _a2 []byte) error {
   128  	ret := _m.Called(_a0, _a1, _a2)
   129  
   130  	var r0 error
   131  	if rf, ok := ret.Get(0).(func(context.Context, conn.ChannelID, []byte) error); ok {
   132  		r0 = rf(_a0, _a1, _a2)
   133  	} else {
   134  		r0 = ret.Error(0)
   135  	}
   136  
   137  	return r0
   138  }
   139  
   140  // String provides a mock function with given fields:
   141  func (_m *Connection) String() string {
   142  	ret := _m.Called()
   143  
   144  	var r0 string
   145  	if rf, ok := ret.Get(0).(func() string); ok {
   146  		r0 = rf()
   147  	} else {
   148  		r0 = ret.Get(0).(string)
   149  	}
   150  
   151  	return r0
   152  }
   153  
   154  type mockConstructorTestingTNewConnection interface {
   155  	mock.TestingT
   156  	Cleanup(func())
   157  }
   158  
   159  // NewConnection creates a new instance of Connection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   160  func NewConnection(t mockConstructorTestingTNewConnection) *Connection {
   161  	mock := &Connection{}
   162  	mock.Mock.Test(t)
   163  
   164  	t.Cleanup(func() { mock.AssertExpectations(t) })
   165  
   166  	return mock
   167  }