github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/rpc/grpc/typespb_test.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: rpc/grpc/types.proto 3 4 package coregrpc 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" 10 github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" 11 proto "github.com/gogo/protobuf/proto" 12 golang_proto "github.com/golang/protobuf/proto" 13 _ "github.com/tendermint/tendermint/abci/types" 14 math "math" 15 math_rand "math/rand" 16 testing "testing" 17 time "time" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = golang_proto.Marshal 23 var _ = fmt.Errorf 24 var _ = math.Inf 25 26 func TestRequestPingProto(t *testing.T) { 27 seed := time.Now().UnixNano() 28 popr := math_rand.New(math_rand.NewSource(seed)) 29 p := NewPopulatedRequestPing(popr, false) 30 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 31 if err != nil { 32 t.Fatalf("seed = %d, err = %v", seed, err) 33 } 34 msg := &RequestPing{} 35 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 36 t.Fatalf("seed = %d, err = %v", seed, err) 37 } 38 littlefuzz := make([]byte, len(dAtA)) 39 copy(littlefuzz, dAtA) 40 for i := range dAtA { 41 dAtA[i] = byte(popr.Intn(256)) 42 } 43 if !p.Equal(msg) { 44 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 45 } 46 if len(littlefuzz) > 0 { 47 fuzzamount := 100 48 for i := 0; i < fuzzamount; i++ { 49 littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) 50 littlefuzz = append(littlefuzz, byte(popr.Intn(256))) 51 } 52 // shouldn't panic 53 _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) 54 } 55 } 56 57 func TestRequestPingMarshalTo(t *testing.T) { 58 seed := time.Now().UnixNano() 59 popr := math_rand.New(math_rand.NewSource(seed)) 60 p := NewPopulatedRequestPing(popr, false) 61 size := p.Size() 62 dAtA := make([]byte, size) 63 for i := range dAtA { 64 dAtA[i] = byte(popr.Intn(256)) 65 } 66 _, err := p.MarshalTo(dAtA) 67 if err != nil { 68 t.Fatalf("seed = %d, err = %v", seed, err) 69 } 70 msg := &RequestPing{} 71 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 72 t.Fatalf("seed = %d, err = %v", seed, err) 73 } 74 for i := range dAtA { 75 dAtA[i] = byte(popr.Intn(256)) 76 } 77 if !p.Equal(msg) { 78 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 79 } 80 } 81 82 func TestRequestBroadcastTxProto(t *testing.T) { 83 seed := time.Now().UnixNano() 84 popr := math_rand.New(math_rand.NewSource(seed)) 85 p := NewPopulatedRequestBroadcastTx(popr, false) 86 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 87 if err != nil { 88 t.Fatalf("seed = %d, err = %v", seed, err) 89 } 90 msg := &RequestBroadcastTx{} 91 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 92 t.Fatalf("seed = %d, err = %v", seed, err) 93 } 94 littlefuzz := make([]byte, len(dAtA)) 95 copy(littlefuzz, dAtA) 96 for i := range dAtA { 97 dAtA[i] = byte(popr.Intn(256)) 98 } 99 if !p.Equal(msg) { 100 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 101 } 102 if len(littlefuzz) > 0 { 103 fuzzamount := 100 104 for i := 0; i < fuzzamount; i++ { 105 littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) 106 littlefuzz = append(littlefuzz, byte(popr.Intn(256))) 107 } 108 // shouldn't panic 109 _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) 110 } 111 } 112 113 func TestRequestBroadcastTxMarshalTo(t *testing.T) { 114 seed := time.Now().UnixNano() 115 popr := math_rand.New(math_rand.NewSource(seed)) 116 p := NewPopulatedRequestBroadcastTx(popr, false) 117 size := p.Size() 118 dAtA := make([]byte, size) 119 for i := range dAtA { 120 dAtA[i] = byte(popr.Intn(256)) 121 } 122 _, err := p.MarshalTo(dAtA) 123 if err != nil { 124 t.Fatalf("seed = %d, err = %v", seed, err) 125 } 126 msg := &RequestBroadcastTx{} 127 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 128 t.Fatalf("seed = %d, err = %v", seed, err) 129 } 130 for i := range dAtA { 131 dAtA[i] = byte(popr.Intn(256)) 132 } 133 if !p.Equal(msg) { 134 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 135 } 136 } 137 138 func TestResponsePingProto(t *testing.T) { 139 seed := time.Now().UnixNano() 140 popr := math_rand.New(math_rand.NewSource(seed)) 141 p := NewPopulatedResponsePing(popr, false) 142 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 143 if err != nil { 144 t.Fatalf("seed = %d, err = %v", seed, err) 145 } 146 msg := &ResponsePing{} 147 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 148 t.Fatalf("seed = %d, err = %v", seed, err) 149 } 150 littlefuzz := make([]byte, len(dAtA)) 151 copy(littlefuzz, dAtA) 152 for i := range dAtA { 153 dAtA[i] = byte(popr.Intn(256)) 154 } 155 if !p.Equal(msg) { 156 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 157 } 158 if len(littlefuzz) > 0 { 159 fuzzamount := 100 160 for i := 0; i < fuzzamount; i++ { 161 littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) 162 littlefuzz = append(littlefuzz, byte(popr.Intn(256))) 163 } 164 // shouldn't panic 165 _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) 166 } 167 } 168 169 func TestResponsePingMarshalTo(t *testing.T) { 170 seed := time.Now().UnixNano() 171 popr := math_rand.New(math_rand.NewSource(seed)) 172 p := NewPopulatedResponsePing(popr, false) 173 size := p.Size() 174 dAtA := make([]byte, size) 175 for i := range dAtA { 176 dAtA[i] = byte(popr.Intn(256)) 177 } 178 _, err := p.MarshalTo(dAtA) 179 if err != nil { 180 t.Fatalf("seed = %d, err = %v", seed, err) 181 } 182 msg := &ResponsePing{} 183 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 184 t.Fatalf("seed = %d, err = %v", seed, err) 185 } 186 for i := range dAtA { 187 dAtA[i] = byte(popr.Intn(256)) 188 } 189 if !p.Equal(msg) { 190 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 191 } 192 } 193 194 func TestResponseBroadcastTxProto(t *testing.T) { 195 seed := time.Now().UnixNano() 196 popr := math_rand.New(math_rand.NewSource(seed)) 197 p := NewPopulatedResponseBroadcastTx(popr, false) 198 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 199 if err != nil { 200 t.Fatalf("seed = %d, err = %v", seed, err) 201 } 202 msg := &ResponseBroadcastTx{} 203 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 204 t.Fatalf("seed = %d, err = %v", seed, err) 205 } 206 littlefuzz := make([]byte, len(dAtA)) 207 copy(littlefuzz, dAtA) 208 for i := range dAtA { 209 dAtA[i] = byte(popr.Intn(256)) 210 } 211 if !p.Equal(msg) { 212 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 213 } 214 if len(littlefuzz) > 0 { 215 fuzzamount := 100 216 for i := 0; i < fuzzamount; i++ { 217 littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) 218 littlefuzz = append(littlefuzz, byte(popr.Intn(256))) 219 } 220 // shouldn't panic 221 _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) 222 } 223 } 224 225 func TestResponseBroadcastTxMarshalTo(t *testing.T) { 226 seed := time.Now().UnixNano() 227 popr := math_rand.New(math_rand.NewSource(seed)) 228 p := NewPopulatedResponseBroadcastTx(popr, false) 229 size := p.Size() 230 dAtA := make([]byte, size) 231 for i := range dAtA { 232 dAtA[i] = byte(popr.Intn(256)) 233 } 234 _, err := p.MarshalTo(dAtA) 235 if err != nil { 236 t.Fatalf("seed = %d, err = %v", seed, err) 237 } 238 msg := &ResponseBroadcastTx{} 239 if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { 240 t.Fatalf("seed = %d, err = %v", seed, err) 241 } 242 for i := range dAtA { 243 dAtA[i] = byte(popr.Intn(256)) 244 } 245 if !p.Equal(msg) { 246 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 247 } 248 } 249 250 func TestRequestPingJSON(t *testing.T) { 251 seed := time.Now().UnixNano() 252 popr := math_rand.New(math_rand.NewSource(seed)) 253 p := NewPopulatedRequestPing(popr, true) 254 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} 255 jsondata, err := marshaler.MarshalToString(p) 256 if err != nil { 257 t.Fatalf("seed = %d, err = %v", seed, err) 258 } 259 msg := &RequestPing{} 260 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) 261 if err != nil { 262 t.Fatalf("seed = %d, err = %v", seed, err) 263 } 264 if !p.Equal(msg) { 265 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) 266 } 267 } 268 func TestRequestBroadcastTxJSON(t *testing.T) { 269 seed := time.Now().UnixNano() 270 popr := math_rand.New(math_rand.NewSource(seed)) 271 p := NewPopulatedRequestBroadcastTx(popr, true) 272 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} 273 jsondata, err := marshaler.MarshalToString(p) 274 if err != nil { 275 t.Fatalf("seed = %d, err = %v", seed, err) 276 } 277 msg := &RequestBroadcastTx{} 278 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) 279 if err != nil { 280 t.Fatalf("seed = %d, err = %v", seed, err) 281 } 282 if !p.Equal(msg) { 283 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) 284 } 285 } 286 func TestResponsePingJSON(t *testing.T) { 287 seed := time.Now().UnixNano() 288 popr := math_rand.New(math_rand.NewSource(seed)) 289 p := NewPopulatedResponsePing(popr, true) 290 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} 291 jsondata, err := marshaler.MarshalToString(p) 292 if err != nil { 293 t.Fatalf("seed = %d, err = %v", seed, err) 294 } 295 msg := &ResponsePing{} 296 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) 297 if err != nil { 298 t.Fatalf("seed = %d, err = %v", seed, err) 299 } 300 if !p.Equal(msg) { 301 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) 302 } 303 } 304 func TestResponseBroadcastTxJSON(t *testing.T) { 305 seed := time.Now().UnixNano() 306 popr := math_rand.New(math_rand.NewSource(seed)) 307 p := NewPopulatedResponseBroadcastTx(popr, true) 308 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} 309 jsondata, err := marshaler.MarshalToString(p) 310 if err != nil { 311 t.Fatalf("seed = %d, err = %v", seed, err) 312 } 313 msg := &ResponseBroadcastTx{} 314 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) 315 if err != nil { 316 t.Fatalf("seed = %d, err = %v", seed, err) 317 } 318 if !p.Equal(msg) { 319 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) 320 } 321 } 322 func TestRequestPingProtoText(t *testing.T) { 323 seed := time.Now().UnixNano() 324 popr := math_rand.New(math_rand.NewSource(seed)) 325 p := NewPopulatedRequestPing(popr, true) 326 dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) 327 msg := &RequestPing{} 328 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 329 t.Fatalf("seed = %d, err = %v", seed, err) 330 } 331 if !p.Equal(msg) { 332 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 333 } 334 } 335 336 func TestRequestPingProtoCompactText(t *testing.T) { 337 seed := time.Now().UnixNano() 338 popr := math_rand.New(math_rand.NewSource(seed)) 339 p := NewPopulatedRequestPing(popr, true) 340 dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) 341 msg := &RequestPing{} 342 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 343 t.Fatalf("seed = %d, err = %v", seed, err) 344 } 345 if !p.Equal(msg) { 346 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 347 } 348 } 349 350 func TestRequestBroadcastTxProtoText(t *testing.T) { 351 seed := time.Now().UnixNano() 352 popr := math_rand.New(math_rand.NewSource(seed)) 353 p := NewPopulatedRequestBroadcastTx(popr, true) 354 dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) 355 msg := &RequestBroadcastTx{} 356 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 357 t.Fatalf("seed = %d, err = %v", seed, err) 358 } 359 if !p.Equal(msg) { 360 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 361 } 362 } 363 364 func TestRequestBroadcastTxProtoCompactText(t *testing.T) { 365 seed := time.Now().UnixNano() 366 popr := math_rand.New(math_rand.NewSource(seed)) 367 p := NewPopulatedRequestBroadcastTx(popr, true) 368 dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) 369 msg := &RequestBroadcastTx{} 370 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 371 t.Fatalf("seed = %d, err = %v", seed, err) 372 } 373 if !p.Equal(msg) { 374 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 375 } 376 } 377 378 func TestResponsePingProtoText(t *testing.T) { 379 seed := time.Now().UnixNano() 380 popr := math_rand.New(math_rand.NewSource(seed)) 381 p := NewPopulatedResponsePing(popr, true) 382 dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) 383 msg := &ResponsePing{} 384 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 385 t.Fatalf("seed = %d, err = %v", seed, err) 386 } 387 if !p.Equal(msg) { 388 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 389 } 390 } 391 392 func TestResponsePingProtoCompactText(t *testing.T) { 393 seed := time.Now().UnixNano() 394 popr := math_rand.New(math_rand.NewSource(seed)) 395 p := NewPopulatedResponsePing(popr, true) 396 dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) 397 msg := &ResponsePing{} 398 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 399 t.Fatalf("seed = %d, err = %v", seed, err) 400 } 401 if !p.Equal(msg) { 402 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 403 } 404 } 405 406 func TestResponseBroadcastTxProtoText(t *testing.T) { 407 seed := time.Now().UnixNano() 408 popr := math_rand.New(math_rand.NewSource(seed)) 409 p := NewPopulatedResponseBroadcastTx(popr, true) 410 dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) 411 msg := &ResponseBroadcastTx{} 412 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 413 t.Fatalf("seed = %d, err = %v", seed, err) 414 } 415 if !p.Equal(msg) { 416 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 417 } 418 } 419 420 func TestResponseBroadcastTxProtoCompactText(t *testing.T) { 421 seed := time.Now().UnixNano() 422 popr := math_rand.New(math_rand.NewSource(seed)) 423 p := NewPopulatedResponseBroadcastTx(popr, true) 424 dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) 425 msg := &ResponseBroadcastTx{} 426 if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { 427 t.Fatalf("seed = %d, err = %v", seed, err) 428 } 429 if !p.Equal(msg) { 430 t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) 431 } 432 } 433 434 func TestRequestPingSize(t *testing.T) { 435 seed := time.Now().UnixNano() 436 popr := math_rand.New(math_rand.NewSource(seed)) 437 p := NewPopulatedRequestPing(popr, true) 438 size2 := github_com_gogo_protobuf_proto.Size(p) 439 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 440 if err != nil { 441 t.Fatalf("seed = %d, err = %v", seed, err) 442 } 443 size := p.Size() 444 if len(dAtA) != size { 445 t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) 446 } 447 if size2 != size { 448 t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) 449 } 450 size3 := github_com_gogo_protobuf_proto.Size(p) 451 if size3 != size { 452 t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) 453 } 454 } 455 456 func TestRequestBroadcastTxSize(t *testing.T) { 457 seed := time.Now().UnixNano() 458 popr := math_rand.New(math_rand.NewSource(seed)) 459 p := NewPopulatedRequestBroadcastTx(popr, true) 460 size2 := github_com_gogo_protobuf_proto.Size(p) 461 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 462 if err != nil { 463 t.Fatalf("seed = %d, err = %v", seed, err) 464 } 465 size := p.Size() 466 if len(dAtA) != size { 467 t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) 468 } 469 if size2 != size { 470 t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) 471 } 472 size3 := github_com_gogo_protobuf_proto.Size(p) 473 if size3 != size { 474 t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) 475 } 476 } 477 478 func TestResponsePingSize(t *testing.T) { 479 seed := time.Now().UnixNano() 480 popr := math_rand.New(math_rand.NewSource(seed)) 481 p := NewPopulatedResponsePing(popr, true) 482 size2 := github_com_gogo_protobuf_proto.Size(p) 483 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 484 if err != nil { 485 t.Fatalf("seed = %d, err = %v", seed, err) 486 } 487 size := p.Size() 488 if len(dAtA) != size { 489 t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) 490 } 491 if size2 != size { 492 t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) 493 } 494 size3 := github_com_gogo_protobuf_proto.Size(p) 495 if size3 != size { 496 t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) 497 } 498 } 499 500 func TestResponseBroadcastTxSize(t *testing.T) { 501 seed := time.Now().UnixNano() 502 popr := math_rand.New(math_rand.NewSource(seed)) 503 p := NewPopulatedResponseBroadcastTx(popr, true) 504 size2 := github_com_gogo_protobuf_proto.Size(p) 505 dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) 506 if err != nil { 507 t.Fatalf("seed = %d, err = %v", seed, err) 508 } 509 size := p.Size() 510 if len(dAtA) != size { 511 t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) 512 } 513 if size2 != size { 514 t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) 515 } 516 size3 := github_com_gogo_protobuf_proto.Size(p) 517 if size3 != size { 518 t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) 519 } 520 } 521 522 //These tests are generated by github.com/gogo/protobuf/plugin/testgen