Browse Source

proto: bring over proto types & msgs (#4718)

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
pull/4726/head
Marko 5 years ago
committed by GitHub
parent
commit
af887adad9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 14879 additions and 0 deletions
  1. +1115
    -0
      proto/crypto/keys/types.pb.go
  2. +23
    -0
      proto/crypto/keys/types.proto
  3. +719
    -0
      proto/evidence/msgs.pb.go
  4. +17
    -0
      proto/evidence/msgs.proto
  5. +484
    -0
      proto/libs/bits/types.pb.go
  6. +9
    -0
      proto/libs/bits/types.proto
  7. +2282
    -0
      proto/state/types.pb.go
  8. +74
    -0
      proto/state/types.proto
  9. +573
    -0
      proto/types/block.pb.go
  10. +15
    -0
      proto/types/block.proto
  11. +1555
    -0
      proto/types/evidence.pb.go
  12. +36
    -0
      proto/types/evidence.proto
  13. +1636
    -0
      proto/types/params.pb.go
  14. +53
    -0
      proto/types/params.proto
  15. +4469
    -0
      proto/types/types.pb.go
  16. +140
    -0
      proto/types/types.proto
  17. +881
    -0
      proto/types/validator.pb.go
  18. +20
    -0
      proto/types/validator.proto
  19. +753
    -0
      proto/version/version.pb.go
  20. +25
    -0
      proto/version/version.proto

+ 1115
- 0
proto/crypto/keys/types.pb.go
File diff suppressed because it is too large
View File


+ 23
- 0
proto/crypto/keys/types.proto View File

@ -0,0 +1,23 @@
syntax = "proto3";
package tendermint.proto.crypto.keys;
option go_package = "github.com/tendermint/tendermint/proto/crypto/keys";
import "third_party/proto/gogoproto/gogo.proto";
option (gogoproto.equal_all) = true;
option (gogoproto.compare_all) = true;
option (gogoproto.populate_all) = true;
message PublicKey {
oneof sum {
bytes ed25519 = 1;
}
}
// WARNING PrivateKey is used for internal purposes only
message PrivateKey {
oneof sum {
bytes ed25519 = 1;
}
}

+ 719
- 0
proto/evidence/msgs.pb.go View File

@ -0,0 +1,719 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/evidence/msgs.proto
package evidence
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/tendermint/tendermint/proto/types"
io "io"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type List struct {
Evidence []types.Evidence `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence"`
}
func (m *List) Reset() { *m = List{} }
func (*List) ProtoMessage() {}
func (*List) Descriptor() ([]byte, []int) {
return fileDescriptor_df8322769b0bd7d6, []int{0}
}
func (m *List) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_List.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *List) XXX_Merge(src proto.Message) {
xxx_messageInfo_List.Merge(m, src)
}
func (m *List) XXX_Size() int {
return m.Size()
}
func (m *List) XXX_DiscardUnknown() {
xxx_messageInfo_List.DiscardUnknown(m)
}
var xxx_messageInfo_List proto.InternalMessageInfo
func (m *List) GetEvidence() []types.Evidence {
if m != nil {
return m.Evidence
}
return nil
}
type Info struct {
Committed bool `protobuf:"varint,1,opt,name=committed,proto3" json:"committed,omitempty"`
Priority int64 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
Evidence types.Evidence `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"`
}
func (m *Info) Reset() { *m = Info{} }
func (*Info) ProtoMessage() {}
func (*Info) Descriptor() ([]byte, []int) {
return fileDescriptor_df8322769b0bd7d6, []int{1}
}
func (m *Info) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Info.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Info) XXX_Merge(src proto.Message) {
xxx_messageInfo_Info.Merge(m, src)
}
func (m *Info) XXX_Size() int {
return m.Size()
}
func (m *Info) XXX_DiscardUnknown() {
xxx_messageInfo_Info.DiscardUnknown(m)
}
var xxx_messageInfo_Info proto.InternalMessageInfo
func (m *Info) GetCommitted() bool {
if m != nil {
return m.Committed
}
return false
}
func (m *Info) GetPriority() int64 {
if m != nil {
return m.Priority
}
return 0
}
func (m *Info) GetEvidence() types.Evidence {
if m != nil {
return m.Evidence
}
return types.Evidence{}
}
func init() {
proto.RegisterType((*List)(nil), "tendermint.proto.evidence.List")
proto.RegisterType((*Info)(nil), "tendermint.proto.evidence.Info")
}
func init() { proto.RegisterFile("proto/evidence/msgs.proto", fileDescriptor_df8322769b0bd7d6) }
var fileDescriptor_df8322769b0bd7d6 = []byte{
// 283 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0xcf, 0x2d, 0x4e, 0x2f, 0xd6,
0x03, 0x8b, 0x09, 0x49, 0x96, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44,
0xf4, 0x60, 0xaa, 0xa4, 0xd4, 0x4a, 0x32, 0x32, 0x8b, 0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a,
0xf5, 0x21, 0x26, 0xa4, 0xe7, 0xa7, 0xe7, 0x23, 0x58, 0x10, 0x0d, 0x52, 0x52, 0x10, 0x91, 0x92,
0xca, 0x82, 0xd4, 0x62, 0xb8, 0x1d, 0x10, 0x39, 0x25, 0x2f, 0x2e, 0x16, 0x9f, 0xcc, 0xe2, 0x12,
0x21, 0x27, 0x2e, 0x0e, 0x98, 0x8c, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x82, 0x1e, 0x86,
0xcd, 0x60, 0x13, 0xf4, 0x5c, 0xa1, 0xea, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0xeb,
0x53, 0x6a, 0x61, 0xe4, 0x62, 0xf1, 0xcc, 0x4b, 0xcb, 0x17, 0x92, 0xe1, 0xe2, 0x4c, 0xce, 0xcf,
0xcd, 0xcd, 0x2c, 0x29, 0x49, 0x4d, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x08, 0x42, 0x08, 0x08,
0x49, 0x71, 0x71, 0x14, 0x14, 0x65, 0xe6, 0x17, 0x65, 0x96, 0x54, 0x4a, 0x30, 0x29, 0x30, 0x6a,
0x30, 0x07, 0xc1, 0xf9, 0x28, 0xce, 0x60, 0x56, 0x60, 0x24, 0xc7, 0x19, 0x4e, 0xa9, 0x17, 0x1e,
0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15,
0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6,
0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39,
0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3,
0x73, 0xf5, 0x11, 0x36, 0x22, 0x33, 0x51, 0xe3, 0x28, 0x89, 0x0d, 0xcc, 0x37, 0x06, 0x04, 0x00,
0x00, 0xff, 0xff, 0x2c, 0xf3, 0x8d, 0x9c, 0xbc, 0x01, 0x00, 0x00,
}
func (this *List) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*List)
if !ok {
that2, ok := that.(List)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if len(this.Evidence) != len(that1.Evidence) {
return false
}
for i := range this.Evidence {
if !this.Evidence[i].Equal(&that1.Evidence[i]) {
return false
}
}
return true
}
func (this *Info) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Info)
if !ok {
that2, ok := that.(Info)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Committed != that1.Committed {
return false
}
if this.Priority != that1.Priority {
return false
}
if !this.Evidence.Equal(&that1.Evidence) {
return false
}
return true
}
func (this *List) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&evidence.List{")
if this.Evidence != nil {
vs := make([]types.Evidence, len(this.Evidence))
for i := range vs {
vs[i] = this.Evidence[i]
}
s = append(s, "Evidence: "+fmt.Sprintf("%#v", vs)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Info) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&evidence.Info{")
s = append(s, "Committed: "+fmt.Sprintf("%#v", this.Committed)+",\n")
s = append(s, "Priority: "+fmt.Sprintf("%#v", this.Priority)+",\n")
s = append(s, "Evidence: "+strings.Replace(this.Evidence.GoString(), `&`, ``, 1)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringMsgs(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *List) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *List) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *List) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Evidence) > 0 {
for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintMsgs(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *Info) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Info) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Info) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintMsgs(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
if m.Priority != 0 {
i = encodeVarintMsgs(dAtA, i, uint64(m.Priority))
i--
dAtA[i] = 0x10
}
if m.Committed {
i--
if m.Committed {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int {
offset -= sovMsgs(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *List) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Evidence) > 0 {
for _, e := range m.Evidence {
l = e.Size()
n += 1 + l + sovMsgs(uint64(l))
}
}
return n
}
func (m *Info) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Committed {
n += 2
}
if m.Priority != 0 {
n += 1 + sovMsgs(uint64(m.Priority))
}
l = m.Evidence.Size()
n += 1 + l + sovMsgs(uint64(l))
return n
}
func sovMsgs(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozMsgs(x uint64) (n int) {
return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *List) String() string {
if this == nil {
return "nil"
}
repeatedStringForEvidence := "[]Evidence{"
for _, f := range this.Evidence {
repeatedStringForEvidence += fmt.Sprintf("%v", f) + ","
}
repeatedStringForEvidence += "}"
s := strings.Join([]string{`&List{`,
`Evidence:` + repeatedStringForEvidence + `,`,
`}`,
}, "")
return s
}
func (this *Info) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Info{`,
`Committed:` + fmt.Sprintf("%v", this.Committed) + `,`,
`Priority:` + fmt.Sprintf("%v", this.Priority) + `,`,
`Evidence:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Evidence), "Evidence", "types.Evidence", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringMsgs(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *List) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: List: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: List: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthMsgs
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthMsgs
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Evidence = append(m.Evidence, types.Evidence{})
if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipMsgs(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthMsgs
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMsgs
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Info) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Info: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Info: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Committed", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Committed = bool(v != 0)
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType)
}
m.Priority = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Priority |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowMsgs
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthMsgs
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthMsgs
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipMsgs(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthMsgs
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMsgs
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipMsgs(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMsgs
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMsgs
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowMsgs
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthMsgs
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupMsgs
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthMsgs
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)

+ 17
- 0
proto/evidence/msgs.proto View File

@ -0,0 +1,17 @@
syntax = "proto3";
package tendermint.proto.evidence;
option go_package = "github.com/tendermint/tendermint/proto/evidence";
import "third_party/proto/gogoproto/gogo.proto";
import "proto/types/evidence.proto";
message List {
repeated tendermint.proto.types.Evidence evidence = 1 [(gogoproto.nullable) = false];
}
message Info {
bool committed = 1;
int64 priority = 2;
tendermint.proto.types.Evidence evidence = 3 [(gogoproto.nullable) = false];
}

+ 484
- 0
proto/libs/bits/types.pb.go View File

@ -0,0 +1,484 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/libs/bits/types.proto
package bits
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type BitArray struct {
Bits int64 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"`
Elems []uint64 `protobuf:"varint,2,rep,packed,name=elems,proto3" json:"elems,omitempty"`
}
func (m *BitArray) Reset() { *m = BitArray{} }
func (*BitArray) ProtoMessage() {}
func (*BitArray) Descriptor() ([]byte, []int) {
return fileDescriptor_3f1fbe70d7999e09, []int{0}
}
func (m *BitArray) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BitArray.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BitArray) XXX_Merge(src proto.Message) {
xxx_messageInfo_BitArray.Merge(m, src)
}
func (m *BitArray) XXX_Size() int {
return m.Size()
}
func (m *BitArray) XXX_DiscardUnknown() {
xxx_messageInfo_BitArray.DiscardUnknown(m)
}
var xxx_messageInfo_BitArray proto.InternalMessageInfo
func (m *BitArray) GetBits() int64 {
if m != nil {
return m.Bits
}
return 0
}
func (m *BitArray) GetElems() []uint64 {
if m != nil {
return m.Elems
}
return nil
}
func init() {
proto.RegisterType((*BitArray)(nil), "tendermint.proto.libs.bits.BitArray")
}
func init() { proto.RegisterFile("proto/libs/bits/types.proto", fileDescriptor_3f1fbe70d7999e09) }
var fileDescriptor_3f1fbe70d7999e09 = []byte{
// 196 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xca, 0x2c, 0x29, 0xd6, 0x2f, 0xa9, 0x2c, 0x48,
0x2d, 0xd6, 0x03, 0x8b, 0x0a, 0x49, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95,
0x40, 0x44, 0xf4, 0x40, 0xea, 0xf4, 0x40, 0xea, 0x94, 0x4c, 0xb8, 0x38, 0x9c, 0x32, 0x4b, 0x1c,
0x8b, 0x8a, 0x12, 0x2b, 0x85, 0x84, 0xb8, 0x58, 0x40, 0x62, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc,
0x41, 0x60, 0xb6, 0x90, 0x08, 0x17, 0x6b, 0x6a, 0x4e, 0x6a, 0x6e, 0xb1, 0x04, 0x93, 0x02, 0xb3,
0x06, 0x4b, 0x10, 0x84, 0xe3, 0x94, 0x76, 0xe1, 0xa1, 0x1c, 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x1f,
0x1e, 0xca, 0x31, 0x36, 0x3c, 0x92, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6,
0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0xc3, 0x23, 0x39,
0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20,
0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe1, 0x24, 0x64, 0x26, 0x9a,
0x2f, 0x92, 0xd8, 0xc0, 0x02, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x31, 0xea, 0x25,
0xdf, 0x00, 0x00, 0x00,
}
func (this *BitArray) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*BitArray)
if !ok {
that2, ok := that.(BitArray)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Bits != that1.Bits {
return false
}
if len(this.Elems) != len(that1.Elems) {
return false
}
for i := range this.Elems {
if this.Elems[i] != that1.Elems[i] {
return false
}
}
return true
}
func (this *BitArray) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&bits.BitArray{")
s = append(s, "Bits: "+fmt.Sprintf("%#v", this.Bits)+",\n")
s = append(s, "Elems: "+fmt.Sprintf("%#v", this.Elems)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringTypes(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *BitArray) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *BitArray) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Elems) > 0 {
dAtA2 := make([]byte, len(m.Elems)*10)
var j1 int
for _, num := range m.Elems {
for num >= 1<<7 {
dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j1++
}
dAtA2[j1] = uint8(num)
j1++
}
i -= j1
copy(dAtA[i:], dAtA2[:j1])
i = encodeVarintTypes(dAtA, i, uint64(j1))
i--
dAtA[i] = 0x12
}
if m.Bits != 0 {
i = encodeVarintTypes(dAtA, i, uint64(m.Bits))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
offset -= sovTypes(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *BitArray) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Bits != 0 {
n += 1 + sovTypes(uint64(m.Bits))
}
if len(m.Elems) > 0 {
l = 0
for _, e := range m.Elems {
l += sovTypes(uint64(e))
}
n += 1 + sovTypes(uint64(l)) + l
}
return n
}
func sovTypes(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozTypes(x uint64) (n int) {
return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *BitArray) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&BitArray{`,
`Bits:` + fmt.Sprintf("%v", this.Bits) + `,`,
`Elems:` + fmt.Sprintf("%v", this.Elems) + `,`,
`}`,
}, "")
return s
}
func valueToStringTypes(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *BitArray) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: BitArray: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BitArray: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Bits", wireType)
}
m.Bits = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Bits |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Elems = append(m.Elems, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthTypes
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
var count int
for _, integer := range dAtA[iNdEx:postIndex] {
if integer < 128 {
count++
}
}
elementCount = count
if elementCount != 0 && len(m.Elems) == 0 {
m.Elems = make([]uint64, 0, elementCount)
}
for iNdEx < postIndex {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Elems = append(m.Elems, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType)
}
default:
iNdEx = preIndex
skippy, err := skipTypes(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTypes
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTypes(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTypes
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTypes
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTypes
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthTypes
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupTypes
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthTypes
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

+ 9
- 0
proto/libs/bits/types.proto View File

@ -0,0 +1,9 @@
syntax = "proto3";
package tendermint.proto.libs.bits;
option go_package = "github.com/tendermint/tendermint/proto/libs/bits";
message BitArray {
int64 bits = 1;
repeated uint64 elems = 2;
}

+ 2282
- 0
proto/state/types.pb.go
File diff suppressed because it is too large
View File


+ 74
- 0
proto/state/types.proto View File

@ -0,0 +1,74 @@
syntax = "proto3";
package tendermint.proto.state;
option go_package = "github.com/tendermint/tendermint/proto/state";
import "third_party/proto/gogoproto/gogo.proto";
import "abci/types/types.proto";
import "proto/types/types.proto";
import "proto/types/validator.proto";
import "proto/types/params.proto";
import "proto/version/version.proto";
import "google/protobuf/timestamp.proto";
// ABCIResponses retains the responses
// of the various ABCI calls during block processing.
// It is persisted to disk for each height before calling Commit.
message ABCIResponses {
repeated tendermint.abci.types.ResponseDeliverTx deliver_txs = 1;
tendermint.abci.types.ResponseEndBlock end_block = 2;
tendermint.abci.types.ResponseBeginBlock begin_block = 3;
}
// ValidatorsInfo represents the latest validator set, or the last height it changed
message ValidatorsInfo {
tendermint.proto.types.ValidatorSet validator_set = 1;
int64 last_height_changed = 2;
}
// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
message ConsensusParamsInfo {
tendermint.proto.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false];
int64 last_height_changed = 2;
}
message Version {
tendermint.proto.version.Consensus consensus = 1 [(gogoproto.nullable) = false];
string software = 2;
}
message State {
Version version = 1 [(gogoproto.nullable) = false];
// immutable
string chain_Id = 2 [(gogoproto.customname) = "ChainID"];
// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
int64 last_block_height = 3;
tendermint.proto.types.BlockID last_block_id = 4
[(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"];
google.protobuf.Timestamp last_block_time = 5
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// LastValidators is used to validate block.LastCommit.
// Validators are persisted to the database separately every time they change,
// so we can query for historical validator sets.
// Note that if s.LastBlockHeight causes a valset change,
// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
// Extra +1 due to nextValSet delay.
tendermint.proto.types.ValidatorSet next_validators = 6;
tendermint.proto.types.ValidatorSet validators = 7;
tendermint.proto.types.ValidatorSet last_validators = 8;
int64 last_height_validators_changed = 9;
// Consensus parameters used for validating blocks.
// Changes returned by EndBlock and updated after Commit.
tendermint.proto.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false];
int64 last_height_consensus_params_changed = 11;
// Merkle root of the results from executing prev block
bytes LastResultsHash = 12;
// the latest AppHash we've received from calling abci.Commit()
bytes AppHash = 13;
}

+ 573
- 0
proto/types/block.pb.go View File

@ -0,0 +1,573 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/types/block.proto
package types
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Block struct {
Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
Evidence EvidenceData `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"`
LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"`
}
func (m *Block) Reset() { *m = Block{} }
func (*Block) ProtoMessage() {}
func (*Block) Descriptor() ([]byte, []int) {
return fileDescriptor_3aa007336dea920d, []int{0}
}
func (m *Block) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Block.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Block) XXX_Merge(src proto.Message) {
xxx_messageInfo_Block.Merge(m, src)
}
func (m *Block) XXX_Size() int {
return m.Size()
}
func (m *Block) XXX_DiscardUnknown() {
xxx_messageInfo_Block.DiscardUnknown(m)
}
var xxx_messageInfo_Block proto.InternalMessageInfo
func (m *Block) GetHeader() Header {
if m != nil {
return m.Header
}
return Header{}
}
func (m *Block) GetData() Data {
if m != nil {
return m.Data
}
return Data{}
}
func (m *Block) GetEvidence() EvidenceData {
if m != nil {
return m.Evidence
}
return EvidenceData{}
}
func (m *Block) GetLastCommit() *Commit {
if m != nil {
return m.LastCommit
}
return nil
}
func init() {
proto.RegisterType((*Block)(nil), "tendermint.proto.types.Block")
}
func init() { proto.RegisterFile("proto/types/block.proto", fileDescriptor_3aa007336dea920d) }
var fileDescriptor_3aa007336dea920d = []byte{
// 303 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0xd6, 0x03, 0x8b,
0x08, 0x89, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4, 0xc0,
0x6a, 0xa4, 0xd4, 0x4a, 0x32, 0x32, 0x8b, 0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a, 0xf5, 0x21,
0x9a, 0xd3, 0xf3, 0xd3, 0xf3, 0x11, 0x2c, 0x88, 0x6a, 0x29, 0x14, 0x83, 0xc1, 0x24, 0x54, 0x42,
0x0a, 0x59, 0x22, 0xb5, 0x2c, 0x33, 0x25, 0x35, 0x2f, 0x39, 0x15, 0x22, 0xa7, 0xd4, 0xc6, 0xc4,
0xc5, 0xea, 0x04, 0x72, 0x84, 0x90, 0x0d, 0x17, 0x5b, 0x46, 0x6a, 0x62, 0x4a, 0x6a, 0x91, 0x04,
0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x9c, 0x1e, 0x76, 0xf7, 0xe8, 0x79, 0x80, 0x55, 0x39, 0xb1,
0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd5, 0x23, 0x64, 0xc6, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28,
0xc1, 0x04, 0xd6, 0x2b, 0x83, 0x4b, 0xaf, 0x4b, 0x62, 0x49, 0x22, 0x54, 0x27, 0x58, 0xbd, 0x90,
0x1b, 0x17, 0x07, 0xcc, 0x45, 0x12, 0xcc, 0x60, 0xbd, 0x2a, 0xb8, 0xf4, 0xba, 0x42, 0xd5, 0x21,
0x99, 0x01, 0xd7, 0x2b, 0x64, 0xcf, 0xc5, 0x9d, 0x93, 0x58, 0x5c, 0x12, 0x9f, 0x9c, 0x9f, 0x9b,
0x9b, 0x59, 0x22, 0xc1, 0x82, 0xdf, 0x0b, 0xce, 0x60, 0x55, 0x41, 0x5c, 0x20, 0x2d, 0x10, 0xb6,
0x53, 0xd2, 0x85, 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xd8, 0xf0,
0x48, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c,
0xf0, 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63,
0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2,
0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x84, 0x5d, 0xc8, 0x4c, 0xa4, 0xb0, 0x4f, 0x62, 0x03, 0x73,
0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x25, 0xe9, 0xab, 0x03, 0x02, 0x00, 0x00,
}
func (this *Block) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Block)
if !ok {
that2, ok := that.(Block)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.Header.Equal(&that1.Header) {
return false
}
if !this.Data.Equal(&that1.Data) {
return false
}
if !this.Evidence.Equal(&that1.Evidence) {
return false
}
if !this.LastCommit.Equal(that1.LastCommit) {
return false
}
return true
}
func (this *Block) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 8)
s = append(s, "&types.Block{")
s = append(s, "Header: "+strings.Replace(this.Header.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Data: "+strings.Replace(this.Data.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Evidence: "+strings.Replace(this.Evidence.GoString(), `&`, ``, 1)+",\n")
if this.LastCommit != nil {
s = append(s, "LastCommit: "+fmt.Sprintf("%#v", this.LastCommit)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringBlock(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *Block) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Block) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.LastCommit != nil {
{
size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintBlock(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
{
size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintBlock(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
{
size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintBlock(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
{
size, err := m.Header.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintBlock(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
func encodeVarintBlock(dAtA []byte, offset int, v uint64) int {
offset -= sovBlock(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Block) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = m.Header.Size()
n += 1 + l + sovBlock(uint64(l))
l = m.Data.Size()
n += 1 + l + sovBlock(uint64(l))
l = m.Evidence.Size()
n += 1 + l + sovBlock(uint64(l))
if m.LastCommit != nil {
l = m.LastCommit.Size()
n += 1 + l + sovBlock(uint64(l))
}
return n
}
func sovBlock(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozBlock(x uint64) (n int) {
return sovBlock(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Block) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Block{`,
`Header:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Header), "Header", "Header", 1), `&`, ``, 1) + `,`,
`Data:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Data), "Data", "Data", 1), `&`, ``, 1) + `,`,
`Evidence:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Evidence), "EvidenceData", "EvidenceData", 1), `&`, ``, 1) + `,`,
`LastCommit:` + strings.Replace(fmt.Sprintf("%v", this.LastCommit), "Commit", "Commit", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringBlock(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *Block) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowBlock
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Block: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowBlock
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthBlock
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthBlock
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowBlock
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthBlock
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthBlock
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowBlock
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthBlock
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthBlock
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowBlock
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthBlock
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthBlock
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.LastCommit == nil {
m.LastCommit = &Commit{}
}
if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipBlock(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthBlock
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthBlock
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipBlock(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowBlock
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowBlock
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowBlock
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthBlock
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupBlock
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthBlock
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthBlock = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowBlock = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group")
)

+ 15
- 0
proto/types/block.proto View File

@ -0,0 +1,15 @@
syntax = "proto3";
package tendermint.proto.types;
option go_package = "github.com/tendermint/tendermint/proto/types";
import "third_party/proto/gogoproto/gogo.proto";
import "proto/types/types.proto";
import "proto/types/evidence.proto";
message Block {
Header header = 1 [(gogoproto.nullable) = false];
Data data = 2 [(gogoproto.nullable) = false];
tendermint.proto.types.EvidenceData evidence = 3 [(gogoproto.nullable) = false];
Commit last_commit = 4;
}

+ 1555
- 0
proto/types/evidence.pb.go
File diff suppressed because it is too large
View File


+ 36
- 0
proto/types/evidence.proto View File

@ -0,0 +1,36 @@
syntax = "proto3";
package tendermint.proto.types;
option go_package = "github.com/tendermint/tendermint/proto/types";
import "third_party/proto/gogoproto/gogo.proto";
import "proto/types/types.proto";
import "google/protobuf/timestamp.proto";
// DuplicateVoteEvidence contains evidence a validator signed two conflicting
// votes.
message DuplicateVoteEvidence {
Vote vote_a = 1;
Vote vote_b = 2;
}
// MockEvidence is used for testing pruposes
message MockEvidence {
int64 evidence_height = 1;
google.protobuf.Timestamp evidence_time = 2
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes evidence_address = 3;
}
message Evidence {
oneof sum {
DuplicateVoteEvidence duplicate_vote_evidence = 1;
MockEvidence mock_evidence = 2;
}
}
// EvidenceData contains any evidence of malicious wrong-doing by validators
message EvidenceData {
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
bytes hash = 2;
}

+ 1636
- 0
proto/types/params.pb.go
File diff suppressed because it is too large
View File


+ 53
- 0
proto/types/params.proto View File

@ -0,0 +1,53 @@
syntax = "proto3";
package tendermint.proto.types;
option go_package = "github.com/tendermint/tendermint/proto/types";
import "third_party/proto/gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
// ConsensusParams contains consensus critical parameters that determine the
// validity of blocks.
message ConsensusParams {
BlockParams block = 1 [(gogoproto.nullable) = false];
EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
ValidatorParams validator = 3 [(gogoproto.nullable) = false];
}
// BlockParams contains limits on the block size.
message BlockParams {
// Note: must be greater than 0
int64 max_bytes = 1;
// Note: must be greater or equal to -1
int64 max_gas = 2;
// Minimum time increment between consecutive blocks (in milliseconds)
// Not exposed to the application.
int64 time_iota_ms = 3;
}
// EvidenceParams determine how we handle evidence of malfeasance.
message EvidenceParams {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
// Note: must be greater than 0
int64 max_age_num_blocks = 1;
google.protobuf.Duration max_age_duration = 2
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
}
// ValidatorParams restrict the public key types validators can use.
// NOTE: uses ABCI pubkey naming, not Amino names.
message ValidatorParams {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
repeated string pub_key_types = 1;
}
// HashedParams is a subset of ConsensusParams.
// It is amino encoded and hashed into
// the Header.ConsensusHash.
message HashedParams {
int64 block_max_bytes = 1;
int64 block_max_gas = 2;
}

+ 4469
- 0
proto/types/types.pb.go
File diff suppressed because it is too large
View File


+ 140
- 0
proto/types/types.proto View File

@ -0,0 +1,140 @@
syntax = "proto3";
package tendermint.proto.types;
option go_package = "github.com/tendermint/tendermint/proto/types";
import "third_party/proto/gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "proto/libs/bits/types.proto";
import "proto/version/version.proto";
// BlockIdFlag indicates which BlcokID the signature is for
enum BlockIDFlag {
option (gogoproto.goproto_enum_stringer) = false;
option (gogoproto.goproto_enum_prefix) = false;
BLOCKD_ID_FLAG_UNKNOWN = 0;
BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
}
// SignedMsgType is a type of signed message in the consensus.
enum SignedMsgType {
option (gogoproto.goproto_enum_stringer) = false;
option (gogoproto.goproto_enum_prefix) = false;
SIGNED_MSG_TYPE_UNKNOWN = 0;
PREVOTE_TYPE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
PRECOMMIT_TYPE = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];
PROPOSAL_TYPE = 3 [(gogoproto.enumvalue_customname) = "ProposalType"];
}
// PartsetHeader
message PartSetHeader {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
uint32 total = 1;
bytes hash = 2;
}
// BlockID
message BlockID {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
bytes hash = 1;
PartSetHeader parts_header = 2 [(gogoproto.nullable) = false];
}
// --------------------------------
// Header defines the structure of a Tendermint block header.
message Header {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
// basic block info
tendermint.proto.version.Consensus version = 1 [(gogoproto.nullable) = false];
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// prev block info
BlockID last_block_id = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"];
// hashes of block data
bytes last_commit_hash = 6; // commit from validators from the last block
bytes data_hash = 7; // transactions
// hashes from the app output from the prev block
bytes validators_hash = 8; // validators for the current block
bytes next_validators_hash = 9; // validators for the next block
bytes consensus_hash = 10; // consensus params for current block
bytes app_hash = 11; // state after txs from the previous block
bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
// consensus info
bytes evidence_hash = 13; // evidence included in the block
bytes proposer_address = 14; // original proposer of the block
}
// Data contains the set of transactions included in the block
message Data {
// Txs that will be applied by state @ block.Height+1.
// NOTE: not all txs here are valid. We're just agreeing on the order first.
// This means that block.AppHash does not include these txs.
repeated bytes txs = 1;
// Volatile
bytes hash = 2;
}
// Vote represents a prevote, precommit, or commit vote from validators for
// consensus.
message Vote {
SignedMsgType type = 1;
int64 height = 2;
int32 round = 3;
BlockID block_id = 4
[(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil.
google.protobuf.Timestamp timestamp = 5
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes validator_address = 6;
uint32 validator_index = 7;
bytes signature = 8;
}
// Commit contains the evidence that a block was committed by a set of validators.
message Commit {
int64 height = 1;
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
bytes hash = 5;
tendermint.proto.libs.bits.BitArray bit_array = 6;
}
// CommitSig is a part of the Vote included in a Commit.
message CommitSig {
BlockIDFlag block_id_flag = 1;
bytes validator_address = 2;
google.protobuf.Timestamp timestamp = 3
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes signature = 4;
}
message Proposal {
SignedMsgType type = 1;
int64 height = 2;
int32 round = 3;
int32 pol_round = 4;
BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
google.protobuf.Timestamp timestamp = 6
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes signature = 7;
}
message SignedHeader {
Header header = 1;
Commit commit = 2;
}

+ 881
- 0
proto/types/validator.pb.go View File

@ -0,0 +1,881 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/types/validator.proto
package types
import (
bytes "bytes"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
keys "github.com/tendermint/tendermint/proto/crypto/keys"
io "io"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ValidatorSet struct {
Validators []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"`
Proposer *Validator `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"`
TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"`
}
func (m *ValidatorSet) Reset() { *m = ValidatorSet{} }
func (*ValidatorSet) ProtoMessage() {}
func (*ValidatorSet) Descriptor() ([]byte, []int) {
return fileDescriptor_2e7c6b38c20e5406, []int{0}
}
func (m *ValidatorSet) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ValidatorSet) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidatorSet.Merge(m, src)
}
func (m *ValidatorSet) XXX_Size() int {
return m.Size()
}
func (m *ValidatorSet) XXX_DiscardUnknown() {
xxx_messageInfo_ValidatorSet.DiscardUnknown(m)
}
var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo
func (m *ValidatorSet) GetValidators() []*Validator {
if m != nil {
return m.Validators
}
return nil
}
func (m *ValidatorSet) GetProposer() *Validator {
if m != nil {
return m.Proposer
}
return nil
}
func (m *ValidatorSet) GetTotalVotingPower() int64 {
if m != nil {
return m.TotalVotingPower
}
return 0
}
type Validator struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey keys.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"`
}
func (m *Validator) Reset() { *m = Validator{} }
func (*Validator) ProtoMessage() {}
func (*Validator) Descriptor() ([]byte, []int) {
return fileDescriptor_2e7c6b38c20e5406, []int{1}
}
func (m *Validator) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Validator.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Validator) XXX_Merge(src proto.Message) {
xxx_messageInfo_Validator.Merge(m, src)
}
func (m *Validator) XXX_Size() int {
return m.Size()
}
func (m *Validator) XXX_DiscardUnknown() {
xxx_messageInfo_Validator.DiscardUnknown(m)
}
var xxx_messageInfo_Validator proto.InternalMessageInfo
func (m *Validator) GetAddress() []byte {
if m != nil {
return m.Address
}
return nil
}
func (m *Validator) GetPubKey() keys.PublicKey {
if m != nil {
return m.PubKey
}
return keys.PublicKey{}
}
func (m *Validator) GetVotingPower() int64 {
if m != nil {
return m.VotingPower
}
return 0
}
func (m *Validator) GetProposerPriority() int64 {
if m != nil {
return m.ProposerPriority
}
return 0
}
func init() {
proto.RegisterType((*ValidatorSet)(nil), "tendermint.proto.types.ValidatorSet")
proto.RegisterType((*Validator)(nil), "tendermint.proto.types.Validator")
}
func init() { proto.RegisterFile("proto/types/validator.proto", fileDescriptor_2e7c6b38c20e5406) }
var fileDescriptor_2e7c6b38c20e5406 = []byte{
// 383 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbd, 0x6e, 0xea, 0x30,
0x14, 0xc7, 0xe3, 0x0b, 0x82, 0x7b, 0x0d, 0xc3, 0xbd, 0x1e, 0xae, 0x22, 0xaa, 0xba, 0xc0, 0xd0,
0x22, 0x15, 0x25, 0x52, 0x3b, 0x77, 0x28, 0x43, 0x17, 0x16, 0x94, 0x4a, 0x0c, 0x5d, 0xa2, 0x84,
0x58, 0xc1, 0xe2, 0xc3, 0x96, 0xe3, 0x50, 0x79, 0xeb, 0x23, 0xf4, 0x31, 0xfa, 0x12, 0xed, 0xcc,
0xc8, 0xc8, 0x54, 0x95, 0xb0, 0x74, 0xe4, 0x11, 0x2a, 0x62, 0x12, 0x90, 0xca, 0xd0, 0xcd, 0xe7,
0xff, 0x3f, 0x1f, 0xbf, 0x73, 0x64, 0x78, 0xc2, 0x05, 0x93, 0xcc, 0x96, 0x8a, 0x93, 0xc8, 0x9e,
0x79, 0x63, 0x1a, 0x78, 0x92, 0x09, 0x2b, 0x55, 0xd1, 0x7f, 0x49, 0xa6, 0x01, 0x11, 0x13, 0x3a,
0x95, 0x5a, 0xb1, 0xd2, 0xbc, 0xda, 0xb9, 0x1c, 0x52, 0x11, 0xb8, 0xdc, 0x13, 0x52, 0xd9, 0xba,
0x41, 0xc8, 0x42, 0xb6, 0x7f, 0xe9, 0xec, 0xda, 0xa9, 0x56, 0x06, 0x42, 0x71, 0xc9, 0xec, 0x11,
0x51, 0x91, 0x1e, 0xa4, 0xed, 0xe6, 0x1b, 0x80, 0xd5, 0x7e, 0x36, 0xf2, 0x9e, 0x48, 0x74, 0x0b,
0x61, 0x8e, 0x10, 0x99, 0xa0, 0x5e, 0x68, 0x55, 0xae, 0x1a, 0xd6, 0x71, 0x08, 0x2b, 0xaf, 0x74,
0x0e, 0x8a, 0xd0, 0x0d, 0xfc, 0xcd, 0x05, 0xe3, 0x2c, 0x22, 0xc2, 0xfc, 0x55, 0x07, 0x3f, 0x6b,
0x90, 0x97, 0xa0, 0x36, 0x44, 0x92, 0x49, 0x6f, 0xec, 0xce, 0x98, 0xa4, 0xd3, 0xd0, 0xe5, 0xec,
0x91, 0x08, 0xb3, 0x50, 0x07, 0xad, 0x82, 0xf3, 0x37, 0x75, 0xfa, 0xa9, 0xd1, 0xdb, 0xea, 0xcd,
0x57, 0x00, 0xff, 0xe4, 0x5d, 0x90, 0x09, 0xcb, 0x5e, 0x10, 0x08, 0x12, 0x6d, 0xd1, 0x41, 0xab,
0xea, 0x64, 0x21, 0xba, 0x83, 0x65, 0x1e, 0xfb, 0xee, 0x88, 0xa8, 0x1d, 0xd3, 0xc5, 0x77, 0x26,
0x7d, 0x24, 0x6b, 0x7b, 0x24, 0xab, 0x17, 0xfb, 0x63, 0x3a, 0xe8, 0x12, 0xd5, 0x29, 0xce, 0xdf,
0xcf, 0x0c, 0xa7, 0xc4, 0x63, 0xbf, 0x4b, 0x14, 0x6a, 0xc0, 0xea, 0x11, 0xae, 0xca, 0x6c, 0x8f,
0x84, 0x2e, 0xe1, 0xbf, 0x6c, 0x19, 0x97, 0x0b, 0xca, 0x04, 0x95, 0xca, 0x2c, 0x6a, 0xfe, 0xcc,
0xe8, 0xed, 0xf4, 0x8e, 0xbf, 0x58, 0x61, 0x63, 0xb9, 0xc2, 0xc6, 0x66, 0x85, 0xc1, 0x53, 0x82,
0xc1, 0x4b, 0x82, 0xc1, 0x3c, 0xc1, 0x60, 0x91, 0x60, 0xf0, 0x91, 0x60, 0xf0, 0x99, 0x60, 0x63,
0x93, 0x60, 0xf0, 0xbc, 0xc6, 0xc6, 0x62, 0x8d, 0x8d, 0xe5, 0x1a, 0x1b, 0x0f, 0xed, 0x90, 0xca,
0x61, 0xec, 0x5b, 0x03, 0x36, 0xb1, 0xf7, 0x6b, 0x1c, 0x3e, 0x0f, 0xfe, 0x94, 0x5f, 0x4a, 0x83,
0xeb, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x2c, 0xc6, 0xff, 0x69, 0x02, 0x00, 0x00,
}
func (this *ValidatorSet) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*ValidatorSet)
if !ok {
that2, ok := that.(ValidatorSet)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if len(this.Validators) != len(that1.Validators) {
return false
}
for i := range this.Validators {
if !this.Validators[i].Equal(that1.Validators[i]) {
return false
}
}
if !this.Proposer.Equal(that1.Proposer) {
return false
}
if this.TotalVotingPower != that1.TotalVotingPower {
return false
}
return true
}
func (this *Validator) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Validator)
if !ok {
that2, ok := that.(Validator)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !bytes.Equal(this.Address, that1.Address) {
return false
}
if !this.PubKey.Equal(&that1.PubKey) {
return false
}
if this.VotingPower != that1.VotingPower {
return false
}
if this.ProposerPriority != that1.ProposerPriority {
return false
}
return true
}
func (this *ValidatorSet) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&types.ValidatorSet{")
if this.Validators != nil {
s = append(s, "Validators: "+fmt.Sprintf("%#v", this.Validators)+",\n")
}
if this.Proposer != nil {
s = append(s, "Proposer: "+fmt.Sprintf("%#v", this.Proposer)+",\n")
}
s = append(s, "TotalVotingPower: "+fmt.Sprintf("%#v", this.TotalVotingPower)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Validator) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 8)
s = append(s, "&types.Validator{")
s = append(s, "Address: "+fmt.Sprintf("%#v", this.Address)+",\n")
s = append(s, "PubKey: "+strings.Replace(this.PubKey.GoString(), `&`, ``, 1)+",\n")
s = append(s, "VotingPower: "+fmt.Sprintf("%#v", this.VotingPower)+",\n")
s = append(s, "ProposerPriority: "+fmt.Sprintf("%#v", this.ProposerPriority)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringValidator(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *ValidatorSet) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ValidatorSet) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ValidatorSet) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.TotalVotingPower != 0 {
i = encodeVarintValidator(dAtA, i, uint64(m.TotalVotingPower))
i--
dAtA[i] = 0x18
}
if m.Proposer != nil {
{
size, err := m.Proposer.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintValidator(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
if len(m.Validators) > 0 {
for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintValidator(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *Validator) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Validator) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.ProposerPriority != 0 {
i = encodeVarintValidator(dAtA, i, uint64(m.ProposerPriority))
i--
dAtA[i] = 0x20
}
if m.VotingPower != 0 {
i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower))
i--
dAtA[i] = 0x18
}
{
size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintValidator(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintValidator(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintValidator(dAtA []byte, offset int, v uint64) int {
offset -= sovValidator(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *ValidatorSet) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Validators) > 0 {
for _, e := range m.Validators {
l = e.Size()
n += 1 + l + sovValidator(uint64(l))
}
}
if m.Proposer != nil {
l = m.Proposer.Size()
n += 1 + l + sovValidator(uint64(l))
}
if m.TotalVotingPower != 0 {
n += 1 + sovValidator(uint64(m.TotalVotingPower))
}
return n
}
func (m *Validator) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Address)
if l > 0 {
n += 1 + l + sovValidator(uint64(l))
}
l = m.PubKey.Size()
n += 1 + l + sovValidator(uint64(l))
if m.VotingPower != 0 {
n += 1 + sovValidator(uint64(m.VotingPower))
}
if m.ProposerPriority != 0 {
n += 1 + sovValidator(uint64(m.ProposerPriority))
}
return n
}
func sovValidator(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozValidator(x uint64) (n int) {
return sovValidator(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *ValidatorSet) String() string {
if this == nil {
return "nil"
}
repeatedStringForValidators := "[]*Validator{"
for _, f := range this.Validators {
repeatedStringForValidators += strings.Replace(f.String(), "Validator", "Validator", 1) + ","
}
repeatedStringForValidators += "}"
s := strings.Join([]string{`&ValidatorSet{`,
`Validators:` + repeatedStringForValidators + `,`,
`Proposer:` + strings.Replace(this.Proposer.String(), "Validator", "Validator", 1) + `,`,
`TotalVotingPower:` + fmt.Sprintf("%v", this.TotalVotingPower) + `,`,
`}`,
}, "")
return s
}
func (this *Validator) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Validator{`,
`Address:` + fmt.Sprintf("%v", this.Address) + `,`,
`PubKey:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.PubKey), "PublicKey", "keys.PublicKey", 1), `&`, ``, 1) + `,`,
`VotingPower:` + fmt.Sprintf("%v", this.VotingPower) + `,`,
`ProposerPriority:` + fmt.Sprintf("%v", this.ProposerPriority) + `,`,
`}`,
}, "")
return s
}
func valueToStringValidator(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *ValidatorSet) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ValidatorSet: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ValidatorSet: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthValidator
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Validators = append(m.Validators, &Validator{})
if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthValidator
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Proposer == nil {
m.Proposer = &Validator{}
}
if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType)
}
m.TotalVotingPower = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.TotalVotingPower |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipValidator(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthValidator
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthValidator
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Validator) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Validator: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthValidator
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
if m.Address == nil {
m.Address = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthValidator
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType)
}
m.VotingPower = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VotingPower |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType)
}
m.ProposerPriority = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ProposerPriority |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipValidator(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthValidator
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthValidator
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipValidator(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthValidator
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupValidator
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthValidator
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthValidator = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowValidator = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupValidator = fmt.Errorf("proto: unexpected end of group")
)

+ 20
- 0
proto/types/validator.proto View File

@ -0,0 +1,20 @@
syntax = "proto3";
package tendermint.proto.types;
option go_package = "github.com/tendermint/tendermint/proto/types";
import "third_party/proto/gogoproto/gogo.proto";
import "proto/crypto/keys/types.proto";
message ValidatorSet {
repeated Validator validators = 1;
Validator proposer = 2;
int64 total_voting_power = 3;
}
message Validator {
bytes address = 1;
tendermint.proto.crypto.keys.PublicKey pub_key = 2 [(gogoproto.nullable) = false];
int64 voting_power = 3;
int64 proposer_priority = 4;
}

+ 753
- 0
proto/version/version.pb.go View File

@ -0,0 +1,753 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/version/version.proto
package version
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// App includes the protocol and software version for the application.
// This information is included in ResponseInfo. The App.Protocol can be
// updated in ResponseEndBlock.
type App struct {
Protocol uint64 `protobuf:"varint,1,opt,name=protocol,proto3" json:"protocol,omitempty"`
Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"`
}
func (m *App) Reset() { *m = App{} }
func (*App) ProtoMessage() {}
func (*App) Descriptor() ([]byte, []int) {
return fileDescriptor_14aa2353622f11e1, []int{0}
}
func (m *App) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_App.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *App) XXX_Merge(src proto.Message) {
xxx_messageInfo_App.Merge(m, src)
}
func (m *App) XXX_Size() int {
return m.Size()
}
func (m *App) XXX_DiscardUnknown() {
xxx_messageInfo_App.DiscardUnknown(m)
}
var xxx_messageInfo_App proto.InternalMessageInfo
func (m *App) GetProtocol() uint64 {
if m != nil {
return m.Protocol
}
return 0
}
func (m *App) GetSoftware() string {
if m != nil {
return m.Software
}
return ""
}
// Consensus captures the consensus rules for processing a block in the blockchain,
// including all blockchain data structures and the rules of the application's
// state transition machine.
type Consensus struct {
Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"`
App uint64 `protobuf:"varint,2,opt,name=app,proto3" json:"app,omitempty"`
}
func (m *Consensus) Reset() { *m = Consensus{} }
func (*Consensus) ProtoMessage() {}
func (*Consensus) Descriptor() ([]byte, []int) {
return fileDescriptor_14aa2353622f11e1, []int{1}
}
func (m *Consensus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Consensus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Consensus.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Consensus) XXX_Merge(src proto.Message) {
xxx_messageInfo_Consensus.Merge(m, src)
}
func (m *Consensus) XXX_Size() int {
return m.Size()
}
func (m *Consensus) XXX_DiscardUnknown() {
xxx_messageInfo_Consensus.DiscardUnknown(m)
}
var xxx_messageInfo_Consensus proto.InternalMessageInfo
func (m *Consensus) GetBlock() uint64 {
if m != nil {
return m.Block
}
return 0
}
func (m *Consensus) GetApp() uint64 {
if m != nil {
return m.App
}
return 0
}
func init() {
proto.RegisterType((*App)(nil), "tendermint.proto.version.App")
proto.RegisterType((*Consensus)(nil), "tendermint.proto.version.Consensus")
}
func init() { proto.RegisterFile("proto/version/version.proto", fileDescriptor_14aa2353622f11e1) }
var fileDescriptor_14aa2353622f11e1 = []byte{
// 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0x2f, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x83, 0xd1, 0x7a, 0x60, 0x51, 0x21, 0x89,
0x92, 0xd4, 0xbc, 0x94, 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0x88, 0x88, 0x1e, 0x54, 0x5e, 0x4a,
0xad, 0x24, 0x23, 0xb3, 0x28, 0x25, 0xbe, 0x20, 0xb1, 0xa8, 0xa4, 0x52, 0x1f, 0x62, 0x44, 0x7a,
0x7e, 0x7a, 0x3e, 0x82, 0x05, 0x51, 0xaf, 0x64, 0xcb, 0xc5, 0xec, 0x58, 0x50, 0x20, 0x24, 0xc5,
0xc5, 0x01, 0xe6, 0x27, 0xe7, 0xe7, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xf9, 0x20,
0xb9, 0xe2, 0xfc, 0xb4, 0x92, 0xf2, 0xc4, 0xa2, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20,
0x38, 0x5f, 0xc9, 0x96, 0x8b, 0xd3, 0x39, 0x3f, 0xaf, 0x38, 0x35, 0xaf, 0xb8, 0xb4, 0x58, 0x48,
0x84, 0x8b, 0x35, 0x29, 0x27, 0x3f, 0x39, 0x1b, 0x6a, 0x02, 0x84, 0x23, 0x24, 0xc0, 0xc5, 0x9c,
0x58, 0x50, 0x00, 0xd6, 0xc9, 0x12, 0x04, 0x62, 0x5a, 0x71, 0xec, 0x58, 0x20, 0xcf, 0xf8, 0x62,
0x81, 0x3c, 0xa3, 0x53, 0xca, 0x85, 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28,
0xc7, 0xd8, 0xf0, 0x48, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c,
0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x8f, 0xe4, 0x18, 0x27,
0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xbd, 0xf4, 0xcc,
0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x44, 0x00, 0x20, 0x33, 0x51, 0xc2, 0x2c,
0x89, 0x0d, 0xcc, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x00, 0x5b, 0x7f, 0x4b, 0x01,
0x00, 0x00,
}
func (this *App) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*App)
if !ok {
that2, ok := that.(App)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Protocol != that1.Protocol {
return false
}
if this.Software != that1.Software {
return false
}
return true
}
func (this *Consensus) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Consensus)
if !ok {
that2, ok := that.(Consensus)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Block != that1.Block {
return false
}
if this.App != that1.App {
return false
}
return true
}
func (this *App) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&version.App{")
s = append(s, "Protocol: "+fmt.Sprintf("%#v", this.Protocol)+",\n")
s = append(s, "Software: "+fmt.Sprintf("%#v", this.Software)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Consensus) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&version.Consensus{")
s = append(s, "Block: "+fmt.Sprintf("%#v", this.Block)+",\n")
s = append(s, "App: "+fmt.Sprintf("%#v", this.App)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringVersion(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *App) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *App) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *App) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Software) > 0 {
i -= len(m.Software)
copy(dAtA[i:], m.Software)
i = encodeVarintVersion(dAtA, i, uint64(len(m.Software)))
i--
dAtA[i] = 0x12
}
if m.Protocol != 0 {
i = encodeVarintVersion(dAtA, i, uint64(m.Protocol))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *Consensus) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Consensus) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Consensus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.App != 0 {
i = encodeVarintVersion(dAtA, i, uint64(m.App))
i--
dAtA[i] = 0x10
}
if m.Block != 0 {
i = encodeVarintVersion(dAtA, i, uint64(m.Block))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintVersion(dAtA []byte, offset int, v uint64) int {
offset -= sovVersion(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func NewPopulatedConsensus(r randyVersion, easy bool) *Consensus {
this := &Consensus{}
this.Block = uint64(uint64(r.Uint32()))
this.App = uint64(uint64(r.Uint32()))
if !easy && r.Intn(10) != 0 {
}
return this
}
type randyVersion interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneVersion(r randyVersion) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringVersion(r randyVersion) string {
v1 := r.Intn(100)
tmps := make([]rune, v1)
for i := 0; i < v1; i++ {
tmps[i] = randUTF8RuneVersion(r)
}
return string(tmps)
}
func randUnrecognizedVersion(r randyVersion, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldVersion(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldVersion(dAtA []byte, r randyVersion, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateVersion(dAtA, uint64(key))
v2 := r.Int63()
if r.Intn(2) == 0 {
v2 *= -1
}
dAtA = encodeVarintPopulateVersion(dAtA, uint64(v2))
case 1:
dAtA = encodeVarintPopulateVersion(dAtA, uint64(key))
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)))
case 2:
dAtA = encodeVarintPopulateVersion(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateVersion(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateVersion(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateVersion(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *App) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Protocol != 0 {
n += 1 + sovVersion(uint64(m.Protocol))
}
l = len(m.Software)
if l > 0 {
n += 1 + l + sovVersion(uint64(l))
}
return n
}
func (m *Consensus) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Block != 0 {
n += 1 + sovVersion(uint64(m.Block))
}
if m.App != 0 {
n += 1 + sovVersion(uint64(m.App))
}
return n
}
func sovVersion(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozVersion(x uint64) (n int) {
return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *App) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&App{`,
`Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`,
`Software:` + fmt.Sprintf("%v", this.Software) + `,`,
`}`,
}, "")
return s
}
func (this *Consensus) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Consensus{`,
`Block:` + fmt.Sprintf("%v", this.Block) + `,`,
`App:` + fmt.Sprintf("%v", this.App) + `,`,
`}`,
}, "")
return s
}
func valueToStringVersion(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *App) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: App: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: App: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType)
}
m.Protocol = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Protocol |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Software", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVersion
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthVersion
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Software = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipVersion(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVersion
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVersion
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Consensus) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Consensus: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Consensus: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
}
m.Block = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Block |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field App", wireType)
}
m.App = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVersion
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.App |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipVersion(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVersion
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVersion
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipVersion(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVersion
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVersion
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVersion
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthVersion
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupVersion
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthVersion
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupVersion = fmt.Errorf("proto: unexpected end of group")
)

+ 25
- 0
proto/version/version.proto View File

@ -0,0 +1,25 @@
syntax = "proto3";
package tendermint.proto.version;
option go_package = "github.com/tendermint/tendermint/proto/version";
import "third_party/proto/gogoproto/gogo.proto";
// App includes the protocol and software version for the application.
// This information is included in ResponseInfo. The App.Protocol can be
// updated in ResponseEndBlock.
message App {
uint64 protocol = 1;
string software = 2;
}
// Consensus captures the consensus rules for processing a block in the blockchain,
// including all blockchain data structures and the rules of the application's
// state transition machine.
message Consensus {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
uint64 block = 1;
uint64 app = 2;
}

Loading…
Cancel
Save