Remove gogoproto from Makefile's TOOLS (#2198)

* remove gogoproto from tools

because it's not a binary

* update protobuf version to 3.6.1 in `make get_protoc`

* update libs/common/types.pb.go and rpc/grpc/types.pb.go

* fix app tests
This commit is contained in:
Anton Kaliaev
2018-08-10 09:14:17 +04:00
committed by GitHub
parent 785786bec4
commit fc7c298cc0
14 changed files with 474 additions and 246 deletions
+101 -25
View File
@@ -1,16 +1,6 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: libs/common/types.proto
/*
Package common is a generated protocol buffer package.
It is generated from these files:
libs/common/types.proto
It has these top-level messages:
KVPair
KI64Pair
*/
//nolint
package common
@@ -38,14 +28,45 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Define these here for compatibility but use tmlibs/common.KVPair.
type KVPair struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *KVPair) Reset() { *m = KVPair{} }
func (m *KVPair) String() string { return proto.CompactTextString(m) }
func (*KVPair) ProtoMessage() {}
func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} }
func (m *KVPair) Reset() { *m = KVPair{} }
func (m *KVPair) String() string { return proto.CompactTextString(m) }
func (*KVPair) ProtoMessage() {}
func (*KVPair) Descriptor() ([]byte, []int) {
return fileDescriptor_types_611b4364a8604338, []int{0}
}
func (m *KVPair) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_KVPair.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *KVPair) XXX_Merge(src proto.Message) {
xxx_messageInfo_KVPair.Merge(dst, src)
}
func (m *KVPair) XXX_Size() int {
return m.Size()
}
func (m *KVPair) XXX_DiscardUnknown() {
xxx_messageInfo_KVPair.DiscardUnknown(m)
}
var xxx_messageInfo_KVPair proto.InternalMessageInfo
func (m *KVPair) GetKey() []byte {
if m != nil {
@@ -63,14 +84,45 @@ func (m *KVPair) GetValue() []byte {
// Define these here for compatibility but use tmlibs/common.KI64Pair.
type KI64Pair struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *KI64Pair) Reset() { *m = KI64Pair{} }
func (m *KI64Pair) String() string { return proto.CompactTextString(m) }
func (*KI64Pair) ProtoMessage() {}
func (*KI64Pair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} }
func (m *KI64Pair) Reset() { *m = KI64Pair{} }
func (m *KI64Pair) String() string { return proto.CompactTextString(m) }
func (*KI64Pair) ProtoMessage() {}
func (*KI64Pair) Descriptor() ([]byte, []int) {
return fileDescriptor_types_611b4364a8604338, []int{1}
}
func (m *KI64Pair) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *KI64Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_KI64Pair.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *KI64Pair) XXX_Merge(src proto.Message) {
xxx_messageInfo_KI64Pair.Merge(dst, src)
}
func (m *KI64Pair) XXX_Size() int {
return m.Size()
}
func (m *KI64Pair) XXX_DiscardUnknown() {
xxx_messageInfo_KI64Pair.DiscardUnknown(m)
}
var xxx_messageInfo_KI64Pair proto.InternalMessageInfo
func (m *KI64Pair) GetKey() []byte {
if m != nil {
@@ -117,6 +169,9 @@ func (this *KVPair) Equal(that interface{}) bool {
if !bytes.Equal(this.Value, that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *KI64Pair) Equal(that interface{}) bool {
@@ -144,6 +199,9 @@ func (this *KI64Pair) Equal(that interface{}) bool {
if this.Value != that1.Value {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (m *KVPair) Marshal() (dAtA []byte, err error) {
@@ -173,6 +231,9 @@ func (m *KVPair) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
i += copy(dAtA[i:], m.Value)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
@@ -202,6 +263,9 @@ func (m *KI64Pair) MarshalTo(dAtA []byte) (int, error) {
i++
i = encodeVarintTypes(dAtA, i, uint64(m.Value))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
@@ -227,6 +291,7 @@ func NewPopulatedKVPair(r randyTypes, easy bool) *KVPair {
this.Value[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
}
return this
}
@@ -243,6 +308,7 @@ func NewPopulatedKI64Pair(r randyTypes, easy bool) *KI64Pair {
this.Value *= -1
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
}
return this
}
@@ -330,6 +396,9 @@ func (m *KVPair) Size() (n int) {
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
@@ -343,6 +412,9 @@ func (m *KI64Pair) Size() (n int) {
if m.Value != 0 {
n += 1 + sovTypes(uint64(m.Value))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
@@ -462,6 +534,7 @@ func (m *KVPair) Unmarshal(dAtA []byte) error {
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
@@ -562,6 +635,7 @@ func (m *KI64Pair) Unmarshal(dAtA []byte) error {
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
@@ -676,10 +750,12 @@ var (
ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptorTypes) }
func init() { golang_proto.RegisterFile("libs/common/types.proto", fileDescriptorTypes) }
func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptor_types_611b4364a8604338) }
func init() {
golang_proto.RegisterFile("libs/common/types.proto", fileDescriptor_types_611b4364a8604338)
}
var fileDescriptorTypes = []byte{
var fileDescriptor_types_611b4364a8604338 = []byte{
// 174 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xc9, 0x4c, 0x2a,
0xd6, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28,
+41 -50
View File
@@ -1,23 +1,14 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: libs/common/types.proto
/*
Package common is a generated protocol buffer package.
It is generated from these files:
libs/common/types.proto
It has these top-level messages:
KVPair
KI64Pair
*/
package common
import testing "testing"
import rand "math/rand"
import math_rand "math/rand"
import time "time"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb"
import proto "github.com/gogo/protobuf/proto"
import jsonpb "github.com/gogo/protobuf/jsonpb"
import golang_proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
@@ -31,14 +22,14 @@ var _ = math.Inf
func TestKVPairProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, false)
dAtA, err := proto.Marshal(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KVPair{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
@@ -56,13 +47,13 @@ func TestKVPairProto(t *testing.T) {
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = proto.Unmarshal(littlefuzz, msg)
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestKVPairMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, false)
size := p.Size()
dAtA := make([]byte, size)
@@ -74,7 +65,7 @@ func TestKVPairMarshalTo(t *testing.T) {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KVPair{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
@@ -87,14 +78,14 @@ func TestKVPairMarshalTo(t *testing.T) {
func TestKI64PairProto(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, false)
dAtA, err := proto.Marshal(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KI64Pair{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
littlefuzz := make([]byte, len(dAtA))
@@ -112,13 +103,13 @@ func TestKI64PairProto(t *testing.T) {
littlefuzz = append(littlefuzz, byte(popr.Intn(256)))
}
// shouldn't panic
_ = proto.Unmarshal(littlefuzz, msg)
_ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg)
}
}
func TestKI64PairMarshalTo(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, false)
size := p.Size()
dAtA := make([]byte, size)
@@ -130,7 +121,7 @@ func TestKI64PairMarshalTo(t *testing.T) {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KI64Pair{}
if err := proto.Unmarshal(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
for i := range dAtA {
@@ -143,15 +134,15 @@ func TestKI64PairMarshalTo(t *testing.T) {
func TestKVPairJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, true)
marshaler := jsonpb.Marshaler{}
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KVPair{}
err = jsonpb.UnmarshalString(jsondata, msg)
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -161,15 +152,15 @@ func TestKVPairJSON(t *testing.T) {
}
func TestKI64PairJSON(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, true)
marshaler := jsonpb.Marshaler{}
marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
jsondata, err := marshaler.MarshalToString(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
msg := &KI64Pair{}
err = jsonpb.UnmarshalString(jsondata, msg)
err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -179,11 +170,11 @@ func TestKI64PairJSON(t *testing.T) {
}
func TestKVPairProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, true)
dAtA := proto.MarshalTextString(p)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &KVPair{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -193,11 +184,11 @@ func TestKVPairProtoText(t *testing.T) {
func TestKVPairProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, true)
dAtA := proto.CompactTextString(p)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &KVPair{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -207,11 +198,11 @@ func TestKVPairProtoCompactText(t *testing.T) {
func TestKI64PairProtoText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, true)
dAtA := proto.MarshalTextString(p)
dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p)
msg := &KI64Pair{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -221,11 +212,11 @@ func TestKI64PairProtoText(t *testing.T) {
func TestKI64PairProtoCompactText(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, true)
dAtA := proto.CompactTextString(p)
dAtA := github_com_gogo_protobuf_proto.CompactTextString(p)
msg := &KI64Pair{}
if err := proto.UnmarshalText(dAtA, msg); err != nil {
if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
if !p.Equal(msg) {
@@ -235,10 +226,10 @@ func TestKI64PairProtoCompactText(t *testing.T) {
func TestKVPairSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKVPair(popr, true)
size2 := proto.Size(p)
dAtA, err := proto.Marshal(p)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -249,7 +240,7 @@ func TestKVPairSize(t *testing.T) {
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := proto.Size(p)
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}
@@ -257,10 +248,10 @@ func TestKVPairSize(t *testing.T) {
func TestKI64PairSize(t *testing.T) {
seed := time.Now().UnixNano()
popr := rand.New(rand.NewSource(seed))
popr := math_rand.New(math_rand.NewSource(seed))
p := NewPopulatedKI64Pair(popr, true)
size2 := proto.Size(p)
dAtA, err := proto.Marshal(p)
size2 := github_com_gogo_protobuf_proto.Size(p)
dAtA, err := github_com_gogo_protobuf_proto.Marshal(p)
if err != nil {
t.Fatalf("seed = %d, err = %v", seed, err)
}
@@ -271,7 +262,7 @@ func TestKI64PairSize(t *testing.T) {
if size2 != size {
t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2)
}
size3 := proto.Size(p)
size3 := github_com_gogo_protobuf_proto.Size(p)
if size3 != size {
t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3)
}