github.com/okex/exchain@v1.8.0/libs/tendermint/abci/types/ibctypes.pb.go (about) 1 package types 2 3 import ( 4 "fmt" 5 "io" 6 7 "github.com/gogo/protobuf/proto" 8 ) 9 10 type EventAttribute struct { 11 Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 12 Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 13 Index bool `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` 14 } 15 16 func (m *EventAttribute) Reset() { *m = EventAttribute{} } 17 func (m *EventAttribute) String() string { return proto.CompactTextString(m) } 18 func (*EventAttribute) ProtoMessage() {} 19 func (*EventAttribute) Descriptor() ([]byte, []int) { 20 return fileDescriptor_9f1eaa49c51fa1ac, []int{37} 21 } 22 func (m *EventAttribute) XXX_Unmarshal(b []byte) error { 23 return m.Unmarshal(b) 24 } 25 func (m *EventAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 26 if deterministic { 27 return xxx_messageInfo_EventAttribute.Marshal(b, m, deterministic) 28 } else { 29 b = b[:cap(b)] 30 n, err := m.MarshalToSizedBuffer(b) 31 if err != nil { 32 return nil, err 33 } 34 return b[:n], nil 35 } 36 } 37 func (m *EventAttribute) Marshal() (dAtA []byte, err error) { 38 size := m.Size() 39 dAtA = make([]byte, size) 40 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 41 if err != nil { 42 return nil, err 43 } 44 return dAtA[:n], nil 45 } 46 47 func (m *EventAttribute) MarshalTo(dAtA []byte) (int, error) { 48 size := m.Size() 49 return m.MarshalToSizedBuffer(dAtA[:size]) 50 } 51 52 func (m *EventAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { 53 i := len(dAtA) 54 _ = i 55 var l int 56 _ = l 57 if m.Index { 58 i-- 59 if m.Index { 60 dAtA[i] = 1 61 } else { 62 dAtA[i] = 0 63 } 64 i-- 65 dAtA[i] = 0x18 66 } 67 if len(m.Value) > 0 { 68 i -= len(m.Value) 69 copy(dAtA[i:], m.Value) 70 i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) 71 i-- 72 dAtA[i] = 0x12 73 } 74 if len(m.Key) > 0 { 75 i -= len(m.Key) 76 copy(dAtA[i:], m.Key) 77 i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) 78 i-- 79 dAtA[i] = 0xa 80 } 81 return len(dAtA) - i, nil 82 } 83 84 func (m *EventAttribute) Unmarshal(dAtA []byte) error { 85 l := len(dAtA) 86 iNdEx := 0 87 for iNdEx < l { 88 preIndex := iNdEx 89 var wire uint64 90 for shift := uint(0); ; shift += 7 { 91 if shift >= 64 { 92 return ErrIntOverflowTypes 93 } 94 if iNdEx >= l { 95 return io.ErrUnexpectedEOF 96 } 97 b := dAtA[iNdEx] 98 iNdEx++ 99 wire |= uint64(b&0x7F) << shift 100 if b < 0x80 { 101 break 102 } 103 } 104 fieldNum := int32(wire >> 3) 105 wireType := int(wire & 0x7) 106 if wireType == 4 { 107 return fmt.Errorf("proto: EventAttribute: wiretype end group for non-group") 108 } 109 if fieldNum <= 0 { 110 return fmt.Errorf("proto: EventAttribute: illegal tag %d (wire type %d)", fieldNum, wire) 111 } 112 switch fieldNum { 113 case 1: 114 if wireType != 2 { 115 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 116 } 117 var byteLen int 118 for shift := uint(0); ; shift += 7 { 119 if shift >= 64 { 120 return ErrIntOverflowTypes 121 } 122 if iNdEx >= l { 123 return io.ErrUnexpectedEOF 124 } 125 b := dAtA[iNdEx] 126 iNdEx++ 127 byteLen |= int(b&0x7F) << shift 128 if b < 0x80 { 129 break 130 } 131 } 132 if byteLen < 0 { 133 return ErrInvalidLengthTypes 134 } 135 postIndex := iNdEx + byteLen 136 if postIndex < 0 { 137 return ErrInvalidLengthTypes 138 } 139 if postIndex > l { 140 return io.ErrUnexpectedEOF 141 } 142 m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) 143 if m.Key == nil { 144 m.Key = []byte{} 145 } 146 iNdEx = postIndex 147 case 2: 148 if wireType != 2 { 149 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 150 } 151 var byteLen int 152 for shift := uint(0); ; shift += 7 { 153 if shift >= 64 { 154 return ErrIntOverflowTypes 155 } 156 if iNdEx >= l { 157 return io.ErrUnexpectedEOF 158 } 159 b := dAtA[iNdEx] 160 iNdEx++ 161 byteLen |= int(b&0x7F) << shift 162 if b < 0x80 { 163 break 164 } 165 } 166 if byteLen < 0 { 167 return ErrInvalidLengthTypes 168 } 169 postIndex := iNdEx + byteLen 170 if postIndex < 0 { 171 return ErrInvalidLengthTypes 172 } 173 if postIndex > l { 174 return io.ErrUnexpectedEOF 175 } 176 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 177 if m.Value == nil { 178 m.Value = []byte{} 179 } 180 iNdEx = postIndex 181 case 3: 182 if wireType != 0 { 183 return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) 184 } 185 var v int 186 for shift := uint(0); ; shift += 7 { 187 if shift >= 64 { 188 return ErrIntOverflowTypes 189 } 190 if iNdEx >= l { 191 return io.ErrUnexpectedEOF 192 } 193 b := dAtA[iNdEx] 194 iNdEx++ 195 v |= int(b&0x7F) << shift 196 if b < 0x80 { 197 break 198 } 199 } 200 m.Index = bool(v != 0) 201 default: 202 iNdEx = preIndex 203 skippy, err := skipTypes(dAtA[iNdEx:]) 204 if err != nil { 205 return err 206 } 207 if (skippy < 0) || (iNdEx+skippy) < 0 { 208 return ErrInvalidLengthTypes 209 } 210 if (iNdEx + skippy) > l { 211 return io.ErrUnexpectedEOF 212 } 213 iNdEx += skippy 214 } 215 } 216 217 if iNdEx > l { 218 return io.ErrUnexpectedEOF 219 } 220 return nil 221 } 222 223 func (m *EventAttribute) XXX_Merge(src proto.Message) { 224 xxx_messageInfo_EventAttribute.Merge(m, src) 225 } 226 func (m *EventAttribute) XXX_Size() int { 227 return m.Size() 228 } 229 func (m *EventAttribute) XXX_DiscardUnknown() { 230 xxx_messageInfo_EventAttribute.DiscardUnknown(m) 231 } 232 233 var xxx_messageInfo_EventAttribute proto.InternalMessageInfo 234 235 func (m *EventAttribute) GetKey() []byte { 236 if m != nil { 237 return m.Key 238 } 239 return nil 240 } 241 242 func (m *EventAttribute) GetValue() []byte { 243 if m != nil { 244 return m.Value 245 } 246 return nil 247 } 248 249 func (m *EventAttribute) GetIndex() bool { 250 if m != nil { 251 return m.Index 252 } 253 return false 254 } 255 256 func (m *EventAttribute) Size() (n int) { 257 if m == nil { 258 return 0 259 } 260 var l int 261 _ = l 262 l = len(m.Key) 263 if l > 0 { 264 n += 1 + l + sovTypes(uint64(l)) 265 } 266 l = len(m.Value) 267 if l > 0 { 268 n += 1 + l + sovTypes(uint64(l)) 269 } 270 if m.Index { 271 n += 2 272 } 273 return n 274 }