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.

208 lines
4.3 KiB

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