github.com/Finschia/finschia-sdk@v0.49.1/x/feegrant/feegrant.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/feegrant/v1beta1/feegrant.proto 3 4 package feegrant 5 6 import ( 7 fmt "fmt" 8 types1 "github.com/Finschia/finschia-sdk/codec/types" 9 github_com_Finschia_finschia_sdk_types "github.com/Finschia/finschia-sdk/types" 10 types "github.com/Finschia/finschia-sdk/types" 11 _ "github.com/gogo/protobuf/gogoproto" 12 proto "github.com/gogo/protobuf/proto" 13 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 14 _ "github.com/regen-network/cosmos-proto" 15 _ "google.golang.org/protobuf/types/known/durationpb" 16 _ "google.golang.org/protobuf/types/known/timestamppb" 17 io "io" 18 math "math" 19 math_bits "math/bits" 20 time "time" 21 ) 22 23 // Reference imports to suppress errors if they are not otherwise used. 24 var _ = proto.Marshal 25 var _ = fmt.Errorf 26 var _ = math.Inf 27 var _ = time.Kitchen 28 29 // This is a compile-time assertion to ensure that this generated file 30 // is compatible with the proto package it is being compiled against. 31 // A compilation error at this line likely means your copy of the 32 // proto package needs to be updated. 33 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 34 35 // BasicAllowance implements Allowance with a one-time grant of tokens 36 // that optionally expires. The grantee can use up to SpendLimit to cover fees. 37 type BasicAllowance struct { 38 // spend_limit specifies the maximum amount of tokens that can be spent 39 // by this allowance and will be updated as tokens are spent. If it is 40 // empty, there is no spend limit and any amount of coins can be spent. 41 SpendLimit github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"spend_limit"` 42 // expiration specifies an optional time when this allowance expires 43 Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` 44 } 45 46 func (m *BasicAllowance) Reset() { *m = BasicAllowance{} } 47 func (m *BasicAllowance) String() string { return proto.CompactTextString(m) } 48 func (*BasicAllowance) ProtoMessage() {} 49 func (*BasicAllowance) Descriptor() ([]byte, []int) { 50 return fileDescriptor_7279582900c30aea, []int{0} 51 } 52 func (m *BasicAllowance) XXX_Unmarshal(b []byte) error { 53 return m.Unmarshal(b) 54 } 55 func (m *BasicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 56 if deterministic { 57 return xxx_messageInfo_BasicAllowance.Marshal(b, m, deterministic) 58 } else { 59 b = b[:cap(b)] 60 n, err := m.MarshalToSizedBuffer(b) 61 if err != nil { 62 return nil, err 63 } 64 return b[:n], nil 65 } 66 } 67 func (m *BasicAllowance) XXX_Merge(src proto.Message) { 68 xxx_messageInfo_BasicAllowance.Merge(m, src) 69 } 70 func (m *BasicAllowance) XXX_Size() int { 71 return m.Size() 72 } 73 func (m *BasicAllowance) XXX_DiscardUnknown() { 74 xxx_messageInfo_BasicAllowance.DiscardUnknown(m) 75 } 76 77 var xxx_messageInfo_BasicAllowance proto.InternalMessageInfo 78 79 func (m *BasicAllowance) GetSpendLimit() github_com_Finschia_finschia_sdk_types.Coins { 80 if m != nil { 81 return m.SpendLimit 82 } 83 return nil 84 } 85 86 func (m *BasicAllowance) GetExpiration() *time.Time { 87 if m != nil { 88 return m.Expiration 89 } 90 return nil 91 } 92 93 // PeriodicAllowance extends Allowance to allow for both a maximum cap, 94 // as well as a limit per time period. 95 type PeriodicAllowance struct { 96 // basic specifies a struct of `BasicAllowance` 97 Basic BasicAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"` 98 // period specifies the time duration in which period_spend_limit coins can 99 // be spent before that allowance is reset 100 Period time.Duration `protobuf:"bytes,2,opt,name=period,proto3,stdduration" json:"period"` 101 // period_spend_limit specifies the maximum number of coins that can be spent 102 // in the period 103 PeriodSpendLimit github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,3,rep,name=period_spend_limit,json=periodSpendLimit,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"period_spend_limit"` 104 // period_can_spend is the number of coins left to be spent before the period_reset time 105 PeriodCanSpend github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,4,rep,name=period_can_spend,json=periodCanSpend,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"period_can_spend"` 106 // period_reset is the time at which this period resets and a new one begins, 107 // it is calculated from the start time of the first transaction after the 108 // last period ended 109 PeriodReset time.Time `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3,stdtime" json:"period_reset"` 110 } 111 112 func (m *PeriodicAllowance) Reset() { *m = PeriodicAllowance{} } 113 func (m *PeriodicAllowance) String() string { return proto.CompactTextString(m) } 114 func (*PeriodicAllowance) ProtoMessage() {} 115 func (*PeriodicAllowance) Descriptor() ([]byte, []int) { 116 return fileDescriptor_7279582900c30aea, []int{1} 117 } 118 func (m *PeriodicAllowance) XXX_Unmarshal(b []byte) error { 119 return m.Unmarshal(b) 120 } 121 func (m *PeriodicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 122 if deterministic { 123 return xxx_messageInfo_PeriodicAllowance.Marshal(b, m, deterministic) 124 } else { 125 b = b[:cap(b)] 126 n, err := m.MarshalToSizedBuffer(b) 127 if err != nil { 128 return nil, err 129 } 130 return b[:n], nil 131 } 132 } 133 func (m *PeriodicAllowance) XXX_Merge(src proto.Message) { 134 xxx_messageInfo_PeriodicAllowance.Merge(m, src) 135 } 136 func (m *PeriodicAllowance) XXX_Size() int { 137 return m.Size() 138 } 139 func (m *PeriodicAllowance) XXX_DiscardUnknown() { 140 xxx_messageInfo_PeriodicAllowance.DiscardUnknown(m) 141 } 142 143 var xxx_messageInfo_PeriodicAllowance proto.InternalMessageInfo 144 145 func (m *PeriodicAllowance) GetBasic() BasicAllowance { 146 if m != nil { 147 return m.Basic 148 } 149 return BasicAllowance{} 150 } 151 152 func (m *PeriodicAllowance) GetPeriod() time.Duration { 153 if m != nil { 154 return m.Period 155 } 156 return 0 157 } 158 159 func (m *PeriodicAllowance) GetPeriodSpendLimit() github_com_Finschia_finschia_sdk_types.Coins { 160 if m != nil { 161 return m.PeriodSpendLimit 162 } 163 return nil 164 } 165 166 func (m *PeriodicAllowance) GetPeriodCanSpend() github_com_Finschia_finschia_sdk_types.Coins { 167 if m != nil { 168 return m.PeriodCanSpend 169 } 170 return nil 171 } 172 173 func (m *PeriodicAllowance) GetPeriodReset() time.Time { 174 if m != nil { 175 return m.PeriodReset 176 } 177 return time.Time{} 178 } 179 180 // AllowedMsgAllowance creates allowance only for specified message types. 181 type AllowedMsgAllowance struct { 182 // allowance can be any of basic and filtered fee allowance. 183 Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` 184 // allowed_messages are the messages for which the grantee has the access. 185 AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"` 186 } 187 188 func (m *AllowedMsgAllowance) Reset() { *m = AllowedMsgAllowance{} } 189 func (m *AllowedMsgAllowance) String() string { return proto.CompactTextString(m) } 190 func (*AllowedMsgAllowance) ProtoMessage() {} 191 func (*AllowedMsgAllowance) Descriptor() ([]byte, []int) { 192 return fileDescriptor_7279582900c30aea, []int{2} 193 } 194 func (m *AllowedMsgAllowance) XXX_Unmarshal(b []byte) error { 195 return m.Unmarshal(b) 196 } 197 func (m *AllowedMsgAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 198 if deterministic { 199 return xxx_messageInfo_AllowedMsgAllowance.Marshal(b, m, deterministic) 200 } else { 201 b = b[:cap(b)] 202 n, err := m.MarshalToSizedBuffer(b) 203 if err != nil { 204 return nil, err 205 } 206 return b[:n], nil 207 } 208 } 209 func (m *AllowedMsgAllowance) XXX_Merge(src proto.Message) { 210 xxx_messageInfo_AllowedMsgAllowance.Merge(m, src) 211 } 212 func (m *AllowedMsgAllowance) XXX_Size() int { 213 return m.Size() 214 } 215 func (m *AllowedMsgAllowance) XXX_DiscardUnknown() { 216 xxx_messageInfo_AllowedMsgAllowance.DiscardUnknown(m) 217 } 218 219 var xxx_messageInfo_AllowedMsgAllowance proto.InternalMessageInfo 220 221 // Grant is stored in the KVStore to record a grant with full context 222 type Grant struct { 223 // granter is the address of the user granting an allowance of their funds. 224 Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty" yaml:"granter_address"` 225 // grantee is the address of the user being granted an allowance of another user's funds. 226 Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty" yaml:"grantee_address"` 227 // allowance can be any of basic and filtered fee allowance. 228 Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` 229 } 230 231 func (m *Grant) Reset() { *m = Grant{} } 232 func (m *Grant) String() string { return proto.CompactTextString(m) } 233 func (*Grant) ProtoMessage() {} 234 func (*Grant) Descriptor() ([]byte, []int) { 235 return fileDescriptor_7279582900c30aea, []int{3} 236 } 237 func (m *Grant) XXX_Unmarshal(b []byte) error { 238 return m.Unmarshal(b) 239 } 240 func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 241 if deterministic { 242 return xxx_messageInfo_Grant.Marshal(b, m, deterministic) 243 } else { 244 b = b[:cap(b)] 245 n, err := m.MarshalToSizedBuffer(b) 246 if err != nil { 247 return nil, err 248 } 249 return b[:n], nil 250 } 251 } 252 func (m *Grant) XXX_Merge(src proto.Message) { 253 xxx_messageInfo_Grant.Merge(m, src) 254 } 255 func (m *Grant) XXX_Size() int { 256 return m.Size() 257 } 258 func (m *Grant) XXX_DiscardUnknown() { 259 xxx_messageInfo_Grant.DiscardUnknown(m) 260 } 261 262 var xxx_messageInfo_Grant proto.InternalMessageInfo 263 264 func (m *Grant) GetGranter() string { 265 if m != nil { 266 return m.Granter 267 } 268 return "" 269 } 270 271 func (m *Grant) GetGrantee() string { 272 if m != nil { 273 return m.Grantee 274 } 275 return "" 276 } 277 278 func (m *Grant) GetAllowance() *types1.Any { 279 if m != nil { 280 return m.Allowance 281 } 282 return nil 283 } 284 285 func init() { 286 proto.RegisterType((*BasicAllowance)(nil), "cosmos.feegrant.v1beta1.BasicAllowance") 287 proto.RegisterType((*PeriodicAllowance)(nil), "cosmos.feegrant.v1beta1.PeriodicAllowance") 288 proto.RegisterType((*AllowedMsgAllowance)(nil), "cosmos.feegrant.v1beta1.AllowedMsgAllowance") 289 proto.RegisterType((*Grant)(nil), "cosmos.feegrant.v1beta1.Grant") 290 } 291 292 func init() { 293 proto.RegisterFile("cosmos/feegrant/v1beta1/feegrant.proto", fileDescriptor_7279582900c30aea) 294 } 295 296 var fileDescriptor_7279582900c30aea = []byte{ 297 // 596 bytes of a gzipped FileDescriptorProto 298 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x3f, 0x6f, 0xd3, 0x40, 299 0x14, 0x8f, 0x9b, 0xb6, 0xd0, 0x0b, 0x94, 0xd6, 0x14, 0x70, 0x33, 0xd8, 0x51, 0x06, 0x08, 0x82, 300 0xda, 0x6a, 0xe9, 0x14, 0x16, 0xea, 0xd0, 0x56, 0x48, 0x54, 0x42, 0x86, 0x89, 0xc5, 0x3a, 0xdb, 301 0x2f, 0xee, 0x89, 0xd8, 0x67, 0xf9, 0x1c, 0x68, 0x06, 0x76, 0xc6, 0x8e, 0x4c, 0x88, 0x99, 0x99, 302 0x89, 0x4f, 0x50, 0x31, 0x55, 0x2c, 0x30, 0xb5, 0x28, 0x19, 0xd9, 0xf8, 0x04, 0xc8, 0x77, 0xe7, 303 0x24, 0x24, 0x45, 0x95, 0x90, 0xba, 0xf9, 0xde, 0xbd, 0xdf, 0xbf, 0xf7, 0x4e, 0x46, 0xb7, 0x7d, 304 0xca, 0x22, 0xca, 0xac, 0x36, 0x40, 0x98, 0xe2, 0x38, 0xb3, 0x5e, 0xaf, 0x7b, 0x90, 0xe1, 0xf5, 305 0x61, 0xc1, 0x4c, 0x52, 0x9a, 0x51, 0xf5, 0x96, 0xe8, 0x33, 0x87, 0x65, 0xd9, 0x57, 0x5d, 0x09, 306 0x69, 0x48, 0x79, 0x8f, 0x95, 0x7f, 0x89, 0xf6, 0xea, 0x6a, 0x48, 0x69, 0xd8, 0x01, 0x8b, 0x9f, 307 0xbc, 0x6e, 0xdb, 0xc2, 0x71, 0xaf, 0xb8, 0x12, 0x4c, 0xae, 0xc0, 0x48, 0x5a, 0x71, 0xa5, 0x4b, 308 0x33, 0x1e, 0x66, 0x30, 0x34, 0xe2, 0x53, 0x12, 0xcb, 0x7b, 0x63, 0x92, 0x35, 0x23, 0x11, 0xb0, 309 0x0c, 0x47, 0x49, 0x41, 0x30, 0xd9, 0x10, 0x74, 0x53, 0x9c, 0x11, 0x2a, 0x09, 0xea, 0xdf, 0x15, 310 0xb4, 0x68, 0x63, 0x46, 0xfc, 0xad, 0x4e, 0x87, 0xbe, 0xc1, 0xb1, 0x0f, 0x6a, 0x82, 0x2a, 0x2c, 311 0x81, 0x38, 0x70, 0x3b, 0x24, 0x22, 0x99, 0xa6, 0xd4, 0xca, 0x8d, 0xca, 0xc6, 0xaa, 0x29, 0x7d, 312 0xe5, 0x4e, 0x8a, 0xa8, 0x66, 0x8b, 0x92, 0xd8, 0xde, 0x3c, 0x3a, 0x31, 0x4a, 0x9f, 0x4e, 0x8d, 313 0xfb, 0x21, 0xc9, 0xf6, 0xbb, 0x9e, 0xe9, 0xd3, 0xc8, 0xda, 0x21, 0x31, 0xf3, 0xf7, 0x09, 0xb6, 314 0xda, 0xf2, 0x63, 0x8d, 0x05, 0xaf, 0xac, 0xac, 0x97, 0x00, 0xe3, 0x20, 0xe6, 0x20, 0xae, 0xf1, 315 0x34, 0x97, 0x50, 0x1f, 0x21, 0x04, 0x07, 0x09, 0x11, 0xc6, 0xb4, 0x99, 0x9a, 0xd2, 0xa8, 0x6c, 316 0x54, 0x4d, 0xe1, 0xdc, 0x2c, 0x9c, 0x9b, 0x2f, 0x8a, 0x68, 0xf6, 0xec, 0xe1, 0xa9, 0xa1, 0x38, 317 0x63, 0x98, 0xe6, 0xf2, 0xb7, 0xcf, 0x6b, 0x57, 0x77, 0x00, 0x86, 0x29, 0x9e, 0xd4, 0x7f, 0x95, 318 0xd1, 0xf2, 0x33, 0x48, 0x09, 0x0d, 0xc6, 0xc3, 0xb5, 0xd0, 0x9c, 0x97, 0xc7, 0xd5, 0x14, 0xae, 319 0x72, 0xc7, 0xfc, 0xc7, 0x16, 0xcd, 0xbf, 0x87, 0x62, 0xcf, 0xe6, 0x21, 0x1d, 0x81, 0x55, 0x1f, 320 0xa2, 0xf9, 0x84, 0x33, 0x4b, 0xaf, 0xab, 0x53, 0x5e, 0x1f, 0xcb, 0x29, 0xdb, 0x97, 0x73, 0xdc, 321 0xfb, 0xdc, 0xae, 0x84, 0xa8, 0x6f, 0x91, 0x2a, 0xbe, 0xdc, 0xf1, 0x29, 0x97, 0x2f, 0x66, 0xca, 322 0x4b, 0x42, 0xea, 0xf9, 0x68, 0xd6, 0x3d, 0x24, 0x6b, 0xae, 0x8f, 0x63, 0x61, 0x41, 0x9b, 0xbd, 323 0x18, 0xf1, 0x45, 0x21, 0xd4, 0xc2, 0x31, 0xd7, 0x57, 0x77, 0xd1, 0x15, 0x29, 0x9d, 0x02, 0x83, 324 0x4c, 0x9b, 0x3b, 0x77, 0xd1, 0x7c, 0x7a, 0x7c, 0xd9, 0x15, 0x81, 0x74, 0x72, 0xe0, 0x59, 0xdb, 325 0xfe, 0xa0, 0xa0, 0xeb, 0xfc, 0x08, 0xc1, 0x1e, 0x0b, 0x47, 0xfb, 0xde, 0x46, 0x0b, 0xb8, 0x38, 326 0xc8, 0x9d, 0xaf, 0x4c, 0x09, 0x6e, 0xc5, 0x3d, 0x7b, 0xf9, 0xeb, 0x24, 0xa7, 0x33, 0x42, 0xaa, 327 0x77, 0xd1, 0x12, 0x16, 0xec, 0x6e, 0x04, 0x8c, 0xe1, 0x10, 0x98, 0x36, 0x53, 0x2b, 0x37, 0x16, 328 0x9c, 0x6b, 0xb2, 0xbe, 0x27, 0xcb, 0xcd, 0x1b, 0xef, 0x3e, 0x1a, 0xa5, 0x69, 0x83, 0x5f, 0x14, 329 0x34, 0xb7, 0x9b, 0xbf, 0x30, 0x75, 0x13, 0x5d, 0xe2, 0x4f, 0x0d, 0x52, 0x6e, 0x68, 0xc1, 0xae, 330 0xfe, 0x3e, 0x31, 0x6e, 0xf6, 0x70, 0xd4, 0x69, 0xd6, 0xe5, 0x85, 0x8b, 0x83, 0x20, 0x05, 0xc6, 331 0xea, 0x4e, 0xd1, 0x3a, 0x42, 0x01, 0x7f, 0x74, 0x67, 0xa0, 0x60, 0x0a, 0x35, 0x11, 0xbf, 0xfc, 332 0xbf, 0xf1, 0xed, 0xed, 0xa3, 0xbe, 0xae, 0x1c, 0xf7, 0x75, 0xe5, 0x67, 0x5f, 0x57, 0x0e, 0x07, 333 0x7a, 0xe9, 0x78, 0xa0, 0x97, 0x7e, 0x0c, 0xf4, 0xd2, 0xcb, 0x7b, 0xe7, 0xbe, 0x88, 0x83, 0xe1, 334 0x8f, 0xd3, 0x9b, 0xe7, 0x92, 0x0f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x6b, 0x74, 0x9f, 335 0x63, 0x05, 0x00, 0x00, 336 } 337 338 func (m *BasicAllowance) Marshal() (dAtA []byte, err error) { 339 size := m.Size() 340 dAtA = make([]byte, size) 341 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 342 if err != nil { 343 return nil, err 344 } 345 return dAtA[:n], nil 346 } 347 348 func (m *BasicAllowance) MarshalTo(dAtA []byte) (int, error) { 349 size := m.Size() 350 return m.MarshalToSizedBuffer(dAtA[:size]) 351 } 352 353 func (m *BasicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { 354 i := len(dAtA) 355 _ = i 356 var l int 357 _ = l 358 if m.Expiration != nil { 359 n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) 360 if err1 != nil { 361 return 0, err1 362 } 363 i -= n1 364 i = encodeVarintFeegrant(dAtA, i, uint64(n1)) 365 i-- 366 dAtA[i] = 0x12 367 } 368 if len(m.SpendLimit) > 0 { 369 for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { 370 { 371 size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 372 if err != nil { 373 return 0, err 374 } 375 i -= size 376 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 377 } 378 i-- 379 dAtA[i] = 0xa 380 } 381 } 382 return len(dAtA) - i, nil 383 } 384 385 func (m *PeriodicAllowance) Marshal() (dAtA []byte, err error) { 386 size := m.Size() 387 dAtA = make([]byte, size) 388 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 389 if err != nil { 390 return nil, err 391 } 392 return dAtA[:n], nil 393 } 394 395 func (m *PeriodicAllowance) MarshalTo(dAtA []byte) (int, error) { 396 size := m.Size() 397 return m.MarshalToSizedBuffer(dAtA[:size]) 398 } 399 400 func (m *PeriodicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { 401 i := len(dAtA) 402 _ = i 403 var l int 404 _ = l 405 n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.PeriodReset, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.PeriodReset):]) 406 if err2 != nil { 407 return 0, err2 408 } 409 i -= n2 410 i = encodeVarintFeegrant(dAtA, i, uint64(n2)) 411 i-- 412 dAtA[i] = 0x2a 413 if len(m.PeriodCanSpend) > 0 { 414 for iNdEx := len(m.PeriodCanSpend) - 1; iNdEx >= 0; iNdEx-- { 415 { 416 size, err := m.PeriodCanSpend[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 417 if err != nil { 418 return 0, err 419 } 420 i -= size 421 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 422 } 423 i-- 424 dAtA[i] = 0x22 425 } 426 } 427 if len(m.PeriodSpendLimit) > 0 { 428 for iNdEx := len(m.PeriodSpendLimit) - 1; iNdEx >= 0; iNdEx-- { 429 { 430 size, err := m.PeriodSpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 431 if err != nil { 432 return 0, err 433 } 434 i -= size 435 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 436 } 437 i-- 438 dAtA[i] = 0x1a 439 } 440 } 441 n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period):]) 442 if err3 != nil { 443 return 0, err3 444 } 445 i -= n3 446 i = encodeVarintFeegrant(dAtA, i, uint64(n3)) 447 i-- 448 dAtA[i] = 0x12 449 { 450 size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) 451 if err != nil { 452 return 0, err 453 } 454 i -= size 455 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 456 } 457 i-- 458 dAtA[i] = 0xa 459 return len(dAtA) - i, nil 460 } 461 462 func (m *AllowedMsgAllowance) Marshal() (dAtA []byte, err error) { 463 size := m.Size() 464 dAtA = make([]byte, size) 465 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 466 if err != nil { 467 return nil, err 468 } 469 return dAtA[:n], nil 470 } 471 472 func (m *AllowedMsgAllowance) MarshalTo(dAtA []byte) (int, error) { 473 size := m.Size() 474 return m.MarshalToSizedBuffer(dAtA[:size]) 475 } 476 477 func (m *AllowedMsgAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { 478 i := len(dAtA) 479 _ = i 480 var l int 481 _ = l 482 if len(m.AllowedMessages) > 0 { 483 for iNdEx := len(m.AllowedMessages) - 1; iNdEx >= 0; iNdEx-- { 484 i -= len(m.AllowedMessages[iNdEx]) 485 copy(dAtA[i:], m.AllowedMessages[iNdEx]) 486 i = encodeVarintFeegrant(dAtA, i, uint64(len(m.AllowedMessages[iNdEx]))) 487 i-- 488 dAtA[i] = 0x12 489 } 490 } 491 if m.Allowance != nil { 492 { 493 size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) 494 if err != nil { 495 return 0, err 496 } 497 i -= size 498 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 499 } 500 i-- 501 dAtA[i] = 0xa 502 } 503 return len(dAtA) - i, nil 504 } 505 506 func (m *Grant) Marshal() (dAtA []byte, err error) { 507 size := m.Size() 508 dAtA = make([]byte, size) 509 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 510 if err != nil { 511 return nil, err 512 } 513 return dAtA[:n], nil 514 } 515 516 func (m *Grant) MarshalTo(dAtA []byte) (int, error) { 517 size := m.Size() 518 return m.MarshalToSizedBuffer(dAtA[:size]) 519 } 520 521 func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { 522 i := len(dAtA) 523 _ = i 524 var l int 525 _ = l 526 if m.Allowance != nil { 527 { 528 size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) 529 if err != nil { 530 return 0, err 531 } 532 i -= size 533 i = encodeVarintFeegrant(dAtA, i, uint64(size)) 534 } 535 i-- 536 dAtA[i] = 0x1a 537 } 538 if len(m.Grantee) > 0 { 539 i -= len(m.Grantee) 540 copy(dAtA[i:], m.Grantee) 541 i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Grantee))) 542 i-- 543 dAtA[i] = 0x12 544 } 545 if len(m.Granter) > 0 { 546 i -= len(m.Granter) 547 copy(dAtA[i:], m.Granter) 548 i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Granter))) 549 i-- 550 dAtA[i] = 0xa 551 } 552 return len(dAtA) - i, nil 553 } 554 555 func encodeVarintFeegrant(dAtA []byte, offset int, v uint64) int { 556 offset -= sovFeegrant(v) 557 base := offset 558 for v >= 1<<7 { 559 dAtA[offset] = uint8(v&0x7f | 0x80) 560 v >>= 7 561 offset++ 562 } 563 dAtA[offset] = uint8(v) 564 return base 565 } 566 func (m *BasicAllowance) Size() (n int) { 567 if m == nil { 568 return 0 569 } 570 var l int 571 _ = l 572 if len(m.SpendLimit) > 0 { 573 for _, e := range m.SpendLimit { 574 l = e.Size() 575 n += 1 + l + sovFeegrant(uint64(l)) 576 } 577 } 578 if m.Expiration != nil { 579 l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) 580 n += 1 + l + sovFeegrant(uint64(l)) 581 } 582 return n 583 } 584 585 func (m *PeriodicAllowance) Size() (n int) { 586 if m == nil { 587 return 0 588 } 589 var l int 590 _ = l 591 l = m.Basic.Size() 592 n += 1 + l + sovFeegrant(uint64(l)) 593 l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period) 594 n += 1 + l + sovFeegrant(uint64(l)) 595 if len(m.PeriodSpendLimit) > 0 { 596 for _, e := range m.PeriodSpendLimit { 597 l = e.Size() 598 n += 1 + l + sovFeegrant(uint64(l)) 599 } 600 } 601 if len(m.PeriodCanSpend) > 0 { 602 for _, e := range m.PeriodCanSpend { 603 l = e.Size() 604 n += 1 + l + sovFeegrant(uint64(l)) 605 } 606 } 607 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.PeriodReset) 608 n += 1 + l + sovFeegrant(uint64(l)) 609 return n 610 } 611 612 func (m *AllowedMsgAllowance) Size() (n int) { 613 if m == nil { 614 return 0 615 } 616 var l int 617 _ = l 618 if m.Allowance != nil { 619 l = m.Allowance.Size() 620 n += 1 + l + sovFeegrant(uint64(l)) 621 } 622 if len(m.AllowedMessages) > 0 { 623 for _, s := range m.AllowedMessages { 624 l = len(s) 625 n += 1 + l + sovFeegrant(uint64(l)) 626 } 627 } 628 return n 629 } 630 631 func (m *Grant) Size() (n int) { 632 if m == nil { 633 return 0 634 } 635 var l int 636 _ = l 637 l = len(m.Granter) 638 if l > 0 { 639 n += 1 + l + sovFeegrant(uint64(l)) 640 } 641 l = len(m.Grantee) 642 if l > 0 { 643 n += 1 + l + sovFeegrant(uint64(l)) 644 } 645 if m.Allowance != nil { 646 l = m.Allowance.Size() 647 n += 1 + l + sovFeegrant(uint64(l)) 648 } 649 return n 650 } 651 652 func sovFeegrant(x uint64) (n int) { 653 return (math_bits.Len64(x|1) + 6) / 7 654 } 655 func sozFeegrant(x uint64) (n int) { 656 return sovFeegrant(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 657 } 658 func (m *BasicAllowance) Unmarshal(dAtA []byte) error { 659 l := len(dAtA) 660 iNdEx := 0 661 for iNdEx < l { 662 preIndex := iNdEx 663 var wire uint64 664 for shift := uint(0); ; shift += 7 { 665 if shift >= 64 { 666 return ErrIntOverflowFeegrant 667 } 668 if iNdEx >= l { 669 return io.ErrUnexpectedEOF 670 } 671 b := dAtA[iNdEx] 672 iNdEx++ 673 wire |= uint64(b&0x7F) << shift 674 if b < 0x80 { 675 break 676 } 677 } 678 fieldNum := int32(wire >> 3) 679 wireType := int(wire & 0x7) 680 if wireType == 4 { 681 return fmt.Errorf("proto: BasicAllowance: wiretype end group for non-group") 682 } 683 if fieldNum <= 0 { 684 return fmt.Errorf("proto: BasicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) 685 } 686 switch fieldNum { 687 case 1: 688 if wireType != 2 { 689 return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) 690 } 691 var msglen int 692 for shift := uint(0); ; shift += 7 { 693 if shift >= 64 { 694 return ErrIntOverflowFeegrant 695 } 696 if iNdEx >= l { 697 return io.ErrUnexpectedEOF 698 } 699 b := dAtA[iNdEx] 700 iNdEx++ 701 msglen |= int(b&0x7F) << shift 702 if b < 0x80 { 703 break 704 } 705 } 706 if msglen < 0 { 707 return ErrInvalidLengthFeegrant 708 } 709 postIndex := iNdEx + msglen 710 if postIndex < 0 { 711 return ErrInvalidLengthFeegrant 712 } 713 if postIndex > l { 714 return io.ErrUnexpectedEOF 715 } 716 m.SpendLimit = append(m.SpendLimit, types.Coin{}) 717 if err := m.SpendLimit[len(m.SpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 718 return err 719 } 720 iNdEx = postIndex 721 case 2: 722 if wireType != 2 { 723 return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) 724 } 725 var msglen int 726 for shift := uint(0); ; shift += 7 { 727 if shift >= 64 { 728 return ErrIntOverflowFeegrant 729 } 730 if iNdEx >= l { 731 return io.ErrUnexpectedEOF 732 } 733 b := dAtA[iNdEx] 734 iNdEx++ 735 msglen |= int(b&0x7F) << shift 736 if b < 0x80 { 737 break 738 } 739 } 740 if msglen < 0 { 741 return ErrInvalidLengthFeegrant 742 } 743 postIndex := iNdEx + msglen 744 if postIndex < 0 { 745 return ErrInvalidLengthFeegrant 746 } 747 if postIndex > l { 748 return io.ErrUnexpectedEOF 749 } 750 if m.Expiration == nil { 751 m.Expiration = new(time.Time) 752 } 753 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { 754 return err 755 } 756 iNdEx = postIndex 757 default: 758 iNdEx = preIndex 759 skippy, err := skipFeegrant(dAtA[iNdEx:]) 760 if err != nil { 761 return err 762 } 763 if (skippy < 0) || (iNdEx+skippy) < 0 { 764 return ErrInvalidLengthFeegrant 765 } 766 if (iNdEx + skippy) > l { 767 return io.ErrUnexpectedEOF 768 } 769 iNdEx += skippy 770 } 771 } 772 773 if iNdEx > l { 774 return io.ErrUnexpectedEOF 775 } 776 return nil 777 } 778 func (m *PeriodicAllowance) Unmarshal(dAtA []byte) error { 779 l := len(dAtA) 780 iNdEx := 0 781 for iNdEx < l { 782 preIndex := iNdEx 783 var wire uint64 784 for shift := uint(0); ; shift += 7 { 785 if shift >= 64 { 786 return ErrIntOverflowFeegrant 787 } 788 if iNdEx >= l { 789 return io.ErrUnexpectedEOF 790 } 791 b := dAtA[iNdEx] 792 iNdEx++ 793 wire |= uint64(b&0x7F) << shift 794 if b < 0x80 { 795 break 796 } 797 } 798 fieldNum := int32(wire >> 3) 799 wireType := int(wire & 0x7) 800 if wireType == 4 { 801 return fmt.Errorf("proto: PeriodicAllowance: wiretype end group for non-group") 802 } 803 if fieldNum <= 0 { 804 return fmt.Errorf("proto: PeriodicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) 805 } 806 switch fieldNum { 807 case 1: 808 if wireType != 2 { 809 return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) 810 } 811 var msglen int 812 for shift := uint(0); ; shift += 7 { 813 if shift >= 64 { 814 return ErrIntOverflowFeegrant 815 } 816 if iNdEx >= l { 817 return io.ErrUnexpectedEOF 818 } 819 b := dAtA[iNdEx] 820 iNdEx++ 821 msglen |= int(b&0x7F) << shift 822 if b < 0x80 { 823 break 824 } 825 } 826 if msglen < 0 { 827 return ErrInvalidLengthFeegrant 828 } 829 postIndex := iNdEx + msglen 830 if postIndex < 0 { 831 return ErrInvalidLengthFeegrant 832 } 833 if postIndex > l { 834 return io.ErrUnexpectedEOF 835 } 836 if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 837 return err 838 } 839 iNdEx = postIndex 840 case 2: 841 if wireType != 2 { 842 return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) 843 } 844 var msglen int 845 for shift := uint(0); ; shift += 7 { 846 if shift >= 64 { 847 return ErrIntOverflowFeegrant 848 } 849 if iNdEx >= l { 850 return io.ErrUnexpectedEOF 851 } 852 b := dAtA[iNdEx] 853 iNdEx++ 854 msglen |= int(b&0x7F) << shift 855 if b < 0x80 { 856 break 857 } 858 } 859 if msglen < 0 { 860 return ErrInvalidLengthFeegrant 861 } 862 postIndex := iNdEx + msglen 863 if postIndex < 0 { 864 return ErrInvalidLengthFeegrant 865 } 866 if postIndex > l { 867 return io.ErrUnexpectedEOF 868 } 869 if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Period, dAtA[iNdEx:postIndex]); err != nil { 870 return err 871 } 872 iNdEx = postIndex 873 case 3: 874 if wireType != 2 { 875 return fmt.Errorf("proto: wrong wireType = %d for field PeriodSpendLimit", wireType) 876 } 877 var msglen int 878 for shift := uint(0); ; shift += 7 { 879 if shift >= 64 { 880 return ErrIntOverflowFeegrant 881 } 882 if iNdEx >= l { 883 return io.ErrUnexpectedEOF 884 } 885 b := dAtA[iNdEx] 886 iNdEx++ 887 msglen |= int(b&0x7F) << shift 888 if b < 0x80 { 889 break 890 } 891 } 892 if msglen < 0 { 893 return ErrInvalidLengthFeegrant 894 } 895 postIndex := iNdEx + msglen 896 if postIndex < 0 { 897 return ErrInvalidLengthFeegrant 898 } 899 if postIndex > l { 900 return io.ErrUnexpectedEOF 901 } 902 m.PeriodSpendLimit = append(m.PeriodSpendLimit, types.Coin{}) 903 if err := m.PeriodSpendLimit[len(m.PeriodSpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 904 return err 905 } 906 iNdEx = postIndex 907 case 4: 908 if wireType != 2 { 909 return fmt.Errorf("proto: wrong wireType = %d for field PeriodCanSpend", wireType) 910 } 911 var msglen int 912 for shift := uint(0); ; shift += 7 { 913 if shift >= 64 { 914 return ErrIntOverflowFeegrant 915 } 916 if iNdEx >= l { 917 return io.ErrUnexpectedEOF 918 } 919 b := dAtA[iNdEx] 920 iNdEx++ 921 msglen |= int(b&0x7F) << shift 922 if b < 0x80 { 923 break 924 } 925 } 926 if msglen < 0 { 927 return ErrInvalidLengthFeegrant 928 } 929 postIndex := iNdEx + msglen 930 if postIndex < 0 { 931 return ErrInvalidLengthFeegrant 932 } 933 if postIndex > l { 934 return io.ErrUnexpectedEOF 935 } 936 m.PeriodCanSpend = append(m.PeriodCanSpend, types.Coin{}) 937 if err := m.PeriodCanSpend[len(m.PeriodCanSpend)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 938 return err 939 } 940 iNdEx = postIndex 941 case 5: 942 if wireType != 2 { 943 return fmt.Errorf("proto: wrong wireType = %d for field PeriodReset", wireType) 944 } 945 var msglen int 946 for shift := uint(0); ; shift += 7 { 947 if shift >= 64 { 948 return ErrIntOverflowFeegrant 949 } 950 if iNdEx >= l { 951 return io.ErrUnexpectedEOF 952 } 953 b := dAtA[iNdEx] 954 iNdEx++ 955 msglen |= int(b&0x7F) << shift 956 if b < 0x80 { 957 break 958 } 959 } 960 if msglen < 0 { 961 return ErrInvalidLengthFeegrant 962 } 963 postIndex := iNdEx + msglen 964 if postIndex < 0 { 965 return ErrInvalidLengthFeegrant 966 } 967 if postIndex > l { 968 return io.ErrUnexpectedEOF 969 } 970 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.PeriodReset, dAtA[iNdEx:postIndex]); err != nil { 971 return err 972 } 973 iNdEx = postIndex 974 default: 975 iNdEx = preIndex 976 skippy, err := skipFeegrant(dAtA[iNdEx:]) 977 if err != nil { 978 return err 979 } 980 if (skippy < 0) || (iNdEx+skippy) < 0 { 981 return ErrInvalidLengthFeegrant 982 } 983 if (iNdEx + skippy) > l { 984 return io.ErrUnexpectedEOF 985 } 986 iNdEx += skippy 987 } 988 } 989 990 if iNdEx > l { 991 return io.ErrUnexpectedEOF 992 } 993 return nil 994 } 995 func (m *AllowedMsgAllowance) Unmarshal(dAtA []byte) error { 996 l := len(dAtA) 997 iNdEx := 0 998 for iNdEx < l { 999 preIndex := iNdEx 1000 var wire uint64 1001 for shift := uint(0); ; shift += 7 { 1002 if shift >= 64 { 1003 return ErrIntOverflowFeegrant 1004 } 1005 if iNdEx >= l { 1006 return io.ErrUnexpectedEOF 1007 } 1008 b := dAtA[iNdEx] 1009 iNdEx++ 1010 wire |= uint64(b&0x7F) << shift 1011 if b < 0x80 { 1012 break 1013 } 1014 } 1015 fieldNum := int32(wire >> 3) 1016 wireType := int(wire & 0x7) 1017 if wireType == 4 { 1018 return fmt.Errorf("proto: AllowedMsgAllowance: wiretype end group for non-group") 1019 } 1020 if fieldNum <= 0 { 1021 return fmt.Errorf("proto: AllowedMsgAllowance: illegal tag %d (wire type %d)", fieldNum, wire) 1022 } 1023 switch fieldNum { 1024 case 1: 1025 if wireType != 2 { 1026 return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) 1027 } 1028 var msglen int 1029 for shift := uint(0); ; shift += 7 { 1030 if shift >= 64 { 1031 return ErrIntOverflowFeegrant 1032 } 1033 if iNdEx >= l { 1034 return io.ErrUnexpectedEOF 1035 } 1036 b := dAtA[iNdEx] 1037 iNdEx++ 1038 msglen |= int(b&0x7F) << shift 1039 if b < 0x80 { 1040 break 1041 } 1042 } 1043 if msglen < 0 { 1044 return ErrInvalidLengthFeegrant 1045 } 1046 postIndex := iNdEx + msglen 1047 if postIndex < 0 { 1048 return ErrInvalidLengthFeegrant 1049 } 1050 if postIndex > l { 1051 return io.ErrUnexpectedEOF 1052 } 1053 if m.Allowance == nil { 1054 m.Allowance = &types1.Any{} 1055 } 1056 if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1057 return err 1058 } 1059 iNdEx = postIndex 1060 case 2: 1061 if wireType != 2 { 1062 return fmt.Errorf("proto: wrong wireType = %d for field AllowedMessages", wireType) 1063 } 1064 var stringLen uint64 1065 for shift := uint(0); ; shift += 7 { 1066 if shift >= 64 { 1067 return ErrIntOverflowFeegrant 1068 } 1069 if iNdEx >= l { 1070 return io.ErrUnexpectedEOF 1071 } 1072 b := dAtA[iNdEx] 1073 iNdEx++ 1074 stringLen |= uint64(b&0x7F) << shift 1075 if b < 0x80 { 1076 break 1077 } 1078 } 1079 intStringLen := int(stringLen) 1080 if intStringLen < 0 { 1081 return ErrInvalidLengthFeegrant 1082 } 1083 postIndex := iNdEx + intStringLen 1084 if postIndex < 0 { 1085 return ErrInvalidLengthFeegrant 1086 } 1087 if postIndex > l { 1088 return io.ErrUnexpectedEOF 1089 } 1090 m.AllowedMessages = append(m.AllowedMessages, string(dAtA[iNdEx:postIndex])) 1091 iNdEx = postIndex 1092 default: 1093 iNdEx = preIndex 1094 skippy, err := skipFeegrant(dAtA[iNdEx:]) 1095 if err != nil { 1096 return err 1097 } 1098 if (skippy < 0) || (iNdEx+skippy) < 0 { 1099 return ErrInvalidLengthFeegrant 1100 } 1101 if (iNdEx + skippy) > l { 1102 return io.ErrUnexpectedEOF 1103 } 1104 iNdEx += skippy 1105 } 1106 } 1107 1108 if iNdEx > l { 1109 return io.ErrUnexpectedEOF 1110 } 1111 return nil 1112 } 1113 func (m *Grant) Unmarshal(dAtA []byte) error { 1114 l := len(dAtA) 1115 iNdEx := 0 1116 for iNdEx < l { 1117 preIndex := iNdEx 1118 var wire uint64 1119 for shift := uint(0); ; shift += 7 { 1120 if shift >= 64 { 1121 return ErrIntOverflowFeegrant 1122 } 1123 if iNdEx >= l { 1124 return io.ErrUnexpectedEOF 1125 } 1126 b := dAtA[iNdEx] 1127 iNdEx++ 1128 wire |= uint64(b&0x7F) << shift 1129 if b < 0x80 { 1130 break 1131 } 1132 } 1133 fieldNum := int32(wire >> 3) 1134 wireType := int(wire & 0x7) 1135 if wireType == 4 { 1136 return fmt.Errorf("proto: Grant: wiretype end group for non-group") 1137 } 1138 if fieldNum <= 0 { 1139 return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) 1140 } 1141 switch fieldNum { 1142 case 1: 1143 if wireType != 2 { 1144 return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) 1145 } 1146 var stringLen uint64 1147 for shift := uint(0); ; shift += 7 { 1148 if shift >= 64 { 1149 return ErrIntOverflowFeegrant 1150 } 1151 if iNdEx >= l { 1152 return io.ErrUnexpectedEOF 1153 } 1154 b := dAtA[iNdEx] 1155 iNdEx++ 1156 stringLen |= uint64(b&0x7F) << shift 1157 if b < 0x80 { 1158 break 1159 } 1160 } 1161 intStringLen := int(stringLen) 1162 if intStringLen < 0 { 1163 return ErrInvalidLengthFeegrant 1164 } 1165 postIndex := iNdEx + intStringLen 1166 if postIndex < 0 { 1167 return ErrInvalidLengthFeegrant 1168 } 1169 if postIndex > l { 1170 return io.ErrUnexpectedEOF 1171 } 1172 m.Granter = string(dAtA[iNdEx:postIndex]) 1173 iNdEx = postIndex 1174 case 2: 1175 if wireType != 2 { 1176 return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) 1177 } 1178 var stringLen uint64 1179 for shift := uint(0); ; shift += 7 { 1180 if shift >= 64 { 1181 return ErrIntOverflowFeegrant 1182 } 1183 if iNdEx >= l { 1184 return io.ErrUnexpectedEOF 1185 } 1186 b := dAtA[iNdEx] 1187 iNdEx++ 1188 stringLen |= uint64(b&0x7F) << shift 1189 if b < 0x80 { 1190 break 1191 } 1192 } 1193 intStringLen := int(stringLen) 1194 if intStringLen < 0 { 1195 return ErrInvalidLengthFeegrant 1196 } 1197 postIndex := iNdEx + intStringLen 1198 if postIndex < 0 { 1199 return ErrInvalidLengthFeegrant 1200 } 1201 if postIndex > l { 1202 return io.ErrUnexpectedEOF 1203 } 1204 m.Grantee = string(dAtA[iNdEx:postIndex]) 1205 iNdEx = postIndex 1206 case 3: 1207 if wireType != 2 { 1208 return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) 1209 } 1210 var msglen int 1211 for shift := uint(0); ; shift += 7 { 1212 if shift >= 64 { 1213 return ErrIntOverflowFeegrant 1214 } 1215 if iNdEx >= l { 1216 return io.ErrUnexpectedEOF 1217 } 1218 b := dAtA[iNdEx] 1219 iNdEx++ 1220 msglen |= int(b&0x7F) << shift 1221 if b < 0x80 { 1222 break 1223 } 1224 } 1225 if msglen < 0 { 1226 return ErrInvalidLengthFeegrant 1227 } 1228 postIndex := iNdEx + msglen 1229 if postIndex < 0 { 1230 return ErrInvalidLengthFeegrant 1231 } 1232 if postIndex > l { 1233 return io.ErrUnexpectedEOF 1234 } 1235 if m.Allowance == nil { 1236 m.Allowance = &types1.Any{} 1237 } 1238 if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1239 return err 1240 } 1241 iNdEx = postIndex 1242 default: 1243 iNdEx = preIndex 1244 skippy, err := skipFeegrant(dAtA[iNdEx:]) 1245 if err != nil { 1246 return err 1247 } 1248 if (skippy < 0) || (iNdEx+skippy) < 0 { 1249 return ErrInvalidLengthFeegrant 1250 } 1251 if (iNdEx + skippy) > l { 1252 return io.ErrUnexpectedEOF 1253 } 1254 iNdEx += skippy 1255 } 1256 } 1257 1258 if iNdEx > l { 1259 return io.ErrUnexpectedEOF 1260 } 1261 return nil 1262 } 1263 func skipFeegrant(dAtA []byte) (n int, err error) { 1264 l := len(dAtA) 1265 iNdEx := 0 1266 depth := 0 1267 for iNdEx < l { 1268 var wire uint64 1269 for shift := uint(0); ; shift += 7 { 1270 if shift >= 64 { 1271 return 0, ErrIntOverflowFeegrant 1272 } 1273 if iNdEx >= l { 1274 return 0, io.ErrUnexpectedEOF 1275 } 1276 b := dAtA[iNdEx] 1277 iNdEx++ 1278 wire |= (uint64(b) & 0x7F) << shift 1279 if b < 0x80 { 1280 break 1281 } 1282 } 1283 wireType := int(wire & 0x7) 1284 switch wireType { 1285 case 0: 1286 for shift := uint(0); ; shift += 7 { 1287 if shift >= 64 { 1288 return 0, ErrIntOverflowFeegrant 1289 } 1290 if iNdEx >= l { 1291 return 0, io.ErrUnexpectedEOF 1292 } 1293 iNdEx++ 1294 if dAtA[iNdEx-1] < 0x80 { 1295 break 1296 } 1297 } 1298 case 1: 1299 iNdEx += 8 1300 case 2: 1301 var length int 1302 for shift := uint(0); ; shift += 7 { 1303 if shift >= 64 { 1304 return 0, ErrIntOverflowFeegrant 1305 } 1306 if iNdEx >= l { 1307 return 0, io.ErrUnexpectedEOF 1308 } 1309 b := dAtA[iNdEx] 1310 iNdEx++ 1311 length |= (int(b) & 0x7F) << shift 1312 if b < 0x80 { 1313 break 1314 } 1315 } 1316 if length < 0 { 1317 return 0, ErrInvalidLengthFeegrant 1318 } 1319 iNdEx += length 1320 case 3: 1321 depth++ 1322 case 4: 1323 if depth == 0 { 1324 return 0, ErrUnexpectedEndOfGroupFeegrant 1325 } 1326 depth-- 1327 case 5: 1328 iNdEx += 4 1329 default: 1330 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1331 } 1332 if iNdEx < 0 { 1333 return 0, ErrInvalidLengthFeegrant 1334 } 1335 if depth == 0 { 1336 return iNdEx, nil 1337 } 1338 } 1339 return 0, io.ErrUnexpectedEOF 1340 } 1341 1342 var ( 1343 ErrInvalidLengthFeegrant = fmt.Errorf("proto: negative length found during unmarshaling") 1344 ErrIntOverflowFeegrant = fmt.Errorf("proto: integer overflow") 1345 ErrUnexpectedEndOfGroupFeegrant = fmt.Errorf("proto: unexpected end of group") 1346 )