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.

1555 lines
38 KiB

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