You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
4.2 KiB

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