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.

493 lines
17 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/types/params.proto
  3. package types
  4. import (
  5. bytes "bytes"
  6. fmt "fmt"
  7. _ "github.com/gogo/protobuf/gogoproto"
  8. proto "github.com/gogo/protobuf/proto"
  9. github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
  10. _ "github.com/golang/protobuf/ptypes/duration"
  11. math "math"
  12. time "time"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. var _ = time.Kitchen
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  24. // ConsensusParams contains consensus critical parameters that determine the
  25. // validity of blocks.
  26. type ConsensusParams struct {
  27. Block BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block"`
  28. Evidence EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence"`
  29. Validator ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator"`
  30. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  31. XXX_unrecognized []byte `json:"-"`
  32. XXX_sizecache int32 `json:"-"`
  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 xxx_messageInfo_ConsensusParams.Unmarshal(m, b)
  42. }
  43. func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  44. return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic)
  45. }
  46. func (m *ConsensusParams) XXX_Merge(src proto.Message) {
  47. xxx_messageInfo_ConsensusParams.Merge(m, src)
  48. }
  49. func (m *ConsensusParams) XXX_Size() int {
  50. return xxx_messageInfo_ConsensusParams.Size(m)
  51. }
  52. func (m *ConsensusParams) XXX_DiscardUnknown() {
  53. xxx_messageInfo_ConsensusParams.DiscardUnknown(m)
  54. }
  55. var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo
  56. func (m *ConsensusParams) GetBlock() BlockParams {
  57. if m != nil {
  58. return m.Block
  59. }
  60. return BlockParams{}
  61. }
  62. func (m *ConsensusParams) GetEvidence() EvidenceParams {
  63. if m != nil {
  64. return m.Evidence
  65. }
  66. return EvidenceParams{}
  67. }
  68. func (m *ConsensusParams) GetValidator() ValidatorParams {
  69. if m != nil {
  70. return m.Validator
  71. }
  72. return ValidatorParams{}
  73. }
  74. // BlockParams contains limits on the block size.
  75. type BlockParams struct {
  76. // Note: must be greater than 0
  77. MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"`
  78. // Note: must be greater or equal to -1
  79. MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"`
  80. // Minimum time increment between consecutive blocks (in milliseconds)
  81. // Not exposed to the application.
  82. TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"`
  83. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  84. XXX_unrecognized []byte `json:"-"`
  85. XXX_sizecache int32 `json:"-"`
  86. }
  87. func (m *BlockParams) Reset() { *m = BlockParams{} }
  88. func (m *BlockParams) String() string { return proto.CompactTextString(m) }
  89. func (*BlockParams) ProtoMessage() {}
  90. func (*BlockParams) Descriptor() ([]byte, []int) {
  91. return fileDescriptor_95a9f934fa6f056c, []int{1}
  92. }
  93. func (m *BlockParams) XXX_Unmarshal(b []byte) error {
  94. return xxx_messageInfo_BlockParams.Unmarshal(m, b)
  95. }
  96. func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  97. return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic)
  98. }
  99. func (m *BlockParams) XXX_Merge(src proto.Message) {
  100. xxx_messageInfo_BlockParams.Merge(m, src)
  101. }
  102. func (m *BlockParams) XXX_Size() int {
  103. return xxx_messageInfo_BlockParams.Size(m)
  104. }
  105. func (m *BlockParams) XXX_DiscardUnknown() {
  106. xxx_messageInfo_BlockParams.DiscardUnknown(m)
  107. }
  108. var xxx_messageInfo_BlockParams proto.InternalMessageInfo
  109. func (m *BlockParams) GetMaxBytes() int64 {
  110. if m != nil {
  111. return m.MaxBytes
  112. }
  113. return 0
  114. }
  115. func (m *BlockParams) GetMaxGas() int64 {
  116. if m != nil {
  117. return m.MaxGas
  118. }
  119. return 0
  120. }
  121. func (m *BlockParams) GetTimeIotaMs() int64 {
  122. if m != nil {
  123. return m.TimeIotaMs
  124. }
  125. return 0
  126. }
  127. // EvidenceParams determine how we handle evidence of malfeasance.
  128. type EvidenceParams struct {
  129. // Note: must be greater than 0
  130. MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"`
  131. MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"`
  132. MaxNumEvidence uint32 `protobuf:"varint,1,opt,name=max_num_evidence,json=maxNumEvidence,proto3" json:"max_num_evidence,omitempty"`
  133. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  134. XXX_unrecognized []byte `json:"-"`
  135. XXX_sizecache int32 `json:"-"`
  136. }
  137. func (m *EvidenceParams) Reset() { *m = EvidenceParams{} }
  138. func (m *EvidenceParams) String() string { return proto.CompactTextString(m) }
  139. func (*EvidenceParams) ProtoMessage() {}
  140. func (*EvidenceParams) Descriptor() ([]byte, []int) {
  141. return fileDescriptor_95a9f934fa6f056c, []int{2}
  142. }
  143. func (m *EvidenceParams) XXX_Unmarshal(b []byte) error {
  144. return xxx_messageInfo_EvidenceParams.Unmarshal(m, b)
  145. }
  146. func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  147. return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic)
  148. }
  149. func (m *EvidenceParams) XXX_Merge(src proto.Message) {
  150. xxx_messageInfo_EvidenceParams.Merge(m, src)
  151. }
  152. func (m *EvidenceParams) XXX_Size() int {
  153. return xxx_messageInfo_EvidenceParams.Size(m)
  154. }
  155. func (m *EvidenceParams) XXX_DiscardUnknown() {
  156. xxx_messageInfo_EvidenceParams.DiscardUnknown(m)
  157. }
  158. var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo
  159. func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 {
  160. if m != nil {
  161. return m.MaxAgeNumBlocks
  162. }
  163. return 0
  164. }
  165. func (m *EvidenceParams) GetMaxAgeDuration() time.Duration {
  166. if m != nil {
  167. return m.MaxAgeDuration
  168. }
  169. return 0
  170. }
  171. func (m *EvidenceParams) GetMaxNumEvidence() uint32 {
  172. if m != nil {
  173. return m.MaxNumEvidence
  174. }
  175. return 0
  176. }
  177. // ValidatorParams restrict the public key types validators can use.
  178. // NOTE: uses ABCI pubkey naming, not Amino names.
  179. type ValidatorParams struct {
  180. PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"`
  181. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  182. XXX_unrecognized []byte `json:"-"`
  183. XXX_sizecache int32 `json:"-"`
  184. }
  185. func (m *ValidatorParams) Reset() { *m = ValidatorParams{} }
  186. func (m *ValidatorParams) String() string { return proto.CompactTextString(m) }
  187. func (*ValidatorParams) ProtoMessage() {}
  188. func (*ValidatorParams) Descriptor() ([]byte, []int) {
  189. return fileDescriptor_95a9f934fa6f056c, []int{3}
  190. }
  191. func (m *ValidatorParams) XXX_Unmarshal(b []byte) error {
  192. return xxx_messageInfo_ValidatorParams.Unmarshal(m, b)
  193. }
  194. func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  195. return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic)
  196. }
  197. func (m *ValidatorParams) XXX_Merge(src proto.Message) {
  198. xxx_messageInfo_ValidatorParams.Merge(m, src)
  199. }
  200. func (m *ValidatorParams) XXX_Size() int {
  201. return xxx_messageInfo_ValidatorParams.Size(m)
  202. }
  203. func (m *ValidatorParams) XXX_DiscardUnknown() {
  204. xxx_messageInfo_ValidatorParams.DiscardUnknown(m)
  205. }
  206. var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo
  207. func (m *ValidatorParams) GetPubKeyTypes() []string {
  208. if m != nil {
  209. return m.PubKeyTypes
  210. }
  211. return nil
  212. }
  213. // HashedParams is a subset of ConsensusParams.
  214. // It is amino encoded and hashed into
  215. // the Header.ConsensusHash.
  216. type HashedParams struct {
  217. BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"`
  218. BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"`
  219. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  220. XXX_unrecognized []byte `json:"-"`
  221. XXX_sizecache int32 `json:"-"`
  222. }
  223. func (m *HashedParams) Reset() { *m = HashedParams{} }
  224. func (m *HashedParams) String() string { return proto.CompactTextString(m) }
  225. func (*HashedParams) ProtoMessage() {}
  226. func (*HashedParams) Descriptor() ([]byte, []int) {
  227. return fileDescriptor_95a9f934fa6f056c, []int{4}
  228. }
  229. func (m *HashedParams) XXX_Unmarshal(b []byte) error {
  230. return xxx_messageInfo_HashedParams.Unmarshal(m, b)
  231. }
  232. func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  233. return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic)
  234. }
  235. func (m *HashedParams) XXX_Merge(src proto.Message) {
  236. xxx_messageInfo_HashedParams.Merge(m, src)
  237. }
  238. func (m *HashedParams) XXX_Size() int {
  239. return xxx_messageInfo_HashedParams.Size(m)
  240. }
  241. func (m *HashedParams) XXX_DiscardUnknown() {
  242. xxx_messageInfo_HashedParams.DiscardUnknown(m)
  243. }
  244. var xxx_messageInfo_HashedParams proto.InternalMessageInfo
  245. func (m *HashedParams) GetBlockMaxBytes() int64 {
  246. if m != nil {
  247. return m.BlockMaxBytes
  248. }
  249. return 0
  250. }
  251. func (m *HashedParams) GetBlockMaxGas() int64 {
  252. if m != nil {
  253. return m.BlockMaxGas
  254. }
  255. return 0
  256. }
  257. func init() {
  258. proto.RegisterType((*ConsensusParams)(nil), "tendermint.proto.types.ConsensusParams")
  259. proto.RegisterType((*BlockParams)(nil), "tendermint.proto.types.BlockParams")
  260. proto.RegisterType((*EvidenceParams)(nil), "tendermint.proto.types.EvidenceParams")
  261. proto.RegisterType((*ValidatorParams)(nil), "tendermint.proto.types.ValidatorParams")
  262. proto.RegisterType((*HashedParams)(nil), "tendermint.proto.types.HashedParams")
  263. }
  264. func init() { proto.RegisterFile("proto/types/params.proto", fileDescriptor_95a9f934fa6f056c) }
  265. var fileDescriptor_95a9f934fa6f056c = []byte{
  266. // 465 bytes of a gzipped FileDescriptorProto
  267. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xd1, 0x6e, 0xd3, 0x30,
  268. 0x14, 0x25, 0x04, 0x46, 0x7b, 0xbb, 0xae, 0xc8, 0x0f, 0x10, 0x86, 0x44, 0xab, 0x20, 0x95, 0x49,
  269. 0x20, 0x47, 0x82, 0x37, 0x5e, 0x26, 0x02, 0x68, 0x43, 0x53, 0x11, 0x8a, 0x10, 0x0f, 0x7b, 0xb1,
  270. 0x6e, 0x1a, 0x93, 0x46, 0xab, 0xe3, 0x28, 0x76, 0xa6, 0xe6, 0x47, 0x10, 0x8f, 0xfb, 0x0c, 0x3e,
  271. 0x81, 0xaf, 0x80, 0x57, 0xf8, 0x0b, 0x14, 0xbb, 0x21, 0xed, 0xb4, 0xbe, 0xd9, 0xf7, 0x9e, 0x73,
  272. 0x7c, 0xcf, 0xb9, 0x32, 0x78, 0x45, 0x29, 0xb5, 0x0c, 0x74, 0x5d, 0x70, 0x15, 0x14, 0x58, 0xa2,
  273. 0x50, 0xd4, 0x94, 0xc8, 0x03, 0xcd, 0xf3, 0x84, 0x97, 0x22, 0xcb, 0xb5, 0xad, 0x50, 0x03, 0x3a,
  274. 0x9c, 0xea, 0x45, 0x56, 0x26, 0xac, 0xc0, 0x52, 0xd7, 0x81, 0x65, 0xa7, 0x32, 0x95, 0xdd, 0xc9,
  275. 0xa2, 0x0f, 0x9f, 0xa4, 0x52, 0xa6, 0x4b, 0x6e, 0x21, 0x71, 0xf5, 0x35, 0x48, 0xaa, 0x12, 0x75,
  276. 0x26, 0x73, 0xdb, 0xf7, 0xff, 0x3a, 0x30, 0x7a, 0x2b, 0x73, 0xc5, 0x73, 0x55, 0xa9, 0x4f, 0xe6,
  277. 0x65, 0x72, 0x0c, 0x77, 0xe3, 0xa5, 0x9c, 0x5f, 0x78, 0xce, 0xc4, 0x39, 0x1a, 0xbc, 0x7c, 0x4a,
  278. 0x6f, 0x9e, 0x81, 0x86, 0x0d, 0xc8, 0x72, 0xc2, 0x3b, 0x3f, 0x7f, 0x8d, 0x6f, 0x45, 0x96, 0x47,
  279. 0x4e, 0xa1, 0xc7, 0x2f, 0xb3, 0x84, 0xe7, 0x73, 0xee, 0xdd, 0x36, 0x1a, 0xd3, 0x5d, 0x1a, 0xef,
  280. 0xd7, 0xb8, 0x2d, 0x99, 0xff, 0x6c, 0x72, 0x06, 0xfd, 0x4b, 0x5c, 0x66, 0x09, 0x6a, 0x59, 0x7a,
  281. 0xae, 0x91, 0x7a, 0xb6, 0x4b, 0xea, 0x4b, 0x0b, 0xdc, 0xd2, 0xea, 0xf8, 0x3e, 0x87, 0xc1, 0xc6,
  282. 0xc8, 0xe4, 0x31, 0xf4, 0x05, 0xae, 0x58, 0x5c, 0x6b, 0xae, 0x8c, 0x55, 0x37, 0xea, 0x09, 0x5c,
  283. 0x85, 0xcd, 0x9d, 0x3c, 0x84, 0x7b, 0x4d, 0x33, 0x45, 0x65, 0x1c, 0xb8, 0xd1, 0x9e, 0xc0, 0xd5,
  284. 0x09, 0x2a, 0x32, 0x81, 0x7d, 0x9d, 0x09, 0xce, 0x32, 0xa9, 0x91, 0x09, 0x65, 0x86, 0x72, 0x23,
  285. 0x68, 0x6a, 0x1f, 0xa4, 0xc6, 0x99, 0xf2, 0xbf, 0x39, 0x70, 0xb0, 0x6d, 0x8b, 0x3c, 0x07, 0xd2,
  286. 0xa8, 0x61, 0xca, 0x59, 0x5e, 0x09, 0x66, 0x52, 0x6a, 0xdf, 0x1c, 0x09, 0x5c, 0xbd, 0x49, 0xf9,
  287. 0xc7, 0x4a, 0x98, 0xe1, 0x14, 0x99, 0xc1, 0xfd, 0x16, 0xdc, 0x2e, 0x6b, 0x9d, 0xe2, 0x23, 0x6a,
  288. 0xb7, 0x49, 0xdb, 0x6d, 0xd2, 0x77, 0x6b, 0x40, 0xd8, 0x6b, 0xcc, 0x7e, 0xff, 0x3d, 0x76, 0xa2,
  289. 0x03, 0xab, 0xd7, 0x76, 0x5e, 0xf7, 0x7e, 0x5c, 0x8d, 0x9d, 0x3f, 0x57, 0x63, 0xc7, 0x3f, 0x86,
  290. 0xd1, 0xb5, 0x8c, 0x88, 0x0f, 0xc3, 0xa2, 0x8a, 0xd9, 0x05, 0xaf, 0x99, 0x09, 0xd1, 0x73, 0x26,
  291. 0xee, 0x51, 0x3f, 0x1a, 0x14, 0x55, 0x7c, 0xc6, 0xeb, 0xcf, 0x4d, 0x69, 0x43, 0xe0, 0x1c, 0xf6,
  292. 0x4f, 0x51, 0x2d, 0x78, 0xb2, 0x66, 0x4f, 0x61, 0x64, 0xac, 0xb0, 0xeb, 0x39, 0x0e, 0x4d, 0x79,
  293. 0xd6, 0x86, 0xe9, 0xc3, 0xb0, 0xc3, 0x75, 0x91, 0x0e, 0x5a, 0xd4, 0x09, 0xaa, 0x90, 0x9e, 0xbf,
  294. 0x48, 0x33, 0xbd, 0xa8, 0x62, 0x3a, 0x97, 0x22, 0xe8, 0x56, 0xbc, 0x79, 0xdc, 0xf8, 0x25, 0xf1,
  295. 0x9e, 0xb9, 0xbc, 0xfa, 0x17, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xc9, 0x35, 0x8e, 0x3b, 0x03, 0x00,
  296. 0x00,
  297. }
  298. func (this *EvidenceParams) Equal(that interface{}) bool {
  299. if that == nil {
  300. return this == nil
  301. }
  302. that1, ok := that.(*EvidenceParams)
  303. if !ok {
  304. that2, ok := that.(EvidenceParams)
  305. if ok {
  306. that1 = &that2
  307. } else {
  308. return false
  309. }
  310. }
  311. if that1 == nil {
  312. return this == nil
  313. } else if this == nil {
  314. return false
  315. }
  316. if this.MaxAgeNumBlocks != that1.MaxAgeNumBlocks {
  317. return false
  318. }
  319. if this.MaxAgeDuration != that1.MaxAgeDuration {
  320. return false
  321. }
  322. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  323. return false
  324. }
  325. return true
  326. }
  327. func (this *ValidatorParams) Equal(that interface{}) bool {
  328. if that == nil {
  329. return this == nil
  330. }
  331. that1, ok := that.(*ValidatorParams)
  332. if !ok {
  333. that2, ok := that.(ValidatorParams)
  334. if ok {
  335. that1 = &that2
  336. } else {
  337. return false
  338. }
  339. }
  340. if that1 == nil {
  341. return this == nil
  342. } else if this == nil {
  343. return false
  344. }
  345. if len(this.PubKeyTypes) != len(that1.PubKeyTypes) {
  346. return false
  347. }
  348. for i := range this.PubKeyTypes {
  349. if this.PubKeyTypes[i] != that1.PubKeyTypes[i] {
  350. return false
  351. }
  352. }
  353. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  354. return false
  355. }
  356. return true
  357. }
  358. func NewPopulatedEvidenceParams(r randyParams, easy bool) *EvidenceParams {
  359. this := &EvidenceParams{}
  360. this.MaxAgeNumBlocks = int64(r.Int63())
  361. if r.Intn(2) == 0 {
  362. this.MaxAgeNumBlocks *= -1
  363. }
  364. v1 := github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)
  365. this.MaxAgeDuration = *v1
  366. if !easy && r.Intn(10) != 0 {
  367. this.XXX_unrecognized = randUnrecognizedParams(r, 3)
  368. }
  369. return this
  370. }
  371. func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams {
  372. this := &ValidatorParams{}
  373. v2 := r.Intn(10)
  374. this.PubKeyTypes = make([]string, v2)
  375. for i := 0; i < v2; i++ {
  376. this.PubKeyTypes[i] = string(randStringParams(r))
  377. }
  378. if !easy && r.Intn(10) != 0 {
  379. this.XXX_unrecognized = randUnrecognizedParams(r, 2)
  380. }
  381. return this
  382. }
  383. type randyParams interface {
  384. Float32() float32
  385. Float64() float64
  386. Int63() int64
  387. Int31() int32
  388. Uint32() uint32
  389. Intn(n int) int
  390. }
  391. func randUTF8RuneParams(r randyParams) rune {
  392. ru := r.Intn(62)
  393. if ru < 10 {
  394. return rune(ru + 48)
  395. } else if ru < 36 {
  396. return rune(ru + 55)
  397. }
  398. return rune(ru + 61)
  399. }
  400. func randStringParams(r randyParams) string {
  401. v3 := r.Intn(100)
  402. tmps := make([]rune, v3)
  403. for i := 0; i < v3; i++ {
  404. tmps[i] = randUTF8RuneParams(r)
  405. }
  406. return string(tmps)
  407. }
  408. func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) {
  409. l := r.Intn(5)
  410. for i := 0; i < l; i++ {
  411. wire := r.Intn(4)
  412. if wire == 3 {
  413. wire = 5
  414. }
  415. fieldNumber := maxFieldNumber + r.Intn(100)
  416. dAtA = randFieldParams(dAtA, r, fieldNumber, wire)
  417. }
  418. return dAtA
  419. }
  420. func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte {
  421. key := uint32(fieldNumber)<<3 | uint32(wire)
  422. switch wire {
  423. case 0:
  424. dAtA = encodeVarintPopulateParams(dAtA, uint64(key))
  425. v4 := r.Int63()
  426. if r.Intn(2) == 0 {
  427. v4 *= -1
  428. }
  429. dAtA = encodeVarintPopulateParams(dAtA, uint64(v4))
  430. case 1:
  431. dAtA = encodeVarintPopulateParams(dAtA, uint64(key))
  432. 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)))
  433. case 2:
  434. dAtA = encodeVarintPopulateParams(dAtA, uint64(key))
  435. ll := r.Intn(100)
  436. dAtA = encodeVarintPopulateParams(dAtA, uint64(ll))
  437. for j := 0; j < ll; j++ {
  438. dAtA = append(dAtA, byte(r.Intn(256)))
  439. }
  440. default:
  441. dAtA = encodeVarintPopulateParams(dAtA, uint64(key))
  442. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  443. }
  444. return dAtA
  445. }
  446. func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte {
  447. for v >= 1<<7 {
  448. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  449. v >>= 7
  450. }
  451. dAtA = append(dAtA, uint8(v))
  452. return dAtA
  453. }