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.

1463 lines
34 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/p2p/types.proto
  3. package p2p
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  8. io "io"
  9. math "math"
  10. math_bits "math/bits"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  21. type NetAddress struct {
  22. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  23. IP string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
  24. Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
  25. Str string `protobuf:"bytes,4,opt,name=str,proto3" json:"str,omitempty"`
  26. }
  27. func (m *NetAddress) Reset() { *m = NetAddress{} }
  28. func (m *NetAddress) String() string { return proto.CompactTextString(m) }
  29. func (*NetAddress) ProtoMessage() {}
  30. func (*NetAddress) Descriptor() ([]byte, []int) {
  31. return fileDescriptor_5c4320c1810ca85c, []int{0}
  32. }
  33. func (m *NetAddress) XXX_Unmarshal(b []byte) error {
  34. return m.Unmarshal(b)
  35. }
  36. func (m *NetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  37. if deterministic {
  38. return xxx_messageInfo_NetAddress.Marshal(b, m, deterministic)
  39. } else {
  40. b = b[:cap(b)]
  41. n, err := m.MarshalToSizedBuffer(b)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return b[:n], nil
  46. }
  47. }
  48. func (m *NetAddress) XXX_Merge(src proto.Message) {
  49. xxx_messageInfo_NetAddress.Merge(m, src)
  50. }
  51. func (m *NetAddress) XXX_Size() int {
  52. return m.Size()
  53. }
  54. func (m *NetAddress) XXX_DiscardUnknown() {
  55. xxx_messageInfo_NetAddress.DiscardUnknown(m)
  56. }
  57. var xxx_messageInfo_NetAddress proto.InternalMessageInfo
  58. func (m *NetAddress) GetID() string {
  59. if m != nil {
  60. return m.ID
  61. }
  62. return ""
  63. }
  64. func (m *NetAddress) GetIP() string {
  65. if m != nil {
  66. return m.IP
  67. }
  68. return ""
  69. }
  70. func (m *NetAddress) GetPort() uint32 {
  71. if m != nil {
  72. return m.Port
  73. }
  74. return 0
  75. }
  76. func (m *NetAddress) GetStr() string {
  77. if m != nil {
  78. return m.Str
  79. }
  80. return ""
  81. }
  82. type ProtocolVersion struct {
  83. P2P uint64 `protobuf:"varint,1,opt,name=p2p,proto3" json:"p2p,omitempty"`
  84. Block uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
  85. App uint64 `protobuf:"varint,3,opt,name=app,proto3" json:"app,omitempty"`
  86. }
  87. func (m *ProtocolVersion) Reset() { *m = ProtocolVersion{} }
  88. func (m *ProtocolVersion) String() string { return proto.CompactTextString(m) }
  89. func (*ProtocolVersion) ProtoMessage() {}
  90. func (*ProtocolVersion) Descriptor() ([]byte, []int) {
  91. return fileDescriptor_5c4320c1810ca85c, []int{1}
  92. }
  93. func (m *ProtocolVersion) XXX_Unmarshal(b []byte) error {
  94. return m.Unmarshal(b)
  95. }
  96. func (m *ProtocolVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  97. if deterministic {
  98. return xxx_messageInfo_ProtocolVersion.Marshal(b, m, deterministic)
  99. } else {
  100. b = b[:cap(b)]
  101. n, err := m.MarshalToSizedBuffer(b)
  102. if err != nil {
  103. return nil, err
  104. }
  105. return b[:n], nil
  106. }
  107. }
  108. func (m *ProtocolVersion) XXX_Merge(src proto.Message) {
  109. xxx_messageInfo_ProtocolVersion.Merge(m, src)
  110. }
  111. func (m *ProtocolVersion) XXX_Size() int {
  112. return m.Size()
  113. }
  114. func (m *ProtocolVersion) XXX_DiscardUnknown() {
  115. xxx_messageInfo_ProtocolVersion.DiscardUnknown(m)
  116. }
  117. var xxx_messageInfo_ProtocolVersion proto.InternalMessageInfo
  118. func (m *ProtocolVersion) GetP2P() uint64 {
  119. if m != nil {
  120. return m.P2P
  121. }
  122. return 0
  123. }
  124. func (m *ProtocolVersion) GetBlock() uint64 {
  125. if m != nil {
  126. return m.Block
  127. }
  128. return 0
  129. }
  130. func (m *ProtocolVersion) GetApp() uint64 {
  131. if m != nil {
  132. return m.App
  133. }
  134. return 0
  135. }
  136. type DefaultNodeInfo struct {
  137. ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"`
  138. DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"`
  139. ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"`
  140. Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
  141. Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
  142. Channels []byte `protobuf:"bytes,6,opt,name=channels,proto3" json:"channels,omitempty"`
  143. Moniker string `protobuf:"bytes,7,opt,name=moniker,proto3" json:"moniker,omitempty"`
  144. Other DefaultNodeInfoOther `protobuf:"bytes,8,opt,name=other,proto3" json:"other"`
  145. }
  146. func (m *DefaultNodeInfo) Reset() { *m = DefaultNodeInfo{} }
  147. func (m *DefaultNodeInfo) String() string { return proto.CompactTextString(m) }
  148. func (*DefaultNodeInfo) ProtoMessage() {}
  149. func (*DefaultNodeInfo) Descriptor() ([]byte, []int) {
  150. return fileDescriptor_5c4320c1810ca85c, []int{2}
  151. }
  152. func (m *DefaultNodeInfo) XXX_Unmarshal(b []byte) error {
  153. return m.Unmarshal(b)
  154. }
  155. func (m *DefaultNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  156. if deterministic {
  157. return xxx_messageInfo_DefaultNodeInfo.Marshal(b, m, deterministic)
  158. } else {
  159. b = b[:cap(b)]
  160. n, err := m.MarshalToSizedBuffer(b)
  161. if err != nil {
  162. return nil, err
  163. }
  164. return b[:n], nil
  165. }
  166. }
  167. func (m *DefaultNodeInfo) XXX_Merge(src proto.Message) {
  168. xxx_messageInfo_DefaultNodeInfo.Merge(m, src)
  169. }
  170. func (m *DefaultNodeInfo) XXX_Size() int {
  171. return m.Size()
  172. }
  173. func (m *DefaultNodeInfo) XXX_DiscardUnknown() {
  174. xxx_messageInfo_DefaultNodeInfo.DiscardUnknown(m)
  175. }
  176. var xxx_messageInfo_DefaultNodeInfo proto.InternalMessageInfo
  177. func (m *DefaultNodeInfo) GetProtocolVersion() ProtocolVersion {
  178. if m != nil {
  179. return m.ProtocolVersion
  180. }
  181. return ProtocolVersion{}
  182. }
  183. func (m *DefaultNodeInfo) GetDefaultNodeID() string {
  184. if m != nil {
  185. return m.DefaultNodeID
  186. }
  187. return ""
  188. }
  189. func (m *DefaultNodeInfo) GetListenAddr() string {
  190. if m != nil {
  191. return m.ListenAddr
  192. }
  193. return ""
  194. }
  195. func (m *DefaultNodeInfo) GetNetwork() string {
  196. if m != nil {
  197. return m.Network
  198. }
  199. return ""
  200. }
  201. func (m *DefaultNodeInfo) GetVersion() string {
  202. if m != nil {
  203. return m.Version
  204. }
  205. return ""
  206. }
  207. func (m *DefaultNodeInfo) GetChannels() []byte {
  208. if m != nil {
  209. return m.Channels
  210. }
  211. return nil
  212. }
  213. func (m *DefaultNodeInfo) GetMoniker() string {
  214. if m != nil {
  215. return m.Moniker
  216. }
  217. return ""
  218. }
  219. func (m *DefaultNodeInfo) GetOther() DefaultNodeInfoOther {
  220. if m != nil {
  221. return m.Other
  222. }
  223. return DefaultNodeInfoOther{}
  224. }
  225. type DefaultNodeInfoOther struct {
  226. TxIndex string `protobuf:"bytes,1,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
  227. RPCAddress string `protobuf:"bytes,2,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"`
  228. }
  229. func (m *DefaultNodeInfoOther) Reset() { *m = DefaultNodeInfoOther{} }
  230. func (m *DefaultNodeInfoOther) String() string { return proto.CompactTextString(m) }
  231. func (*DefaultNodeInfoOther) ProtoMessage() {}
  232. func (*DefaultNodeInfoOther) Descriptor() ([]byte, []int) {
  233. return fileDescriptor_5c4320c1810ca85c, []int{3}
  234. }
  235. func (m *DefaultNodeInfoOther) XXX_Unmarshal(b []byte) error {
  236. return m.Unmarshal(b)
  237. }
  238. func (m *DefaultNodeInfoOther) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  239. if deterministic {
  240. return xxx_messageInfo_DefaultNodeInfoOther.Marshal(b, m, deterministic)
  241. } else {
  242. b = b[:cap(b)]
  243. n, err := m.MarshalToSizedBuffer(b)
  244. if err != nil {
  245. return nil, err
  246. }
  247. return b[:n], nil
  248. }
  249. }
  250. func (m *DefaultNodeInfoOther) XXX_Merge(src proto.Message) {
  251. xxx_messageInfo_DefaultNodeInfoOther.Merge(m, src)
  252. }
  253. func (m *DefaultNodeInfoOther) XXX_Size() int {
  254. return m.Size()
  255. }
  256. func (m *DefaultNodeInfoOther) XXX_DiscardUnknown() {
  257. xxx_messageInfo_DefaultNodeInfoOther.DiscardUnknown(m)
  258. }
  259. var xxx_messageInfo_DefaultNodeInfoOther proto.InternalMessageInfo
  260. func (m *DefaultNodeInfoOther) GetTxIndex() string {
  261. if m != nil {
  262. return m.TxIndex
  263. }
  264. return ""
  265. }
  266. func (m *DefaultNodeInfoOther) GetRPCAddress() string {
  267. if m != nil {
  268. return m.RPCAddress
  269. }
  270. return ""
  271. }
  272. func init() {
  273. proto.RegisterType((*NetAddress)(nil), "tendermint.proto.p2p.NetAddress")
  274. proto.RegisterType((*ProtocolVersion)(nil), "tendermint.proto.p2p.ProtocolVersion")
  275. proto.RegisterType((*DefaultNodeInfo)(nil), "tendermint.proto.p2p.DefaultNodeInfo")
  276. proto.RegisterType((*DefaultNodeInfoOther)(nil), "tendermint.proto.p2p.DefaultNodeInfoOther")
  277. }
  278. func init() { proto.RegisterFile("proto/p2p/types.proto", fileDescriptor_5c4320c1810ca85c) }
  279. var fileDescriptor_5c4320c1810ca85c = []byte{
  280. // 496 bytes of a gzipped FileDescriptorProto
  281. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x4f, 0x6f, 0xda, 0x30,
  282. 0x18, 0xc6, 0x49, 0x08, 0x7f, 0xfa, 0x32, 0x46, 0x67, 0xb1, 0x29, 0xed, 0x21, 0x41, 0x48, 0x9b,
  283. 0x50, 0x0f, 0x20, 0xb1, 0xd3, 0x8e, 0x63, 0x68, 0x12, 0x97, 0x0e, 0x59, 0x53, 0x0f, 0xbb, 0x44,
  284. 0x10, 0xbb, 0x60, 0x01, 0xb6, 0xe5, 0xb8, 0x1b, 0xfd, 0x16, 0xfb, 0x58, 0x3d, 0xf6, 0xb8, 0x13,
  285. 0x9a, 0xc2, 0x87, 0xd8, 0x75, 0xb2, 0x9d, 0xb6, 0x08, 0x71, 0x7b, 0x9e, 0xd7, 0x7e, 0xf3, 0xbc,
  286. 0xef, 0x4f, 0x0e, 0xbc, 0x95, 0x4a, 0x68, 0x31, 0x90, 0x43, 0x39, 0xd0, 0xf7, 0x92, 0x66, 0x7d,
  287. 0xeb, 0x51, 0x5b, 0x53, 0x4e, 0xa8, 0xda, 0x30, 0xae, 0x5d, 0xa5, 0x2f, 0x87, 0xf2, 0xf2, 0x83,
  288. 0x5e, 0x32, 0x45, 0x12, 0x39, 0x53, 0xfa, 0x7e, 0xe0, 0x1a, 0x17, 0x62, 0x21, 0x5e, 0x94, 0xbb,
  289. 0xdb, 0x9d, 0x03, 0x5c, 0x53, 0xfd, 0x99, 0x10, 0x45, 0xb3, 0x0c, 0xbd, 0x03, 0x9f, 0x91, 0xd0,
  290. 0xeb, 0x78, 0xbd, 0xb3, 0x51, 0x35, 0xdf, 0xc5, 0xfe, 0x64, 0x8c, 0x7d, 0x46, 0x6c, 0x5d, 0x86,
  291. 0xfe, 0x41, 0x7d, 0x8a, 0x7d, 0x26, 0x11, 0x82, 0x40, 0x0a, 0xa5, 0xc3, 0x72, 0xc7, 0xeb, 0x35,
  292. 0xb1, 0xd5, 0xe8, 0x1c, 0xca, 0x99, 0x56, 0x61, 0x60, 0x2e, 0x63, 0x23, 0xbb, 0xdf, 0xa1, 0x35,
  293. 0x35, 0x61, 0xa9, 0x58, 0xdf, 0x50, 0x95, 0x31, 0xc1, 0xd1, 0x05, 0x94, 0xe5, 0x50, 0xda, 0xa4,
  294. 0x60, 0x54, 0xcb, 0x77, 0x71, 0x79, 0x3a, 0x9c, 0x62, 0x53, 0x43, 0x6d, 0xa8, 0xcc, 0xd7, 0x22,
  295. 0x5d, 0xd9, 0xb8, 0x00, 0x3b, 0x63, 0xbe, 0x3a, 0x93, 0xd2, 0x06, 0x05, 0xd8, 0xc8, 0xee, 0x3f,
  296. 0x1f, 0x5a, 0x63, 0x7a, 0x3b, 0xbb, 0x5b, 0xeb, 0x6b, 0x41, 0xe8, 0x84, 0xdf, 0x0a, 0x74, 0x03,
  297. 0xe7, 0xb2, 0x48, 0x4a, 0x7e, 0xba, 0x28, 0x9b, 0xd1, 0x18, 0xbe, 0xef, 0x9f, 0xc2, 0xd4, 0x3f,
  298. 0x9a, 0x6b, 0x14, 0x3c, 0xec, 0xe2, 0x12, 0x6e, 0xc9, 0xa3, 0x71, 0x3f, 0x41, 0x8b, 0xb8, 0xa8,
  299. 0x84, 0x0b, 0x42, 0x13, 0x46, 0x0a, 0x18, 0x6f, 0xf2, 0x5d, 0xdc, 0x3c, 0x9c, 0x62, 0x8c, 0x9b,
  300. 0xe4, 0xc0, 0x12, 0x14, 0x43, 0x63, 0xcd, 0x32, 0x4d, 0x79, 0x32, 0x23, 0x44, 0xd9, 0x05, 0xce,
  301. 0x30, 0xb8, 0x92, 0xc1, 0x8e, 0x42, 0xa8, 0x71, 0xaa, 0x7f, 0x09, 0xb5, 0x2a, 0x98, 0x3d, 0x59,
  302. 0x73, 0xf2, 0xb4, 0x44, 0xc5, 0x9d, 0x14, 0x16, 0x5d, 0x42, 0x3d, 0x5d, 0xce, 0x38, 0xa7, 0xeb,
  303. 0x2c, 0xac, 0x76, 0xbc, 0xde, 0x2b, 0xfc, 0xec, 0x4d, 0xd7, 0x46, 0x70, 0xb6, 0xa2, 0x2a, 0xac,
  304. 0xb9, 0xae, 0xc2, 0xa2, 0xaf, 0x50, 0x11, 0x7a, 0x49, 0x55, 0x58, 0xb7, 0x48, 0xae, 0x4e, 0x23,
  305. 0x39, 0x62, 0xfa, 0xcd, 0x74, 0x14, 0x5c, 0x5c, 0x7b, 0x77, 0x0e, 0xed, 0x53, 0x97, 0xd0, 0x05,
  306. 0xd4, 0xf5, 0x36, 0x61, 0x9c, 0xd0, 0xad, 0x7b, 0x43, 0xb8, 0xa6, 0xb7, 0x13, 0x63, 0xd1, 0x00,
  307. 0x1a, 0x4a, 0xa6, 0x16, 0x01, 0xcd, 0xb2, 0x02, 0xde, 0xeb, 0x7c, 0x17, 0x03, 0x9e, 0x7e, 0x29,
  308. 0x5e, 0x1f, 0x06, 0x25, 0xd3, 0x42, 0x8f, 0xc6, 0x0f, 0x79, 0xe4, 0x3d, 0xe6, 0x91, 0xf7, 0x37,
  309. 0x8f, 0xbc, 0xdf, 0xfb, 0xa8, 0xf4, 0xb8, 0x8f, 0x4a, 0x7f, 0xf6, 0x51, 0xe9, 0xc7, 0xd5, 0x82,
  310. 0xe9, 0xe5, 0xdd, 0xbc, 0x9f, 0x8a, 0xcd, 0xe0, 0x65, 0x81, 0x43, 0xf9, 0xfc, 0x9f, 0xcc, 0xab,
  311. 0x56, 0x7e, 0xfc, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x57, 0xdb, 0x7b, 0x33, 0x3b, 0x03, 0x00, 0x00,
  312. }
  313. func (m *NetAddress) Marshal() (dAtA []byte, err error) {
  314. size := m.Size()
  315. dAtA = make([]byte, size)
  316. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  317. if err != nil {
  318. return nil, err
  319. }
  320. return dAtA[:n], nil
  321. }
  322. func (m *NetAddress) MarshalTo(dAtA []byte) (int, error) {
  323. size := m.Size()
  324. return m.MarshalToSizedBuffer(dAtA[:size])
  325. }
  326. func (m *NetAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  327. i := len(dAtA)
  328. _ = i
  329. var l int
  330. _ = l
  331. if len(m.Str) > 0 {
  332. i -= len(m.Str)
  333. copy(dAtA[i:], m.Str)
  334. i = encodeVarintTypes(dAtA, i, uint64(len(m.Str)))
  335. i--
  336. dAtA[i] = 0x22
  337. }
  338. if m.Port != 0 {
  339. i = encodeVarintTypes(dAtA, i, uint64(m.Port))
  340. i--
  341. dAtA[i] = 0x18
  342. }
  343. if len(m.IP) > 0 {
  344. i -= len(m.IP)
  345. copy(dAtA[i:], m.IP)
  346. i = encodeVarintTypes(dAtA, i, uint64(len(m.IP)))
  347. i--
  348. dAtA[i] = 0x12
  349. }
  350. if len(m.ID) > 0 {
  351. i -= len(m.ID)
  352. copy(dAtA[i:], m.ID)
  353. i = encodeVarintTypes(dAtA, i, uint64(len(m.ID)))
  354. i--
  355. dAtA[i] = 0xa
  356. }
  357. return len(dAtA) - i, nil
  358. }
  359. func (m *ProtocolVersion) Marshal() (dAtA []byte, err error) {
  360. size := m.Size()
  361. dAtA = make([]byte, size)
  362. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  363. if err != nil {
  364. return nil, err
  365. }
  366. return dAtA[:n], nil
  367. }
  368. func (m *ProtocolVersion) MarshalTo(dAtA []byte) (int, error) {
  369. size := m.Size()
  370. return m.MarshalToSizedBuffer(dAtA[:size])
  371. }
  372. func (m *ProtocolVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  373. i := len(dAtA)
  374. _ = i
  375. var l int
  376. _ = l
  377. if m.App != 0 {
  378. i = encodeVarintTypes(dAtA, i, uint64(m.App))
  379. i--
  380. dAtA[i] = 0x18
  381. }
  382. if m.Block != 0 {
  383. i = encodeVarintTypes(dAtA, i, uint64(m.Block))
  384. i--
  385. dAtA[i] = 0x10
  386. }
  387. if m.P2P != 0 {
  388. i = encodeVarintTypes(dAtA, i, uint64(m.P2P))
  389. i--
  390. dAtA[i] = 0x8
  391. }
  392. return len(dAtA) - i, nil
  393. }
  394. func (m *DefaultNodeInfo) Marshal() (dAtA []byte, err error) {
  395. size := m.Size()
  396. dAtA = make([]byte, size)
  397. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  398. if err != nil {
  399. return nil, err
  400. }
  401. return dAtA[:n], nil
  402. }
  403. func (m *DefaultNodeInfo) MarshalTo(dAtA []byte) (int, error) {
  404. size := m.Size()
  405. return m.MarshalToSizedBuffer(dAtA[:size])
  406. }
  407. func (m *DefaultNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  408. i := len(dAtA)
  409. _ = i
  410. var l int
  411. _ = l
  412. {
  413. size, err := m.Other.MarshalToSizedBuffer(dAtA[:i])
  414. if err != nil {
  415. return 0, err
  416. }
  417. i -= size
  418. i = encodeVarintTypes(dAtA, i, uint64(size))
  419. }
  420. i--
  421. dAtA[i] = 0x42
  422. if len(m.Moniker) > 0 {
  423. i -= len(m.Moniker)
  424. copy(dAtA[i:], m.Moniker)
  425. i = encodeVarintTypes(dAtA, i, uint64(len(m.Moniker)))
  426. i--
  427. dAtA[i] = 0x3a
  428. }
  429. if len(m.Channels) > 0 {
  430. i -= len(m.Channels)
  431. copy(dAtA[i:], m.Channels)
  432. i = encodeVarintTypes(dAtA, i, uint64(len(m.Channels)))
  433. i--
  434. dAtA[i] = 0x32
  435. }
  436. if len(m.Version) > 0 {
  437. i -= len(m.Version)
  438. copy(dAtA[i:], m.Version)
  439. i = encodeVarintTypes(dAtA, i, uint64(len(m.Version)))
  440. i--
  441. dAtA[i] = 0x2a
  442. }
  443. if len(m.Network) > 0 {
  444. i -= len(m.Network)
  445. copy(dAtA[i:], m.Network)
  446. i = encodeVarintTypes(dAtA, i, uint64(len(m.Network)))
  447. i--
  448. dAtA[i] = 0x22
  449. }
  450. if len(m.ListenAddr) > 0 {
  451. i -= len(m.ListenAddr)
  452. copy(dAtA[i:], m.ListenAddr)
  453. i = encodeVarintTypes(dAtA, i, uint64(len(m.ListenAddr)))
  454. i--
  455. dAtA[i] = 0x1a
  456. }
  457. if len(m.DefaultNodeID) > 0 {
  458. i -= len(m.DefaultNodeID)
  459. copy(dAtA[i:], m.DefaultNodeID)
  460. i = encodeVarintTypes(dAtA, i, uint64(len(m.DefaultNodeID)))
  461. i--
  462. dAtA[i] = 0x12
  463. }
  464. {
  465. size, err := m.ProtocolVersion.MarshalToSizedBuffer(dAtA[:i])
  466. if err != nil {
  467. return 0, err
  468. }
  469. i -= size
  470. i = encodeVarintTypes(dAtA, i, uint64(size))
  471. }
  472. i--
  473. dAtA[i] = 0xa
  474. return len(dAtA) - i, nil
  475. }
  476. func (m *DefaultNodeInfoOther) Marshal() (dAtA []byte, err error) {
  477. size := m.Size()
  478. dAtA = make([]byte, size)
  479. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  480. if err != nil {
  481. return nil, err
  482. }
  483. return dAtA[:n], nil
  484. }
  485. func (m *DefaultNodeInfoOther) MarshalTo(dAtA []byte) (int, error) {
  486. size := m.Size()
  487. return m.MarshalToSizedBuffer(dAtA[:size])
  488. }
  489. func (m *DefaultNodeInfoOther) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  490. i := len(dAtA)
  491. _ = i
  492. var l int
  493. _ = l
  494. if len(m.RPCAddress) > 0 {
  495. i -= len(m.RPCAddress)
  496. copy(dAtA[i:], m.RPCAddress)
  497. i = encodeVarintTypes(dAtA, i, uint64(len(m.RPCAddress)))
  498. i--
  499. dAtA[i] = 0x12
  500. }
  501. if len(m.TxIndex) > 0 {
  502. i -= len(m.TxIndex)
  503. copy(dAtA[i:], m.TxIndex)
  504. i = encodeVarintTypes(dAtA, i, uint64(len(m.TxIndex)))
  505. i--
  506. dAtA[i] = 0xa
  507. }
  508. return len(dAtA) - i, nil
  509. }
  510. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  511. offset -= sovTypes(v)
  512. base := offset
  513. for v >= 1<<7 {
  514. dAtA[offset] = uint8(v&0x7f | 0x80)
  515. v >>= 7
  516. offset++
  517. }
  518. dAtA[offset] = uint8(v)
  519. return base
  520. }
  521. func (m *NetAddress) Size() (n int) {
  522. if m == nil {
  523. return 0
  524. }
  525. var l int
  526. _ = l
  527. l = len(m.ID)
  528. if l > 0 {
  529. n += 1 + l + sovTypes(uint64(l))
  530. }
  531. l = len(m.IP)
  532. if l > 0 {
  533. n += 1 + l + sovTypes(uint64(l))
  534. }
  535. if m.Port != 0 {
  536. n += 1 + sovTypes(uint64(m.Port))
  537. }
  538. l = len(m.Str)
  539. if l > 0 {
  540. n += 1 + l + sovTypes(uint64(l))
  541. }
  542. return n
  543. }
  544. func (m *ProtocolVersion) Size() (n int) {
  545. if m == nil {
  546. return 0
  547. }
  548. var l int
  549. _ = l
  550. if m.P2P != 0 {
  551. n += 1 + sovTypes(uint64(m.P2P))
  552. }
  553. if m.Block != 0 {
  554. n += 1 + sovTypes(uint64(m.Block))
  555. }
  556. if m.App != 0 {
  557. n += 1 + sovTypes(uint64(m.App))
  558. }
  559. return n
  560. }
  561. func (m *DefaultNodeInfo) Size() (n int) {
  562. if m == nil {
  563. return 0
  564. }
  565. var l int
  566. _ = l
  567. l = m.ProtocolVersion.Size()
  568. n += 1 + l + sovTypes(uint64(l))
  569. l = len(m.DefaultNodeID)
  570. if l > 0 {
  571. n += 1 + l + sovTypes(uint64(l))
  572. }
  573. l = len(m.ListenAddr)
  574. if l > 0 {
  575. n += 1 + l + sovTypes(uint64(l))
  576. }
  577. l = len(m.Network)
  578. if l > 0 {
  579. n += 1 + l + sovTypes(uint64(l))
  580. }
  581. l = len(m.Version)
  582. if l > 0 {
  583. n += 1 + l + sovTypes(uint64(l))
  584. }
  585. l = len(m.Channels)
  586. if l > 0 {
  587. n += 1 + l + sovTypes(uint64(l))
  588. }
  589. l = len(m.Moniker)
  590. if l > 0 {
  591. n += 1 + l + sovTypes(uint64(l))
  592. }
  593. l = m.Other.Size()
  594. n += 1 + l + sovTypes(uint64(l))
  595. return n
  596. }
  597. func (m *DefaultNodeInfoOther) Size() (n int) {
  598. if m == nil {
  599. return 0
  600. }
  601. var l int
  602. _ = l
  603. l = len(m.TxIndex)
  604. if l > 0 {
  605. n += 1 + l + sovTypes(uint64(l))
  606. }
  607. l = len(m.RPCAddress)
  608. if l > 0 {
  609. n += 1 + l + sovTypes(uint64(l))
  610. }
  611. return n
  612. }
  613. func sovTypes(x uint64) (n int) {
  614. return (math_bits.Len64(x|1) + 6) / 7
  615. }
  616. func sozTypes(x uint64) (n int) {
  617. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  618. }
  619. func (m *NetAddress) Unmarshal(dAtA []byte) error {
  620. l := len(dAtA)
  621. iNdEx := 0
  622. for iNdEx < l {
  623. preIndex := iNdEx
  624. var wire uint64
  625. for shift := uint(0); ; shift += 7 {
  626. if shift >= 64 {
  627. return ErrIntOverflowTypes
  628. }
  629. if iNdEx >= l {
  630. return io.ErrUnexpectedEOF
  631. }
  632. b := dAtA[iNdEx]
  633. iNdEx++
  634. wire |= uint64(b&0x7F) << shift
  635. if b < 0x80 {
  636. break
  637. }
  638. }
  639. fieldNum := int32(wire >> 3)
  640. wireType := int(wire & 0x7)
  641. if wireType == 4 {
  642. return fmt.Errorf("proto: NetAddress: wiretype end group for non-group")
  643. }
  644. if fieldNum <= 0 {
  645. return fmt.Errorf("proto: NetAddress: illegal tag %d (wire type %d)", fieldNum, wire)
  646. }
  647. switch fieldNum {
  648. case 1:
  649. if wireType != 2 {
  650. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  651. }
  652. var stringLen uint64
  653. for shift := uint(0); ; shift += 7 {
  654. if shift >= 64 {
  655. return ErrIntOverflowTypes
  656. }
  657. if iNdEx >= l {
  658. return io.ErrUnexpectedEOF
  659. }
  660. b := dAtA[iNdEx]
  661. iNdEx++
  662. stringLen |= uint64(b&0x7F) << shift
  663. if b < 0x80 {
  664. break
  665. }
  666. }
  667. intStringLen := int(stringLen)
  668. if intStringLen < 0 {
  669. return ErrInvalidLengthTypes
  670. }
  671. postIndex := iNdEx + intStringLen
  672. if postIndex < 0 {
  673. return ErrInvalidLengthTypes
  674. }
  675. if postIndex > l {
  676. return io.ErrUnexpectedEOF
  677. }
  678. m.ID = string(dAtA[iNdEx:postIndex])
  679. iNdEx = postIndex
  680. case 2:
  681. if wireType != 2 {
  682. return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType)
  683. }
  684. var stringLen uint64
  685. for shift := uint(0); ; shift += 7 {
  686. if shift >= 64 {
  687. return ErrIntOverflowTypes
  688. }
  689. if iNdEx >= l {
  690. return io.ErrUnexpectedEOF
  691. }
  692. b := dAtA[iNdEx]
  693. iNdEx++
  694. stringLen |= uint64(b&0x7F) << shift
  695. if b < 0x80 {
  696. break
  697. }
  698. }
  699. intStringLen := int(stringLen)
  700. if intStringLen < 0 {
  701. return ErrInvalidLengthTypes
  702. }
  703. postIndex := iNdEx + intStringLen
  704. if postIndex < 0 {
  705. return ErrInvalidLengthTypes
  706. }
  707. if postIndex > l {
  708. return io.ErrUnexpectedEOF
  709. }
  710. m.IP = string(dAtA[iNdEx:postIndex])
  711. iNdEx = postIndex
  712. case 3:
  713. if wireType != 0 {
  714. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  715. }
  716. m.Port = 0
  717. for shift := uint(0); ; shift += 7 {
  718. if shift >= 64 {
  719. return ErrIntOverflowTypes
  720. }
  721. if iNdEx >= l {
  722. return io.ErrUnexpectedEOF
  723. }
  724. b := dAtA[iNdEx]
  725. iNdEx++
  726. m.Port |= uint32(b&0x7F) << shift
  727. if b < 0x80 {
  728. break
  729. }
  730. }
  731. case 4:
  732. if wireType != 2 {
  733. return fmt.Errorf("proto: wrong wireType = %d for field Str", wireType)
  734. }
  735. var stringLen uint64
  736. for shift := uint(0); ; shift += 7 {
  737. if shift >= 64 {
  738. return ErrIntOverflowTypes
  739. }
  740. if iNdEx >= l {
  741. return io.ErrUnexpectedEOF
  742. }
  743. b := dAtA[iNdEx]
  744. iNdEx++
  745. stringLen |= uint64(b&0x7F) << shift
  746. if b < 0x80 {
  747. break
  748. }
  749. }
  750. intStringLen := int(stringLen)
  751. if intStringLen < 0 {
  752. return ErrInvalidLengthTypes
  753. }
  754. postIndex := iNdEx + intStringLen
  755. if postIndex < 0 {
  756. return ErrInvalidLengthTypes
  757. }
  758. if postIndex > l {
  759. return io.ErrUnexpectedEOF
  760. }
  761. m.Str = string(dAtA[iNdEx:postIndex])
  762. iNdEx = postIndex
  763. default:
  764. iNdEx = preIndex
  765. skippy, err := skipTypes(dAtA[iNdEx:])
  766. if err != nil {
  767. return err
  768. }
  769. if skippy < 0 {
  770. return ErrInvalidLengthTypes
  771. }
  772. if (iNdEx + skippy) < 0 {
  773. return ErrInvalidLengthTypes
  774. }
  775. if (iNdEx + skippy) > l {
  776. return io.ErrUnexpectedEOF
  777. }
  778. iNdEx += skippy
  779. }
  780. }
  781. if iNdEx > l {
  782. return io.ErrUnexpectedEOF
  783. }
  784. return nil
  785. }
  786. func (m *ProtocolVersion) Unmarshal(dAtA []byte) error {
  787. l := len(dAtA)
  788. iNdEx := 0
  789. for iNdEx < l {
  790. preIndex := iNdEx
  791. var wire uint64
  792. for shift := uint(0); ; shift += 7 {
  793. if shift >= 64 {
  794. return ErrIntOverflowTypes
  795. }
  796. if iNdEx >= l {
  797. return io.ErrUnexpectedEOF
  798. }
  799. b := dAtA[iNdEx]
  800. iNdEx++
  801. wire |= uint64(b&0x7F) << shift
  802. if b < 0x80 {
  803. break
  804. }
  805. }
  806. fieldNum := int32(wire >> 3)
  807. wireType := int(wire & 0x7)
  808. if wireType == 4 {
  809. return fmt.Errorf("proto: ProtocolVersion: wiretype end group for non-group")
  810. }
  811. if fieldNum <= 0 {
  812. return fmt.Errorf("proto: ProtocolVersion: illegal tag %d (wire type %d)", fieldNum, wire)
  813. }
  814. switch fieldNum {
  815. case 1:
  816. if wireType != 0 {
  817. return fmt.Errorf("proto: wrong wireType = %d for field P2P", wireType)
  818. }
  819. m.P2P = 0
  820. for shift := uint(0); ; shift += 7 {
  821. if shift >= 64 {
  822. return ErrIntOverflowTypes
  823. }
  824. if iNdEx >= l {
  825. return io.ErrUnexpectedEOF
  826. }
  827. b := dAtA[iNdEx]
  828. iNdEx++
  829. m.P2P |= uint64(b&0x7F) << shift
  830. if b < 0x80 {
  831. break
  832. }
  833. }
  834. case 2:
  835. if wireType != 0 {
  836. return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
  837. }
  838. m.Block = 0
  839. for shift := uint(0); ; shift += 7 {
  840. if shift >= 64 {
  841. return ErrIntOverflowTypes
  842. }
  843. if iNdEx >= l {
  844. return io.ErrUnexpectedEOF
  845. }
  846. b := dAtA[iNdEx]
  847. iNdEx++
  848. m.Block |= uint64(b&0x7F) << shift
  849. if b < 0x80 {
  850. break
  851. }
  852. }
  853. case 3:
  854. if wireType != 0 {
  855. return fmt.Errorf("proto: wrong wireType = %d for field App", wireType)
  856. }
  857. m.App = 0
  858. for shift := uint(0); ; shift += 7 {
  859. if shift >= 64 {
  860. return ErrIntOverflowTypes
  861. }
  862. if iNdEx >= l {
  863. return io.ErrUnexpectedEOF
  864. }
  865. b := dAtA[iNdEx]
  866. iNdEx++
  867. m.App |= uint64(b&0x7F) << shift
  868. if b < 0x80 {
  869. break
  870. }
  871. }
  872. default:
  873. iNdEx = preIndex
  874. skippy, err := skipTypes(dAtA[iNdEx:])
  875. if err != nil {
  876. return err
  877. }
  878. if skippy < 0 {
  879. return ErrInvalidLengthTypes
  880. }
  881. if (iNdEx + skippy) < 0 {
  882. return ErrInvalidLengthTypes
  883. }
  884. if (iNdEx + skippy) > l {
  885. return io.ErrUnexpectedEOF
  886. }
  887. iNdEx += skippy
  888. }
  889. }
  890. if iNdEx > l {
  891. return io.ErrUnexpectedEOF
  892. }
  893. return nil
  894. }
  895. func (m *DefaultNodeInfo) Unmarshal(dAtA []byte) error {
  896. l := len(dAtA)
  897. iNdEx := 0
  898. for iNdEx < l {
  899. preIndex := iNdEx
  900. var wire uint64
  901. for shift := uint(0); ; shift += 7 {
  902. if shift >= 64 {
  903. return ErrIntOverflowTypes
  904. }
  905. if iNdEx >= l {
  906. return io.ErrUnexpectedEOF
  907. }
  908. b := dAtA[iNdEx]
  909. iNdEx++
  910. wire |= uint64(b&0x7F) << shift
  911. if b < 0x80 {
  912. break
  913. }
  914. }
  915. fieldNum := int32(wire >> 3)
  916. wireType := int(wire & 0x7)
  917. if wireType == 4 {
  918. return fmt.Errorf("proto: DefaultNodeInfo: wiretype end group for non-group")
  919. }
  920. if fieldNum <= 0 {
  921. return fmt.Errorf("proto: DefaultNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire)
  922. }
  923. switch fieldNum {
  924. case 1:
  925. if wireType != 2 {
  926. return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType)
  927. }
  928. var msglen int
  929. for shift := uint(0); ; shift += 7 {
  930. if shift >= 64 {
  931. return ErrIntOverflowTypes
  932. }
  933. if iNdEx >= l {
  934. return io.ErrUnexpectedEOF
  935. }
  936. b := dAtA[iNdEx]
  937. iNdEx++
  938. msglen |= int(b&0x7F) << shift
  939. if b < 0x80 {
  940. break
  941. }
  942. }
  943. if msglen < 0 {
  944. return ErrInvalidLengthTypes
  945. }
  946. postIndex := iNdEx + msglen
  947. if postIndex < 0 {
  948. return ErrInvalidLengthTypes
  949. }
  950. if postIndex > l {
  951. return io.ErrUnexpectedEOF
  952. }
  953. if err := m.ProtocolVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  954. return err
  955. }
  956. iNdEx = postIndex
  957. case 2:
  958. if wireType != 2 {
  959. return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeID", wireType)
  960. }
  961. var stringLen uint64
  962. for shift := uint(0); ; shift += 7 {
  963. if shift >= 64 {
  964. return ErrIntOverflowTypes
  965. }
  966. if iNdEx >= l {
  967. return io.ErrUnexpectedEOF
  968. }
  969. b := dAtA[iNdEx]
  970. iNdEx++
  971. stringLen |= uint64(b&0x7F) << shift
  972. if b < 0x80 {
  973. break
  974. }
  975. }
  976. intStringLen := int(stringLen)
  977. if intStringLen < 0 {
  978. return ErrInvalidLengthTypes
  979. }
  980. postIndex := iNdEx + intStringLen
  981. if postIndex < 0 {
  982. return ErrInvalidLengthTypes
  983. }
  984. if postIndex > l {
  985. return io.ErrUnexpectedEOF
  986. }
  987. m.DefaultNodeID = string(dAtA[iNdEx:postIndex])
  988. iNdEx = postIndex
  989. case 3:
  990. if wireType != 2 {
  991. return fmt.Errorf("proto: wrong wireType = %d for field ListenAddr", wireType)
  992. }
  993. var stringLen uint64
  994. for shift := uint(0); ; shift += 7 {
  995. if shift >= 64 {
  996. return ErrIntOverflowTypes
  997. }
  998. if iNdEx >= l {
  999. return io.ErrUnexpectedEOF
  1000. }
  1001. b := dAtA[iNdEx]
  1002. iNdEx++
  1003. stringLen |= uint64(b&0x7F) << shift
  1004. if b < 0x80 {
  1005. break
  1006. }
  1007. }
  1008. intStringLen := int(stringLen)
  1009. if intStringLen < 0 {
  1010. return ErrInvalidLengthTypes
  1011. }
  1012. postIndex := iNdEx + intStringLen
  1013. if postIndex < 0 {
  1014. return ErrInvalidLengthTypes
  1015. }
  1016. if postIndex > l {
  1017. return io.ErrUnexpectedEOF
  1018. }
  1019. m.ListenAddr = string(dAtA[iNdEx:postIndex])
  1020. iNdEx = postIndex
  1021. case 4:
  1022. if wireType != 2 {
  1023. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  1024. }
  1025. var stringLen uint64
  1026. for shift := uint(0); ; shift += 7 {
  1027. if shift >= 64 {
  1028. return ErrIntOverflowTypes
  1029. }
  1030. if iNdEx >= l {
  1031. return io.ErrUnexpectedEOF
  1032. }
  1033. b := dAtA[iNdEx]
  1034. iNdEx++
  1035. stringLen |= uint64(b&0x7F) << shift
  1036. if b < 0x80 {
  1037. break
  1038. }
  1039. }
  1040. intStringLen := int(stringLen)
  1041. if intStringLen < 0 {
  1042. return ErrInvalidLengthTypes
  1043. }
  1044. postIndex := iNdEx + intStringLen
  1045. if postIndex < 0 {
  1046. return ErrInvalidLengthTypes
  1047. }
  1048. if postIndex > l {
  1049. return io.ErrUnexpectedEOF
  1050. }
  1051. m.Network = string(dAtA[iNdEx:postIndex])
  1052. iNdEx = postIndex
  1053. case 5:
  1054. if wireType != 2 {
  1055. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1056. }
  1057. var stringLen uint64
  1058. for shift := uint(0); ; shift += 7 {
  1059. if shift >= 64 {
  1060. return ErrIntOverflowTypes
  1061. }
  1062. if iNdEx >= l {
  1063. return io.ErrUnexpectedEOF
  1064. }
  1065. b := dAtA[iNdEx]
  1066. iNdEx++
  1067. stringLen |= uint64(b&0x7F) << shift
  1068. if b < 0x80 {
  1069. break
  1070. }
  1071. }
  1072. intStringLen := int(stringLen)
  1073. if intStringLen < 0 {
  1074. return ErrInvalidLengthTypes
  1075. }
  1076. postIndex := iNdEx + intStringLen
  1077. if postIndex < 0 {
  1078. return ErrInvalidLengthTypes
  1079. }
  1080. if postIndex > l {
  1081. return io.ErrUnexpectedEOF
  1082. }
  1083. m.Version = string(dAtA[iNdEx:postIndex])
  1084. iNdEx = postIndex
  1085. case 6:
  1086. if wireType != 2 {
  1087. return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType)
  1088. }
  1089. var byteLen int
  1090. for shift := uint(0); ; shift += 7 {
  1091. if shift >= 64 {
  1092. return ErrIntOverflowTypes
  1093. }
  1094. if iNdEx >= l {
  1095. return io.ErrUnexpectedEOF
  1096. }
  1097. b := dAtA[iNdEx]
  1098. iNdEx++
  1099. byteLen |= int(b&0x7F) << shift
  1100. if b < 0x80 {
  1101. break
  1102. }
  1103. }
  1104. if byteLen < 0 {
  1105. return ErrInvalidLengthTypes
  1106. }
  1107. postIndex := iNdEx + byteLen
  1108. if postIndex < 0 {
  1109. return ErrInvalidLengthTypes
  1110. }
  1111. if postIndex > l {
  1112. return io.ErrUnexpectedEOF
  1113. }
  1114. m.Channels = append(m.Channels[:0], dAtA[iNdEx:postIndex]...)
  1115. if m.Channels == nil {
  1116. m.Channels = []byte{}
  1117. }
  1118. iNdEx = postIndex
  1119. case 7:
  1120. if wireType != 2 {
  1121. return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType)
  1122. }
  1123. var stringLen uint64
  1124. for shift := uint(0); ; shift += 7 {
  1125. if shift >= 64 {
  1126. return ErrIntOverflowTypes
  1127. }
  1128. if iNdEx >= l {
  1129. return io.ErrUnexpectedEOF
  1130. }
  1131. b := dAtA[iNdEx]
  1132. iNdEx++
  1133. stringLen |= uint64(b&0x7F) << shift
  1134. if b < 0x80 {
  1135. break
  1136. }
  1137. }
  1138. intStringLen := int(stringLen)
  1139. if intStringLen < 0 {
  1140. return ErrInvalidLengthTypes
  1141. }
  1142. postIndex := iNdEx + intStringLen
  1143. if postIndex < 0 {
  1144. return ErrInvalidLengthTypes
  1145. }
  1146. if postIndex > l {
  1147. return io.ErrUnexpectedEOF
  1148. }
  1149. m.Moniker = string(dAtA[iNdEx:postIndex])
  1150. iNdEx = postIndex
  1151. case 8:
  1152. if wireType != 2 {
  1153. return fmt.Errorf("proto: wrong wireType = %d for field Other", wireType)
  1154. }
  1155. var msglen int
  1156. for shift := uint(0); ; shift += 7 {
  1157. if shift >= 64 {
  1158. return ErrIntOverflowTypes
  1159. }
  1160. if iNdEx >= l {
  1161. return io.ErrUnexpectedEOF
  1162. }
  1163. b := dAtA[iNdEx]
  1164. iNdEx++
  1165. msglen |= int(b&0x7F) << shift
  1166. if b < 0x80 {
  1167. break
  1168. }
  1169. }
  1170. if msglen < 0 {
  1171. return ErrInvalidLengthTypes
  1172. }
  1173. postIndex := iNdEx + msglen
  1174. if postIndex < 0 {
  1175. return ErrInvalidLengthTypes
  1176. }
  1177. if postIndex > l {
  1178. return io.ErrUnexpectedEOF
  1179. }
  1180. if err := m.Other.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1181. return err
  1182. }
  1183. iNdEx = postIndex
  1184. default:
  1185. iNdEx = preIndex
  1186. skippy, err := skipTypes(dAtA[iNdEx:])
  1187. if err != nil {
  1188. return err
  1189. }
  1190. if skippy < 0 {
  1191. return ErrInvalidLengthTypes
  1192. }
  1193. if (iNdEx + skippy) < 0 {
  1194. return ErrInvalidLengthTypes
  1195. }
  1196. if (iNdEx + skippy) > l {
  1197. return io.ErrUnexpectedEOF
  1198. }
  1199. iNdEx += skippy
  1200. }
  1201. }
  1202. if iNdEx > l {
  1203. return io.ErrUnexpectedEOF
  1204. }
  1205. return nil
  1206. }
  1207. func (m *DefaultNodeInfoOther) Unmarshal(dAtA []byte) error {
  1208. l := len(dAtA)
  1209. iNdEx := 0
  1210. for iNdEx < l {
  1211. preIndex := iNdEx
  1212. var wire uint64
  1213. for shift := uint(0); ; shift += 7 {
  1214. if shift >= 64 {
  1215. return ErrIntOverflowTypes
  1216. }
  1217. if iNdEx >= l {
  1218. return io.ErrUnexpectedEOF
  1219. }
  1220. b := dAtA[iNdEx]
  1221. iNdEx++
  1222. wire |= uint64(b&0x7F) << shift
  1223. if b < 0x80 {
  1224. break
  1225. }
  1226. }
  1227. fieldNum := int32(wire >> 3)
  1228. wireType := int(wire & 0x7)
  1229. if wireType == 4 {
  1230. return fmt.Errorf("proto: DefaultNodeInfoOther: wiretype end group for non-group")
  1231. }
  1232. if fieldNum <= 0 {
  1233. return fmt.Errorf("proto: DefaultNodeInfoOther: illegal tag %d (wire type %d)", fieldNum, wire)
  1234. }
  1235. switch fieldNum {
  1236. case 1:
  1237. if wireType != 2 {
  1238. return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType)
  1239. }
  1240. var stringLen uint64
  1241. for shift := uint(0); ; shift += 7 {
  1242. if shift >= 64 {
  1243. return ErrIntOverflowTypes
  1244. }
  1245. if iNdEx >= l {
  1246. return io.ErrUnexpectedEOF
  1247. }
  1248. b := dAtA[iNdEx]
  1249. iNdEx++
  1250. stringLen |= uint64(b&0x7F) << shift
  1251. if b < 0x80 {
  1252. break
  1253. }
  1254. }
  1255. intStringLen := int(stringLen)
  1256. if intStringLen < 0 {
  1257. return ErrInvalidLengthTypes
  1258. }
  1259. postIndex := iNdEx + intStringLen
  1260. if postIndex < 0 {
  1261. return ErrInvalidLengthTypes
  1262. }
  1263. if postIndex > l {
  1264. return io.ErrUnexpectedEOF
  1265. }
  1266. m.TxIndex = string(dAtA[iNdEx:postIndex])
  1267. iNdEx = postIndex
  1268. case 2:
  1269. if wireType != 2 {
  1270. return fmt.Errorf("proto: wrong wireType = %d for field RPCAddress", wireType)
  1271. }
  1272. var stringLen uint64
  1273. for shift := uint(0); ; shift += 7 {
  1274. if shift >= 64 {
  1275. return ErrIntOverflowTypes
  1276. }
  1277. if iNdEx >= l {
  1278. return io.ErrUnexpectedEOF
  1279. }
  1280. b := dAtA[iNdEx]
  1281. iNdEx++
  1282. stringLen |= uint64(b&0x7F) << shift
  1283. if b < 0x80 {
  1284. break
  1285. }
  1286. }
  1287. intStringLen := int(stringLen)
  1288. if intStringLen < 0 {
  1289. return ErrInvalidLengthTypes
  1290. }
  1291. postIndex := iNdEx + intStringLen
  1292. if postIndex < 0 {
  1293. return ErrInvalidLengthTypes
  1294. }
  1295. if postIndex > l {
  1296. return io.ErrUnexpectedEOF
  1297. }
  1298. m.RPCAddress = string(dAtA[iNdEx:postIndex])
  1299. iNdEx = postIndex
  1300. default:
  1301. iNdEx = preIndex
  1302. skippy, err := skipTypes(dAtA[iNdEx:])
  1303. if err != nil {
  1304. return err
  1305. }
  1306. if skippy < 0 {
  1307. return ErrInvalidLengthTypes
  1308. }
  1309. if (iNdEx + skippy) < 0 {
  1310. return ErrInvalidLengthTypes
  1311. }
  1312. if (iNdEx + skippy) > l {
  1313. return io.ErrUnexpectedEOF
  1314. }
  1315. iNdEx += skippy
  1316. }
  1317. }
  1318. if iNdEx > l {
  1319. return io.ErrUnexpectedEOF
  1320. }
  1321. return nil
  1322. }
  1323. func skipTypes(dAtA []byte) (n int, err error) {
  1324. l := len(dAtA)
  1325. iNdEx := 0
  1326. depth := 0
  1327. for iNdEx < l {
  1328. var wire uint64
  1329. for shift := uint(0); ; shift += 7 {
  1330. if shift >= 64 {
  1331. return 0, ErrIntOverflowTypes
  1332. }
  1333. if iNdEx >= l {
  1334. return 0, io.ErrUnexpectedEOF
  1335. }
  1336. b := dAtA[iNdEx]
  1337. iNdEx++
  1338. wire |= (uint64(b) & 0x7F) << shift
  1339. if b < 0x80 {
  1340. break
  1341. }
  1342. }
  1343. wireType := int(wire & 0x7)
  1344. switch wireType {
  1345. case 0:
  1346. for shift := uint(0); ; shift += 7 {
  1347. if shift >= 64 {
  1348. return 0, ErrIntOverflowTypes
  1349. }
  1350. if iNdEx >= l {
  1351. return 0, io.ErrUnexpectedEOF
  1352. }
  1353. iNdEx++
  1354. if dAtA[iNdEx-1] < 0x80 {
  1355. break
  1356. }
  1357. }
  1358. case 1:
  1359. iNdEx += 8
  1360. case 2:
  1361. var length int
  1362. for shift := uint(0); ; shift += 7 {
  1363. if shift >= 64 {
  1364. return 0, ErrIntOverflowTypes
  1365. }
  1366. if iNdEx >= l {
  1367. return 0, io.ErrUnexpectedEOF
  1368. }
  1369. b := dAtA[iNdEx]
  1370. iNdEx++
  1371. length |= (int(b) & 0x7F) << shift
  1372. if b < 0x80 {
  1373. break
  1374. }
  1375. }
  1376. if length < 0 {
  1377. return 0, ErrInvalidLengthTypes
  1378. }
  1379. iNdEx += length
  1380. case 3:
  1381. depth++
  1382. case 4:
  1383. if depth == 0 {
  1384. return 0, ErrUnexpectedEndOfGroupTypes
  1385. }
  1386. depth--
  1387. case 5:
  1388. iNdEx += 4
  1389. default:
  1390. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1391. }
  1392. if iNdEx < 0 {
  1393. return 0, ErrInvalidLengthTypes
  1394. }
  1395. if depth == 0 {
  1396. return iNdEx, nil
  1397. }
  1398. }
  1399. return 0, io.ErrUnexpectedEOF
  1400. }
  1401. var (
  1402. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  1403. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  1404. ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
  1405. )