github.com/InjectiveLabs/sdk-go@v1.53.0/chain/permissions/types/permissions.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: injective/permissions/v1beta1/permissions.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" 9 types "github.com/cosmos/cosmos-sdk/types" 10 _ "github.com/cosmos/gogoproto/gogoproto" 11 proto "github.com/cosmos/gogoproto/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 // each Action enum value should be a power of two 29 type Action int32 30 31 const ( 32 Action_UNSPECIFIED Action = 0 33 Action_MINT Action = 1 34 Action_RECEIVE Action = 2 35 Action_BURN Action = 4 36 ) 37 38 var Action_name = map[int32]string{ 39 0: "UNSPECIFIED", 40 1: "MINT", 41 2: "RECEIVE", 42 4: "BURN", 43 } 44 45 var Action_value = map[string]int32{ 46 "UNSPECIFIED": 0, 47 "MINT": 1, 48 "RECEIVE": 2, 49 "BURN": 4, 50 } 51 52 func (x Action) String() string { 53 return proto.EnumName(Action_name, int32(x)) 54 } 55 56 func (Action) EnumDescriptor() ([]byte, []int) { 57 return fileDescriptor_6d25f3ecf3806c6c, []int{0} 58 } 59 60 // Namespace defines a permissions namespace 61 type Namespace struct { 62 Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` 63 WasmHook string `protobuf:"bytes,2,opt,name=wasm_hook,json=wasmHook,proto3" json:"wasm_hook,omitempty"` 64 MintsPaused bool `protobuf:"varint,3,opt,name=mints_paused,json=mintsPaused,proto3" json:"mints_paused,omitempty"` 65 SendsPaused bool `protobuf:"varint,4,opt,name=sends_paused,json=sendsPaused,proto3" json:"sends_paused,omitempty"` 66 BurnsPaused bool `protobuf:"varint,5,opt,name=burns_paused,json=burnsPaused,proto3" json:"burns_paused,omitempty"` 67 RolePermissions []*Role `protobuf:"bytes,6,rep,name=role_permissions,json=rolePermissions,proto3" json:"role_permissions,omitempty"` 68 AddressRoles []*AddressRoles `protobuf:"bytes,7,rep,name=address_roles,json=addressRoles,proto3" json:"address_roles,omitempty"` 69 } 70 71 func (m *Namespace) Reset() { *m = Namespace{} } 72 func (m *Namespace) String() string { return proto.CompactTextString(m) } 73 func (*Namespace) ProtoMessage() {} 74 func (*Namespace) Descriptor() ([]byte, []int) { 75 return fileDescriptor_6d25f3ecf3806c6c, []int{0} 76 } 77 func (m *Namespace) XXX_Unmarshal(b []byte) error { 78 return m.Unmarshal(b) 79 } 80 func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 81 if deterministic { 82 return xxx_messageInfo_Namespace.Marshal(b, m, deterministic) 83 } else { 84 b = b[:cap(b)] 85 n, err := m.MarshalToSizedBuffer(b) 86 if err != nil { 87 return nil, err 88 } 89 return b[:n], nil 90 } 91 } 92 func (m *Namespace) XXX_Merge(src proto.Message) { 93 xxx_messageInfo_Namespace.Merge(m, src) 94 } 95 func (m *Namespace) XXX_Size() int { 96 return m.Size() 97 } 98 func (m *Namespace) XXX_DiscardUnknown() { 99 xxx_messageInfo_Namespace.DiscardUnknown(m) 100 } 101 102 var xxx_messageInfo_Namespace proto.InternalMessageInfo 103 104 func (m *Namespace) GetDenom() string { 105 if m != nil { 106 return m.Denom 107 } 108 return "" 109 } 110 111 func (m *Namespace) GetWasmHook() string { 112 if m != nil { 113 return m.WasmHook 114 } 115 return "" 116 } 117 118 func (m *Namespace) GetMintsPaused() bool { 119 if m != nil { 120 return m.MintsPaused 121 } 122 return false 123 } 124 125 func (m *Namespace) GetSendsPaused() bool { 126 if m != nil { 127 return m.SendsPaused 128 } 129 return false 130 } 131 132 func (m *Namespace) GetBurnsPaused() bool { 133 if m != nil { 134 return m.BurnsPaused 135 } 136 return false 137 } 138 139 func (m *Namespace) GetRolePermissions() []*Role { 140 if m != nil { 141 return m.RolePermissions 142 } 143 return nil 144 } 145 146 func (m *Namespace) GetAddressRoles() []*AddressRoles { 147 if m != nil { 148 return m.AddressRoles 149 } 150 return nil 151 } 152 153 type AddressRoles struct { 154 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 155 Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` 156 } 157 158 func (m *AddressRoles) Reset() { *m = AddressRoles{} } 159 func (m *AddressRoles) String() string { return proto.CompactTextString(m) } 160 func (*AddressRoles) ProtoMessage() {} 161 func (*AddressRoles) Descriptor() ([]byte, []int) { 162 return fileDescriptor_6d25f3ecf3806c6c, []int{1} 163 } 164 func (m *AddressRoles) XXX_Unmarshal(b []byte) error { 165 return m.Unmarshal(b) 166 } 167 func (m *AddressRoles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 168 if deterministic { 169 return xxx_messageInfo_AddressRoles.Marshal(b, m, deterministic) 170 } else { 171 b = b[:cap(b)] 172 n, err := m.MarshalToSizedBuffer(b) 173 if err != nil { 174 return nil, err 175 } 176 return b[:n], nil 177 } 178 } 179 func (m *AddressRoles) XXX_Merge(src proto.Message) { 180 xxx_messageInfo_AddressRoles.Merge(m, src) 181 } 182 func (m *AddressRoles) XXX_Size() int { 183 return m.Size() 184 } 185 func (m *AddressRoles) XXX_DiscardUnknown() { 186 xxx_messageInfo_AddressRoles.DiscardUnknown(m) 187 } 188 189 var xxx_messageInfo_AddressRoles proto.InternalMessageInfo 190 191 func (m *AddressRoles) GetAddress() string { 192 if m != nil { 193 return m.Address 194 } 195 return "" 196 } 197 198 func (m *AddressRoles) GetRoles() []string { 199 if m != nil { 200 return m.Roles 201 } 202 return nil 203 } 204 205 // Role is only used for storage 206 type Role struct { 207 Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` 208 Permissions uint32 `protobuf:"varint,2,opt,name=permissions,proto3" json:"permissions,omitempty"` 209 } 210 211 func (m *Role) Reset() { *m = Role{} } 212 func (m *Role) String() string { return proto.CompactTextString(m) } 213 func (*Role) ProtoMessage() {} 214 func (*Role) Descriptor() ([]byte, []int) { 215 return fileDescriptor_6d25f3ecf3806c6c, []int{2} 216 } 217 func (m *Role) XXX_Unmarshal(b []byte) error { 218 return m.Unmarshal(b) 219 } 220 func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 221 if deterministic { 222 return xxx_messageInfo_Role.Marshal(b, m, deterministic) 223 } else { 224 b = b[:cap(b)] 225 n, err := m.MarshalToSizedBuffer(b) 226 if err != nil { 227 return nil, err 228 } 229 return b[:n], nil 230 } 231 } 232 func (m *Role) XXX_Merge(src proto.Message) { 233 xxx_messageInfo_Role.Merge(m, src) 234 } 235 func (m *Role) XXX_Size() int { 236 return m.Size() 237 } 238 func (m *Role) XXX_DiscardUnknown() { 239 xxx_messageInfo_Role.DiscardUnknown(m) 240 } 241 242 var xxx_messageInfo_Role proto.InternalMessageInfo 243 244 func (m *Role) GetRole() string { 245 if m != nil { 246 return m.Role 247 } 248 return "" 249 } 250 251 func (m *Role) GetPermissions() uint32 { 252 if m != nil { 253 return m.Permissions 254 } 255 return 0 256 } 257 258 // used in storage 259 type RoleIDs struct { 260 RoleIds []uint32 `protobuf:"varint,1,rep,packed,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` 261 } 262 263 func (m *RoleIDs) Reset() { *m = RoleIDs{} } 264 func (m *RoleIDs) String() string { return proto.CompactTextString(m) } 265 func (*RoleIDs) ProtoMessage() {} 266 func (*RoleIDs) Descriptor() ([]byte, []int) { 267 return fileDescriptor_6d25f3ecf3806c6c, []int{3} 268 } 269 func (m *RoleIDs) XXX_Unmarshal(b []byte) error { 270 return m.Unmarshal(b) 271 } 272 func (m *RoleIDs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 273 if deterministic { 274 return xxx_messageInfo_RoleIDs.Marshal(b, m, deterministic) 275 } else { 276 b = b[:cap(b)] 277 n, err := m.MarshalToSizedBuffer(b) 278 if err != nil { 279 return nil, err 280 } 281 return b[:n], nil 282 } 283 } 284 func (m *RoleIDs) XXX_Merge(src proto.Message) { 285 xxx_messageInfo_RoleIDs.Merge(m, src) 286 } 287 func (m *RoleIDs) XXX_Size() int { 288 return m.Size() 289 } 290 func (m *RoleIDs) XXX_DiscardUnknown() { 291 xxx_messageInfo_RoleIDs.DiscardUnknown(m) 292 } 293 294 var xxx_messageInfo_RoleIDs proto.InternalMessageInfo 295 296 func (m *RoleIDs) GetRoleIds() []uint32 { 297 if m != nil { 298 return m.RoleIds 299 } 300 return nil 301 } 302 303 type Voucher struct { 304 Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` 305 } 306 307 func (m *Voucher) Reset() { *m = Voucher{} } 308 func (m *Voucher) String() string { return proto.CompactTextString(m) } 309 func (*Voucher) ProtoMessage() {} 310 func (*Voucher) Descriptor() ([]byte, []int) { 311 return fileDescriptor_6d25f3ecf3806c6c, []int{4} 312 } 313 func (m *Voucher) XXX_Unmarshal(b []byte) error { 314 return m.Unmarshal(b) 315 } 316 func (m *Voucher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 317 if deterministic { 318 return xxx_messageInfo_Voucher.Marshal(b, m, deterministic) 319 } else { 320 b = b[:cap(b)] 321 n, err := m.MarshalToSizedBuffer(b) 322 if err != nil { 323 return nil, err 324 } 325 return b[:n], nil 326 } 327 } 328 func (m *Voucher) XXX_Merge(src proto.Message) { 329 xxx_messageInfo_Voucher.Merge(m, src) 330 } 331 func (m *Voucher) XXX_Size() int { 332 return m.Size() 333 } 334 func (m *Voucher) XXX_DiscardUnknown() { 335 xxx_messageInfo_Voucher.DiscardUnknown(m) 336 } 337 338 var xxx_messageInfo_Voucher proto.InternalMessageInfo 339 340 func (m *Voucher) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { 341 if m != nil { 342 return m.Coins 343 } 344 return nil 345 } 346 347 type AddressVoucher struct { 348 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 349 Voucher *Voucher `protobuf:"bytes,2,opt,name=voucher,proto3" json:"voucher,omitempty"` 350 } 351 352 func (m *AddressVoucher) Reset() { *m = AddressVoucher{} } 353 func (m *AddressVoucher) String() string { return proto.CompactTextString(m) } 354 func (*AddressVoucher) ProtoMessage() {} 355 func (*AddressVoucher) Descriptor() ([]byte, []int) { 356 return fileDescriptor_6d25f3ecf3806c6c, []int{5} 357 } 358 func (m *AddressVoucher) XXX_Unmarshal(b []byte) error { 359 return m.Unmarshal(b) 360 } 361 func (m *AddressVoucher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 362 if deterministic { 363 return xxx_messageInfo_AddressVoucher.Marshal(b, m, deterministic) 364 } else { 365 b = b[:cap(b)] 366 n, err := m.MarshalToSizedBuffer(b) 367 if err != nil { 368 return nil, err 369 } 370 return b[:n], nil 371 } 372 } 373 func (m *AddressVoucher) XXX_Merge(src proto.Message) { 374 xxx_messageInfo_AddressVoucher.Merge(m, src) 375 } 376 func (m *AddressVoucher) XXX_Size() int { 377 return m.Size() 378 } 379 func (m *AddressVoucher) XXX_DiscardUnknown() { 380 xxx_messageInfo_AddressVoucher.DiscardUnknown(m) 381 } 382 383 var xxx_messageInfo_AddressVoucher proto.InternalMessageInfo 384 385 func (m *AddressVoucher) GetAddress() string { 386 if m != nil { 387 return m.Address 388 } 389 return "" 390 } 391 392 func (m *AddressVoucher) GetVoucher() *Voucher { 393 if m != nil { 394 return m.Voucher 395 } 396 return nil 397 } 398 399 func init() { 400 proto.RegisterEnum("injective.permissions.v1beta1.Action", Action_name, Action_value) 401 proto.RegisterType((*Namespace)(nil), "injective.permissions.v1beta1.Namespace") 402 proto.RegisterType((*AddressRoles)(nil), "injective.permissions.v1beta1.AddressRoles") 403 proto.RegisterType((*Role)(nil), "injective.permissions.v1beta1.Role") 404 proto.RegisterType((*RoleIDs)(nil), "injective.permissions.v1beta1.RoleIDs") 405 proto.RegisterType((*Voucher)(nil), "injective.permissions.v1beta1.Voucher") 406 proto.RegisterType((*AddressVoucher)(nil), "injective.permissions.v1beta1.AddressVoucher") 407 } 408 409 func init() { 410 proto.RegisterFile("injective/permissions/v1beta1/permissions.proto", fileDescriptor_6d25f3ecf3806c6c) 411 } 412 413 var fileDescriptor_6d25f3ecf3806c6c = []byte{ 414 // 567 bytes of a gzipped FileDescriptorProto 415 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x4d, 0x8f, 0xd2, 0x4e, 416 0x18, 0xa7, 0xbc, 0x15, 0xa6, 0xf0, 0x5f, 0x32, 0xd9, 0x43, 0x77, 0xff, 0xb1, 0x8b, 0xd5, 0x18, 417 0xa2, 0xd9, 0xd6, 0xc5, 0x9b, 0x31, 0xc6, 0x85, 0xc5, 0xd8, 0x44, 0x09, 0x56, 0x77, 0x0f, 0x5e, 418 0x48, 0x5f, 0x26, 0x30, 0x42, 0x3b, 0xa4, 0x4f, 0xc1, 0xf8, 0x2d, 0xfc, 0x1c, 0x7e, 0x92, 0xf5, 419 0xb6, 0x47, 0x4f, 0x6a, 0xe0, 0x8b, 0x98, 0x99, 0x29, 0x50, 0x0f, 0xba, 0x27, 0xfa, 0xfc, 0x5e, 420 0x9e, 0xe1, 0xf9, 0xcd, 0x33, 0xc8, 0xa6, 0xf1, 0x47, 0x12, 0xa4, 0x74, 0x45, 0xec, 0x05, 0x49, 421 0x22, 0x0a, 0x40, 0x59, 0x0c, 0xf6, 0xea, 0xcc, 0x27, 0xa9, 0x77, 0x96, 0xc7, 0xac, 0x45, 0xc2, 422 0x52, 0x86, 0xef, 0xec, 0x0c, 0x56, 0x9e, 0xcc, 0x0c, 0xc7, 0x87, 0x13, 0x36, 0x61, 0x42, 0x69, 423 0xf3, 0x2f, 0x69, 0x3a, 0x36, 0x02, 0x06, 0x11, 0x03, 0xdb, 0xf7, 0x80, 0xec, 0x7a, 0x07, 0x8c, 424 0xc6, 0x92, 0x37, 0xbf, 0x15, 0x51, 0x7d, 0xe8, 0x45, 0x04, 0x16, 0x5e, 0x40, 0xf0, 0x21, 0xaa, 425 0x84, 0x24, 0x66, 0x91, 0xae, 0xb4, 0x95, 0x4e, 0xdd, 0x95, 0x05, 0xfe, 0x1f, 0xd5, 0x3f, 0x79, 426 0x10, 0x8d, 0xa7, 0x8c, 0xcd, 0xf4, 0xa2, 0x60, 0x6a, 0x1c, 0x78, 0xc5, 0xd8, 0x0c, 0xdf, 0x45, 427 0x8d, 0x88, 0xc6, 0x29, 0x8c, 0x17, 0xde, 0x12, 0x48, 0xa8, 0x97, 0xda, 0x4a, 0xa7, 0xe6, 0x6a, 428 0x02, 0x1b, 0x09, 0x88, 0x4b, 0x80, 0xc4, 0xe1, 0x4e, 0x52, 0x96, 0x12, 0x81, 0xed, 0x25, 0xfe, 429 0x32, 0x89, 0x77, 0x92, 0x8a, 0x94, 0x08, 0x2c, 0x93, 0x0c, 0x51, 0x2b, 0x61, 0x73, 0x32, 0xce, 430 0xcd, 0xae, 0x57, 0xdb, 0xa5, 0x8e, 0xd6, 0xbd, 0x67, 0xfd, 0x33, 0x19, 0xcb, 0x65, 0x73, 0xe2, 431 0x1e, 0x70, 0xf3, 0x68, 0xcf, 0xe2, 0x11, 0x6a, 0x7a, 0x61, 0x98, 0x10, 0x80, 0x31, 0xa7, 0x40, 432 0x57, 0x45, 0xb3, 0x47, 0xb7, 0x34, 0x3b, 0x97, 0x1e, 0xde, 0x13, 0xdc, 0x86, 0x97, 0xab, 0xcc, 433 0xe7, 0xa8, 0x91, 0x67, 0xb1, 0x8e, 0xd4, 0x8c, 0xcf, 0xf2, 0xdc, 0x96, 0x3c, 0x67, 0x79, 0x66, 434 0xb1, 0x5d, 0xe2, 0x39, 0x8b, 0xc2, 0x7c, 0x86, 0xca, 0xdc, 0x88, 0x31, 0x2a, 0x73, 0x20, 0x33, 435 0x89, 0x6f, 0xdc, 0x46, 0x5a, 0x7e, 0x70, 0x7e, 0x0b, 0x4d, 0x37, 0x0f, 0x99, 0xf7, 0x91, 0xca, 436 0xdd, 0xce, 0x05, 0xe0, 0x23, 0x54, 0x13, 0x51, 0xd1, 0x90, 0x9f, 0x5c, 0xea, 0x34, 0x5d, 0x95, 437 0xd7, 0x4e, 0x08, 0xe6, 0x1c, 0xa9, 0x57, 0x6c, 0x19, 0x4c, 0x49, 0x82, 0x3d, 0x54, 0xe1, 0x8b, 438 0x20, 0x25, 0x5a, 0xf7, 0xc8, 0x92, 0xab, 0x62, 0xf1, 0x55, 0xd9, 0x8d, 0xdb, 0x67, 0x34, 0xee, 439 0x3d, 0xbe, 0xfe, 0x71, 0x52, 0xf8, 0xfa, 0xf3, 0xa4, 0x33, 0xa1, 0xe9, 0x74, 0xe9, 0x5b, 0x01, 440 0x8b, 0xec, 0x6c, 0xaf, 0xe4, 0xcf, 0x29, 0x84, 0x33, 0x3b, 0xfd, 0xbc, 0x20, 0x20, 0x0c, 0xe0, 441 0xca, 0xce, 0xe6, 0x1c, 0xfd, 0x97, 0x25, 0xb2, 0x3d, 0xf4, 0xef, 0x99, 0xbc, 0x40, 0xea, 0x4a, 442 0x8a, 0xc4, 0x74, 0x5a, 0xf7, 0xc1, 0x2d, 0x37, 0x91, 0xb5, 0x74, 0xb7, 0xb6, 0x87, 0x4f, 0x51, 443 0xf5, 0x3c, 0x48, 0x29, 0x8b, 0xf1, 0x01, 0xd2, 0x2e, 0x87, 0xef, 0x46, 0x83, 0xbe, 0xf3, 0xd2, 444 0x19, 0x5c, 0xb4, 0x0a, 0xb8, 0x86, 0xca, 0x6f, 0x9c, 0xe1, 0xfb, 0x96, 0x82, 0x35, 0xa4, 0xba, 445 0x83, 0xfe, 0xc0, 0xb9, 0x1a, 0xb4, 0x8a, 0x1c, 0xee, 0x5d, 0xba, 0xc3, 0x56, 0xb9, 0x37, 0xbb, 446 0x5e, 0x1b, 0xca, 0xcd, 0xda, 0x50, 0x7e, 0xad, 0x0d, 0xe5, 0xcb, 0xc6, 0x28, 0xdc, 0x6c, 0x8c, 447 0xc2, 0xf7, 0x8d, 0x51, 0xf8, 0xf0, 0x36, 0x37, 0xb4, 0xb3, 0xfd, 0x43, 0xaf, 0x3d, 0x1f, 0xf6, 448 0x0f, 0xf8, 0x34, 0x60, 0x09, 0xc9, 0x97, 0x53, 0x8f, 0xc6, 0x76, 0xc4, 0xc2, 0xe5, 0x9c, 0xc0, 449 0x1f, 0xaf, 0x5b, 0x64, 0xe4, 0x57, 0xc5, 0xdb, 0x7b, 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xf3, 450 0xf2, 0xce, 0xa8, 0x03, 0x04, 0x00, 0x00, 451 } 452 453 func (m *Namespace) Marshal() (dAtA []byte, err error) { 454 size := m.Size() 455 dAtA = make([]byte, size) 456 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 457 if err != nil { 458 return nil, err 459 } 460 return dAtA[:n], nil 461 } 462 463 func (m *Namespace) MarshalTo(dAtA []byte) (int, error) { 464 size := m.Size() 465 return m.MarshalToSizedBuffer(dAtA[:size]) 466 } 467 468 func (m *Namespace) MarshalToSizedBuffer(dAtA []byte) (int, error) { 469 i := len(dAtA) 470 _ = i 471 var l int 472 _ = l 473 if len(m.AddressRoles) > 0 { 474 for iNdEx := len(m.AddressRoles) - 1; iNdEx >= 0; iNdEx-- { 475 { 476 size, err := m.AddressRoles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 477 if err != nil { 478 return 0, err 479 } 480 i -= size 481 i = encodeVarintPermissions(dAtA, i, uint64(size)) 482 } 483 i-- 484 dAtA[i] = 0x3a 485 } 486 } 487 if len(m.RolePermissions) > 0 { 488 for iNdEx := len(m.RolePermissions) - 1; iNdEx >= 0; iNdEx-- { 489 { 490 size, err := m.RolePermissions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 491 if err != nil { 492 return 0, err 493 } 494 i -= size 495 i = encodeVarintPermissions(dAtA, i, uint64(size)) 496 } 497 i-- 498 dAtA[i] = 0x32 499 } 500 } 501 if m.BurnsPaused { 502 i-- 503 if m.BurnsPaused { 504 dAtA[i] = 1 505 } else { 506 dAtA[i] = 0 507 } 508 i-- 509 dAtA[i] = 0x28 510 } 511 if m.SendsPaused { 512 i-- 513 if m.SendsPaused { 514 dAtA[i] = 1 515 } else { 516 dAtA[i] = 0 517 } 518 i-- 519 dAtA[i] = 0x20 520 } 521 if m.MintsPaused { 522 i-- 523 if m.MintsPaused { 524 dAtA[i] = 1 525 } else { 526 dAtA[i] = 0 527 } 528 i-- 529 dAtA[i] = 0x18 530 } 531 if len(m.WasmHook) > 0 { 532 i -= len(m.WasmHook) 533 copy(dAtA[i:], m.WasmHook) 534 i = encodeVarintPermissions(dAtA, i, uint64(len(m.WasmHook))) 535 i-- 536 dAtA[i] = 0x12 537 } 538 if len(m.Denom) > 0 { 539 i -= len(m.Denom) 540 copy(dAtA[i:], m.Denom) 541 i = encodeVarintPermissions(dAtA, i, uint64(len(m.Denom))) 542 i-- 543 dAtA[i] = 0xa 544 } 545 return len(dAtA) - i, nil 546 } 547 548 func (m *AddressRoles) Marshal() (dAtA []byte, err error) { 549 size := m.Size() 550 dAtA = make([]byte, size) 551 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 552 if err != nil { 553 return nil, err 554 } 555 return dAtA[:n], nil 556 } 557 558 func (m *AddressRoles) MarshalTo(dAtA []byte) (int, error) { 559 size := m.Size() 560 return m.MarshalToSizedBuffer(dAtA[:size]) 561 } 562 563 func (m *AddressRoles) MarshalToSizedBuffer(dAtA []byte) (int, error) { 564 i := len(dAtA) 565 _ = i 566 var l int 567 _ = l 568 if len(m.Roles) > 0 { 569 for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { 570 i -= len(m.Roles[iNdEx]) 571 copy(dAtA[i:], m.Roles[iNdEx]) 572 i = encodeVarintPermissions(dAtA, i, uint64(len(m.Roles[iNdEx]))) 573 i-- 574 dAtA[i] = 0x12 575 } 576 } 577 if len(m.Address) > 0 { 578 i -= len(m.Address) 579 copy(dAtA[i:], m.Address) 580 i = encodeVarintPermissions(dAtA, i, uint64(len(m.Address))) 581 i-- 582 dAtA[i] = 0xa 583 } 584 return len(dAtA) - i, nil 585 } 586 587 func (m *Role) Marshal() (dAtA []byte, err error) { 588 size := m.Size() 589 dAtA = make([]byte, size) 590 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 591 if err != nil { 592 return nil, err 593 } 594 return dAtA[:n], nil 595 } 596 597 func (m *Role) MarshalTo(dAtA []byte) (int, error) { 598 size := m.Size() 599 return m.MarshalToSizedBuffer(dAtA[:size]) 600 } 601 602 func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { 603 i := len(dAtA) 604 _ = i 605 var l int 606 _ = l 607 if m.Permissions != 0 { 608 i = encodeVarintPermissions(dAtA, i, uint64(m.Permissions)) 609 i-- 610 dAtA[i] = 0x10 611 } 612 if len(m.Role) > 0 { 613 i -= len(m.Role) 614 copy(dAtA[i:], m.Role) 615 i = encodeVarintPermissions(dAtA, i, uint64(len(m.Role))) 616 i-- 617 dAtA[i] = 0xa 618 } 619 return len(dAtA) - i, nil 620 } 621 622 func (m *RoleIDs) Marshal() (dAtA []byte, err error) { 623 size := m.Size() 624 dAtA = make([]byte, size) 625 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 626 if err != nil { 627 return nil, err 628 } 629 return dAtA[:n], nil 630 } 631 632 func (m *RoleIDs) MarshalTo(dAtA []byte) (int, error) { 633 size := m.Size() 634 return m.MarshalToSizedBuffer(dAtA[:size]) 635 } 636 637 func (m *RoleIDs) MarshalToSizedBuffer(dAtA []byte) (int, error) { 638 i := len(dAtA) 639 _ = i 640 var l int 641 _ = l 642 if len(m.RoleIds) > 0 { 643 dAtA2 := make([]byte, len(m.RoleIds)*10) 644 var j1 int 645 for _, num := range m.RoleIds { 646 for num >= 1<<7 { 647 dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) 648 num >>= 7 649 j1++ 650 } 651 dAtA2[j1] = uint8(num) 652 j1++ 653 } 654 i -= j1 655 copy(dAtA[i:], dAtA2[:j1]) 656 i = encodeVarintPermissions(dAtA, i, uint64(j1)) 657 i-- 658 dAtA[i] = 0xa 659 } 660 return len(dAtA) - i, nil 661 } 662 663 func (m *Voucher) Marshal() (dAtA []byte, err error) { 664 size := m.Size() 665 dAtA = make([]byte, size) 666 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 667 if err != nil { 668 return nil, err 669 } 670 return dAtA[:n], nil 671 } 672 673 func (m *Voucher) MarshalTo(dAtA []byte) (int, error) { 674 size := m.Size() 675 return m.MarshalToSizedBuffer(dAtA[:size]) 676 } 677 678 func (m *Voucher) MarshalToSizedBuffer(dAtA []byte) (int, error) { 679 i := len(dAtA) 680 _ = i 681 var l int 682 _ = l 683 if len(m.Coins) > 0 { 684 for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { 685 { 686 size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 687 if err != nil { 688 return 0, err 689 } 690 i -= size 691 i = encodeVarintPermissions(dAtA, i, uint64(size)) 692 } 693 i-- 694 dAtA[i] = 0xa 695 } 696 } 697 return len(dAtA) - i, nil 698 } 699 700 func (m *AddressVoucher) Marshal() (dAtA []byte, err error) { 701 size := m.Size() 702 dAtA = make([]byte, size) 703 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 704 if err != nil { 705 return nil, err 706 } 707 return dAtA[:n], nil 708 } 709 710 func (m *AddressVoucher) MarshalTo(dAtA []byte) (int, error) { 711 size := m.Size() 712 return m.MarshalToSizedBuffer(dAtA[:size]) 713 } 714 715 func (m *AddressVoucher) MarshalToSizedBuffer(dAtA []byte) (int, error) { 716 i := len(dAtA) 717 _ = i 718 var l int 719 _ = l 720 if m.Voucher != nil { 721 { 722 size, err := m.Voucher.MarshalToSizedBuffer(dAtA[:i]) 723 if err != nil { 724 return 0, err 725 } 726 i -= size 727 i = encodeVarintPermissions(dAtA, i, uint64(size)) 728 } 729 i-- 730 dAtA[i] = 0x12 731 } 732 if len(m.Address) > 0 { 733 i -= len(m.Address) 734 copy(dAtA[i:], m.Address) 735 i = encodeVarintPermissions(dAtA, i, uint64(len(m.Address))) 736 i-- 737 dAtA[i] = 0xa 738 } 739 return len(dAtA) - i, nil 740 } 741 742 func encodeVarintPermissions(dAtA []byte, offset int, v uint64) int { 743 offset -= sovPermissions(v) 744 base := offset 745 for v >= 1<<7 { 746 dAtA[offset] = uint8(v&0x7f | 0x80) 747 v >>= 7 748 offset++ 749 } 750 dAtA[offset] = uint8(v) 751 return base 752 } 753 func (m *Namespace) Size() (n int) { 754 if m == nil { 755 return 0 756 } 757 var l int 758 _ = l 759 l = len(m.Denom) 760 if l > 0 { 761 n += 1 + l + sovPermissions(uint64(l)) 762 } 763 l = len(m.WasmHook) 764 if l > 0 { 765 n += 1 + l + sovPermissions(uint64(l)) 766 } 767 if m.MintsPaused { 768 n += 2 769 } 770 if m.SendsPaused { 771 n += 2 772 } 773 if m.BurnsPaused { 774 n += 2 775 } 776 if len(m.RolePermissions) > 0 { 777 for _, e := range m.RolePermissions { 778 l = e.Size() 779 n += 1 + l + sovPermissions(uint64(l)) 780 } 781 } 782 if len(m.AddressRoles) > 0 { 783 for _, e := range m.AddressRoles { 784 l = e.Size() 785 n += 1 + l + sovPermissions(uint64(l)) 786 } 787 } 788 return n 789 } 790 791 func (m *AddressRoles) Size() (n int) { 792 if m == nil { 793 return 0 794 } 795 var l int 796 _ = l 797 l = len(m.Address) 798 if l > 0 { 799 n += 1 + l + sovPermissions(uint64(l)) 800 } 801 if len(m.Roles) > 0 { 802 for _, s := range m.Roles { 803 l = len(s) 804 n += 1 + l + sovPermissions(uint64(l)) 805 } 806 } 807 return n 808 } 809 810 func (m *Role) Size() (n int) { 811 if m == nil { 812 return 0 813 } 814 var l int 815 _ = l 816 l = len(m.Role) 817 if l > 0 { 818 n += 1 + l + sovPermissions(uint64(l)) 819 } 820 if m.Permissions != 0 { 821 n += 1 + sovPermissions(uint64(m.Permissions)) 822 } 823 return n 824 } 825 826 func (m *RoleIDs) Size() (n int) { 827 if m == nil { 828 return 0 829 } 830 var l int 831 _ = l 832 if len(m.RoleIds) > 0 { 833 l = 0 834 for _, e := range m.RoleIds { 835 l += sovPermissions(uint64(e)) 836 } 837 n += 1 + sovPermissions(uint64(l)) + l 838 } 839 return n 840 } 841 842 func (m *Voucher) Size() (n int) { 843 if m == nil { 844 return 0 845 } 846 var l int 847 _ = l 848 if len(m.Coins) > 0 { 849 for _, e := range m.Coins { 850 l = e.Size() 851 n += 1 + l + sovPermissions(uint64(l)) 852 } 853 } 854 return n 855 } 856 857 func (m *AddressVoucher) Size() (n int) { 858 if m == nil { 859 return 0 860 } 861 var l int 862 _ = l 863 l = len(m.Address) 864 if l > 0 { 865 n += 1 + l + sovPermissions(uint64(l)) 866 } 867 if m.Voucher != nil { 868 l = m.Voucher.Size() 869 n += 1 + l + sovPermissions(uint64(l)) 870 } 871 return n 872 } 873 874 func sovPermissions(x uint64) (n int) { 875 return (math_bits.Len64(x|1) + 6) / 7 876 } 877 func sozPermissions(x uint64) (n int) { 878 return sovPermissions(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 879 } 880 func (m *Namespace) Unmarshal(dAtA []byte) error { 881 l := len(dAtA) 882 iNdEx := 0 883 for iNdEx < l { 884 preIndex := iNdEx 885 var wire uint64 886 for shift := uint(0); ; shift += 7 { 887 if shift >= 64 { 888 return ErrIntOverflowPermissions 889 } 890 if iNdEx >= l { 891 return io.ErrUnexpectedEOF 892 } 893 b := dAtA[iNdEx] 894 iNdEx++ 895 wire |= uint64(b&0x7F) << shift 896 if b < 0x80 { 897 break 898 } 899 } 900 fieldNum := int32(wire >> 3) 901 wireType := int(wire & 0x7) 902 if wireType == 4 { 903 return fmt.Errorf("proto: Namespace: wiretype end group for non-group") 904 } 905 if fieldNum <= 0 { 906 return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) 907 } 908 switch fieldNum { 909 case 1: 910 if wireType != 2 { 911 return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) 912 } 913 var stringLen uint64 914 for shift := uint(0); ; shift += 7 { 915 if shift >= 64 { 916 return ErrIntOverflowPermissions 917 } 918 if iNdEx >= l { 919 return io.ErrUnexpectedEOF 920 } 921 b := dAtA[iNdEx] 922 iNdEx++ 923 stringLen |= uint64(b&0x7F) << shift 924 if b < 0x80 { 925 break 926 } 927 } 928 intStringLen := int(stringLen) 929 if intStringLen < 0 { 930 return ErrInvalidLengthPermissions 931 } 932 postIndex := iNdEx + intStringLen 933 if postIndex < 0 { 934 return ErrInvalidLengthPermissions 935 } 936 if postIndex > l { 937 return io.ErrUnexpectedEOF 938 } 939 m.Denom = string(dAtA[iNdEx:postIndex]) 940 iNdEx = postIndex 941 case 2: 942 if wireType != 2 { 943 return fmt.Errorf("proto: wrong wireType = %d for field WasmHook", wireType) 944 } 945 var stringLen uint64 946 for shift := uint(0); ; shift += 7 { 947 if shift >= 64 { 948 return ErrIntOverflowPermissions 949 } 950 if iNdEx >= l { 951 return io.ErrUnexpectedEOF 952 } 953 b := dAtA[iNdEx] 954 iNdEx++ 955 stringLen |= uint64(b&0x7F) << shift 956 if b < 0x80 { 957 break 958 } 959 } 960 intStringLen := int(stringLen) 961 if intStringLen < 0 { 962 return ErrInvalidLengthPermissions 963 } 964 postIndex := iNdEx + intStringLen 965 if postIndex < 0 { 966 return ErrInvalidLengthPermissions 967 } 968 if postIndex > l { 969 return io.ErrUnexpectedEOF 970 } 971 m.WasmHook = string(dAtA[iNdEx:postIndex]) 972 iNdEx = postIndex 973 case 3: 974 if wireType != 0 { 975 return fmt.Errorf("proto: wrong wireType = %d for field MintsPaused", wireType) 976 } 977 var v int 978 for shift := uint(0); ; shift += 7 { 979 if shift >= 64 { 980 return ErrIntOverflowPermissions 981 } 982 if iNdEx >= l { 983 return io.ErrUnexpectedEOF 984 } 985 b := dAtA[iNdEx] 986 iNdEx++ 987 v |= int(b&0x7F) << shift 988 if b < 0x80 { 989 break 990 } 991 } 992 m.MintsPaused = bool(v != 0) 993 case 4: 994 if wireType != 0 { 995 return fmt.Errorf("proto: wrong wireType = %d for field SendsPaused", wireType) 996 } 997 var v int 998 for shift := uint(0); ; shift += 7 { 999 if shift >= 64 { 1000 return ErrIntOverflowPermissions 1001 } 1002 if iNdEx >= l { 1003 return io.ErrUnexpectedEOF 1004 } 1005 b := dAtA[iNdEx] 1006 iNdEx++ 1007 v |= int(b&0x7F) << shift 1008 if b < 0x80 { 1009 break 1010 } 1011 } 1012 m.SendsPaused = bool(v != 0) 1013 case 5: 1014 if wireType != 0 { 1015 return fmt.Errorf("proto: wrong wireType = %d for field BurnsPaused", wireType) 1016 } 1017 var v int 1018 for shift := uint(0); ; shift += 7 { 1019 if shift >= 64 { 1020 return ErrIntOverflowPermissions 1021 } 1022 if iNdEx >= l { 1023 return io.ErrUnexpectedEOF 1024 } 1025 b := dAtA[iNdEx] 1026 iNdEx++ 1027 v |= int(b&0x7F) << shift 1028 if b < 0x80 { 1029 break 1030 } 1031 } 1032 m.BurnsPaused = bool(v != 0) 1033 case 6: 1034 if wireType != 2 { 1035 return fmt.Errorf("proto: wrong wireType = %d for field RolePermissions", wireType) 1036 } 1037 var msglen int 1038 for shift := uint(0); ; shift += 7 { 1039 if shift >= 64 { 1040 return ErrIntOverflowPermissions 1041 } 1042 if iNdEx >= l { 1043 return io.ErrUnexpectedEOF 1044 } 1045 b := dAtA[iNdEx] 1046 iNdEx++ 1047 msglen |= int(b&0x7F) << shift 1048 if b < 0x80 { 1049 break 1050 } 1051 } 1052 if msglen < 0 { 1053 return ErrInvalidLengthPermissions 1054 } 1055 postIndex := iNdEx + msglen 1056 if postIndex < 0 { 1057 return ErrInvalidLengthPermissions 1058 } 1059 if postIndex > l { 1060 return io.ErrUnexpectedEOF 1061 } 1062 m.RolePermissions = append(m.RolePermissions, &Role{}) 1063 if err := m.RolePermissions[len(m.RolePermissions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1064 return err 1065 } 1066 iNdEx = postIndex 1067 case 7: 1068 if wireType != 2 { 1069 return fmt.Errorf("proto: wrong wireType = %d for field AddressRoles", wireType) 1070 } 1071 var msglen int 1072 for shift := uint(0); ; shift += 7 { 1073 if shift >= 64 { 1074 return ErrIntOverflowPermissions 1075 } 1076 if iNdEx >= l { 1077 return io.ErrUnexpectedEOF 1078 } 1079 b := dAtA[iNdEx] 1080 iNdEx++ 1081 msglen |= int(b&0x7F) << shift 1082 if b < 0x80 { 1083 break 1084 } 1085 } 1086 if msglen < 0 { 1087 return ErrInvalidLengthPermissions 1088 } 1089 postIndex := iNdEx + msglen 1090 if postIndex < 0 { 1091 return ErrInvalidLengthPermissions 1092 } 1093 if postIndex > l { 1094 return io.ErrUnexpectedEOF 1095 } 1096 m.AddressRoles = append(m.AddressRoles, &AddressRoles{}) 1097 if err := m.AddressRoles[len(m.AddressRoles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1098 return err 1099 } 1100 iNdEx = postIndex 1101 default: 1102 iNdEx = preIndex 1103 skippy, err := skipPermissions(dAtA[iNdEx:]) 1104 if err != nil { 1105 return err 1106 } 1107 if (skippy < 0) || (iNdEx+skippy) < 0 { 1108 return ErrInvalidLengthPermissions 1109 } 1110 if (iNdEx + skippy) > l { 1111 return io.ErrUnexpectedEOF 1112 } 1113 iNdEx += skippy 1114 } 1115 } 1116 1117 if iNdEx > l { 1118 return io.ErrUnexpectedEOF 1119 } 1120 return nil 1121 } 1122 func (m *AddressRoles) Unmarshal(dAtA []byte) error { 1123 l := len(dAtA) 1124 iNdEx := 0 1125 for iNdEx < l { 1126 preIndex := iNdEx 1127 var wire uint64 1128 for shift := uint(0); ; shift += 7 { 1129 if shift >= 64 { 1130 return ErrIntOverflowPermissions 1131 } 1132 if iNdEx >= l { 1133 return io.ErrUnexpectedEOF 1134 } 1135 b := dAtA[iNdEx] 1136 iNdEx++ 1137 wire |= uint64(b&0x7F) << shift 1138 if b < 0x80 { 1139 break 1140 } 1141 } 1142 fieldNum := int32(wire >> 3) 1143 wireType := int(wire & 0x7) 1144 if wireType == 4 { 1145 return fmt.Errorf("proto: AddressRoles: wiretype end group for non-group") 1146 } 1147 if fieldNum <= 0 { 1148 return fmt.Errorf("proto: AddressRoles: illegal tag %d (wire type %d)", fieldNum, wire) 1149 } 1150 switch fieldNum { 1151 case 1: 1152 if wireType != 2 { 1153 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 1154 } 1155 var stringLen uint64 1156 for shift := uint(0); ; shift += 7 { 1157 if shift >= 64 { 1158 return ErrIntOverflowPermissions 1159 } 1160 if iNdEx >= l { 1161 return io.ErrUnexpectedEOF 1162 } 1163 b := dAtA[iNdEx] 1164 iNdEx++ 1165 stringLen |= uint64(b&0x7F) << shift 1166 if b < 0x80 { 1167 break 1168 } 1169 } 1170 intStringLen := int(stringLen) 1171 if intStringLen < 0 { 1172 return ErrInvalidLengthPermissions 1173 } 1174 postIndex := iNdEx + intStringLen 1175 if postIndex < 0 { 1176 return ErrInvalidLengthPermissions 1177 } 1178 if postIndex > l { 1179 return io.ErrUnexpectedEOF 1180 } 1181 m.Address = string(dAtA[iNdEx:postIndex]) 1182 iNdEx = postIndex 1183 case 2: 1184 if wireType != 2 { 1185 return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) 1186 } 1187 var stringLen uint64 1188 for shift := uint(0); ; shift += 7 { 1189 if shift >= 64 { 1190 return ErrIntOverflowPermissions 1191 } 1192 if iNdEx >= l { 1193 return io.ErrUnexpectedEOF 1194 } 1195 b := dAtA[iNdEx] 1196 iNdEx++ 1197 stringLen |= uint64(b&0x7F) << shift 1198 if b < 0x80 { 1199 break 1200 } 1201 } 1202 intStringLen := int(stringLen) 1203 if intStringLen < 0 { 1204 return ErrInvalidLengthPermissions 1205 } 1206 postIndex := iNdEx + intStringLen 1207 if postIndex < 0 { 1208 return ErrInvalidLengthPermissions 1209 } 1210 if postIndex > l { 1211 return io.ErrUnexpectedEOF 1212 } 1213 m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) 1214 iNdEx = postIndex 1215 default: 1216 iNdEx = preIndex 1217 skippy, err := skipPermissions(dAtA[iNdEx:]) 1218 if err != nil { 1219 return err 1220 } 1221 if (skippy < 0) || (iNdEx+skippy) < 0 { 1222 return ErrInvalidLengthPermissions 1223 } 1224 if (iNdEx + skippy) > l { 1225 return io.ErrUnexpectedEOF 1226 } 1227 iNdEx += skippy 1228 } 1229 } 1230 1231 if iNdEx > l { 1232 return io.ErrUnexpectedEOF 1233 } 1234 return nil 1235 } 1236 func (m *Role) Unmarshal(dAtA []byte) error { 1237 l := len(dAtA) 1238 iNdEx := 0 1239 for iNdEx < l { 1240 preIndex := iNdEx 1241 var wire uint64 1242 for shift := uint(0); ; shift += 7 { 1243 if shift >= 64 { 1244 return ErrIntOverflowPermissions 1245 } 1246 if iNdEx >= l { 1247 return io.ErrUnexpectedEOF 1248 } 1249 b := dAtA[iNdEx] 1250 iNdEx++ 1251 wire |= uint64(b&0x7F) << shift 1252 if b < 0x80 { 1253 break 1254 } 1255 } 1256 fieldNum := int32(wire >> 3) 1257 wireType := int(wire & 0x7) 1258 if wireType == 4 { 1259 return fmt.Errorf("proto: Role: wiretype end group for non-group") 1260 } 1261 if fieldNum <= 0 { 1262 return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) 1263 } 1264 switch fieldNum { 1265 case 1: 1266 if wireType != 2 { 1267 return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) 1268 } 1269 var stringLen uint64 1270 for shift := uint(0); ; shift += 7 { 1271 if shift >= 64 { 1272 return ErrIntOverflowPermissions 1273 } 1274 if iNdEx >= l { 1275 return io.ErrUnexpectedEOF 1276 } 1277 b := dAtA[iNdEx] 1278 iNdEx++ 1279 stringLen |= uint64(b&0x7F) << shift 1280 if b < 0x80 { 1281 break 1282 } 1283 } 1284 intStringLen := int(stringLen) 1285 if intStringLen < 0 { 1286 return ErrInvalidLengthPermissions 1287 } 1288 postIndex := iNdEx + intStringLen 1289 if postIndex < 0 { 1290 return ErrInvalidLengthPermissions 1291 } 1292 if postIndex > l { 1293 return io.ErrUnexpectedEOF 1294 } 1295 m.Role = string(dAtA[iNdEx:postIndex]) 1296 iNdEx = postIndex 1297 case 2: 1298 if wireType != 0 { 1299 return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) 1300 } 1301 m.Permissions = 0 1302 for shift := uint(0); ; shift += 7 { 1303 if shift >= 64 { 1304 return ErrIntOverflowPermissions 1305 } 1306 if iNdEx >= l { 1307 return io.ErrUnexpectedEOF 1308 } 1309 b := dAtA[iNdEx] 1310 iNdEx++ 1311 m.Permissions |= uint32(b&0x7F) << shift 1312 if b < 0x80 { 1313 break 1314 } 1315 } 1316 default: 1317 iNdEx = preIndex 1318 skippy, err := skipPermissions(dAtA[iNdEx:]) 1319 if err != nil { 1320 return err 1321 } 1322 if (skippy < 0) || (iNdEx+skippy) < 0 { 1323 return ErrInvalidLengthPermissions 1324 } 1325 if (iNdEx + skippy) > l { 1326 return io.ErrUnexpectedEOF 1327 } 1328 iNdEx += skippy 1329 } 1330 } 1331 1332 if iNdEx > l { 1333 return io.ErrUnexpectedEOF 1334 } 1335 return nil 1336 } 1337 func (m *RoleIDs) Unmarshal(dAtA []byte) error { 1338 l := len(dAtA) 1339 iNdEx := 0 1340 for iNdEx < l { 1341 preIndex := iNdEx 1342 var wire uint64 1343 for shift := uint(0); ; shift += 7 { 1344 if shift >= 64 { 1345 return ErrIntOverflowPermissions 1346 } 1347 if iNdEx >= l { 1348 return io.ErrUnexpectedEOF 1349 } 1350 b := dAtA[iNdEx] 1351 iNdEx++ 1352 wire |= uint64(b&0x7F) << shift 1353 if b < 0x80 { 1354 break 1355 } 1356 } 1357 fieldNum := int32(wire >> 3) 1358 wireType := int(wire & 0x7) 1359 if wireType == 4 { 1360 return fmt.Errorf("proto: RoleIDs: wiretype end group for non-group") 1361 } 1362 if fieldNum <= 0 { 1363 return fmt.Errorf("proto: RoleIDs: illegal tag %d (wire type %d)", fieldNum, wire) 1364 } 1365 switch fieldNum { 1366 case 1: 1367 if wireType == 0 { 1368 var v uint32 1369 for shift := uint(0); ; shift += 7 { 1370 if shift >= 64 { 1371 return ErrIntOverflowPermissions 1372 } 1373 if iNdEx >= l { 1374 return io.ErrUnexpectedEOF 1375 } 1376 b := dAtA[iNdEx] 1377 iNdEx++ 1378 v |= uint32(b&0x7F) << shift 1379 if b < 0x80 { 1380 break 1381 } 1382 } 1383 m.RoleIds = append(m.RoleIds, v) 1384 } else if wireType == 2 { 1385 var packedLen int 1386 for shift := uint(0); ; shift += 7 { 1387 if shift >= 64 { 1388 return ErrIntOverflowPermissions 1389 } 1390 if iNdEx >= l { 1391 return io.ErrUnexpectedEOF 1392 } 1393 b := dAtA[iNdEx] 1394 iNdEx++ 1395 packedLen |= int(b&0x7F) << shift 1396 if b < 0x80 { 1397 break 1398 } 1399 } 1400 if packedLen < 0 { 1401 return ErrInvalidLengthPermissions 1402 } 1403 postIndex := iNdEx + packedLen 1404 if postIndex < 0 { 1405 return ErrInvalidLengthPermissions 1406 } 1407 if postIndex > l { 1408 return io.ErrUnexpectedEOF 1409 } 1410 var elementCount int 1411 var count int 1412 for _, integer := range dAtA[iNdEx:postIndex] { 1413 if integer < 128 { 1414 count++ 1415 } 1416 } 1417 elementCount = count 1418 if elementCount != 0 && len(m.RoleIds) == 0 { 1419 m.RoleIds = make([]uint32, 0, elementCount) 1420 } 1421 for iNdEx < postIndex { 1422 var v uint32 1423 for shift := uint(0); ; shift += 7 { 1424 if shift >= 64 { 1425 return ErrIntOverflowPermissions 1426 } 1427 if iNdEx >= l { 1428 return io.ErrUnexpectedEOF 1429 } 1430 b := dAtA[iNdEx] 1431 iNdEx++ 1432 v |= uint32(b&0x7F) << shift 1433 if b < 0x80 { 1434 break 1435 } 1436 } 1437 m.RoleIds = append(m.RoleIds, v) 1438 } 1439 } else { 1440 return fmt.Errorf("proto: wrong wireType = %d for field RoleIds", wireType) 1441 } 1442 default: 1443 iNdEx = preIndex 1444 skippy, err := skipPermissions(dAtA[iNdEx:]) 1445 if err != nil { 1446 return err 1447 } 1448 if (skippy < 0) || (iNdEx+skippy) < 0 { 1449 return ErrInvalidLengthPermissions 1450 } 1451 if (iNdEx + skippy) > l { 1452 return io.ErrUnexpectedEOF 1453 } 1454 iNdEx += skippy 1455 } 1456 } 1457 1458 if iNdEx > l { 1459 return io.ErrUnexpectedEOF 1460 } 1461 return nil 1462 } 1463 func (m *Voucher) Unmarshal(dAtA []byte) error { 1464 l := len(dAtA) 1465 iNdEx := 0 1466 for iNdEx < l { 1467 preIndex := iNdEx 1468 var wire uint64 1469 for shift := uint(0); ; shift += 7 { 1470 if shift >= 64 { 1471 return ErrIntOverflowPermissions 1472 } 1473 if iNdEx >= l { 1474 return io.ErrUnexpectedEOF 1475 } 1476 b := dAtA[iNdEx] 1477 iNdEx++ 1478 wire |= uint64(b&0x7F) << shift 1479 if b < 0x80 { 1480 break 1481 } 1482 } 1483 fieldNum := int32(wire >> 3) 1484 wireType := int(wire & 0x7) 1485 if wireType == 4 { 1486 return fmt.Errorf("proto: Voucher: wiretype end group for non-group") 1487 } 1488 if fieldNum <= 0 { 1489 return fmt.Errorf("proto: Voucher: illegal tag %d (wire type %d)", fieldNum, wire) 1490 } 1491 switch fieldNum { 1492 case 1: 1493 if wireType != 2 { 1494 return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) 1495 } 1496 var msglen int 1497 for shift := uint(0); ; shift += 7 { 1498 if shift >= 64 { 1499 return ErrIntOverflowPermissions 1500 } 1501 if iNdEx >= l { 1502 return io.ErrUnexpectedEOF 1503 } 1504 b := dAtA[iNdEx] 1505 iNdEx++ 1506 msglen |= int(b&0x7F) << shift 1507 if b < 0x80 { 1508 break 1509 } 1510 } 1511 if msglen < 0 { 1512 return ErrInvalidLengthPermissions 1513 } 1514 postIndex := iNdEx + msglen 1515 if postIndex < 0 { 1516 return ErrInvalidLengthPermissions 1517 } 1518 if postIndex > l { 1519 return io.ErrUnexpectedEOF 1520 } 1521 m.Coins = append(m.Coins, types.Coin{}) 1522 if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1523 return err 1524 } 1525 iNdEx = postIndex 1526 default: 1527 iNdEx = preIndex 1528 skippy, err := skipPermissions(dAtA[iNdEx:]) 1529 if err != nil { 1530 return err 1531 } 1532 if (skippy < 0) || (iNdEx+skippy) < 0 { 1533 return ErrInvalidLengthPermissions 1534 } 1535 if (iNdEx + skippy) > l { 1536 return io.ErrUnexpectedEOF 1537 } 1538 iNdEx += skippy 1539 } 1540 } 1541 1542 if iNdEx > l { 1543 return io.ErrUnexpectedEOF 1544 } 1545 return nil 1546 } 1547 func (m *AddressVoucher) Unmarshal(dAtA []byte) error { 1548 l := len(dAtA) 1549 iNdEx := 0 1550 for iNdEx < l { 1551 preIndex := iNdEx 1552 var wire uint64 1553 for shift := uint(0); ; shift += 7 { 1554 if shift >= 64 { 1555 return ErrIntOverflowPermissions 1556 } 1557 if iNdEx >= l { 1558 return io.ErrUnexpectedEOF 1559 } 1560 b := dAtA[iNdEx] 1561 iNdEx++ 1562 wire |= uint64(b&0x7F) << shift 1563 if b < 0x80 { 1564 break 1565 } 1566 } 1567 fieldNum := int32(wire >> 3) 1568 wireType := int(wire & 0x7) 1569 if wireType == 4 { 1570 return fmt.Errorf("proto: AddressVoucher: wiretype end group for non-group") 1571 } 1572 if fieldNum <= 0 { 1573 return fmt.Errorf("proto: AddressVoucher: illegal tag %d (wire type %d)", fieldNum, wire) 1574 } 1575 switch fieldNum { 1576 case 1: 1577 if wireType != 2 { 1578 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 1579 } 1580 var stringLen uint64 1581 for shift := uint(0); ; shift += 7 { 1582 if shift >= 64 { 1583 return ErrIntOverflowPermissions 1584 } 1585 if iNdEx >= l { 1586 return io.ErrUnexpectedEOF 1587 } 1588 b := dAtA[iNdEx] 1589 iNdEx++ 1590 stringLen |= uint64(b&0x7F) << shift 1591 if b < 0x80 { 1592 break 1593 } 1594 } 1595 intStringLen := int(stringLen) 1596 if intStringLen < 0 { 1597 return ErrInvalidLengthPermissions 1598 } 1599 postIndex := iNdEx + intStringLen 1600 if postIndex < 0 { 1601 return ErrInvalidLengthPermissions 1602 } 1603 if postIndex > l { 1604 return io.ErrUnexpectedEOF 1605 } 1606 m.Address = string(dAtA[iNdEx:postIndex]) 1607 iNdEx = postIndex 1608 case 2: 1609 if wireType != 2 { 1610 return fmt.Errorf("proto: wrong wireType = %d for field Voucher", wireType) 1611 } 1612 var msglen int 1613 for shift := uint(0); ; shift += 7 { 1614 if shift >= 64 { 1615 return ErrIntOverflowPermissions 1616 } 1617 if iNdEx >= l { 1618 return io.ErrUnexpectedEOF 1619 } 1620 b := dAtA[iNdEx] 1621 iNdEx++ 1622 msglen |= int(b&0x7F) << shift 1623 if b < 0x80 { 1624 break 1625 } 1626 } 1627 if msglen < 0 { 1628 return ErrInvalidLengthPermissions 1629 } 1630 postIndex := iNdEx + msglen 1631 if postIndex < 0 { 1632 return ErrInvalidLengthPermissions 1633 } 1634 if postIndex > l { 1635 return io.ErrUnexpectedEOF 1636 } 1637 if m.Voucher == nil { 1638 m.Voucher = &Voucher{} 1639 } 1640 if err := m.Voucher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1641 return err 1642 } 1643 iNdEx = postIndex 1644 default: 1645 iNdEx = preIndex 1646 skippy, err := skipPermissions(dAtA[iNdEx:]) 1647 if err != nil { 1648 return err 1649 } 1650 if (skippy < 0) || (iNdEx+skippy) < 0 { 1651 return ErrInvalidLengthPermissions 1652 } 1653 if (iNdEx + skippy) > l { 1654 return io.ErrUnexpectedEOF 1655 } 1656 iNdEx += skippy 1657 } 1658 } 1659 1660 if iNdEx > l { 1661 return io.ErrUnexpectedEOF 1662 } 1663 return nil 1664 } 1665 func skipPermissions(dAtA []byte) (n int, err error) { 1666 l := len(dAtA) 1667 iNdEx := 0 1668 depth := 0 1669 for iNdEx < l { 1670 var wire uint64 1671 for shift := uint(0); ; shift += 7 { 1672 if shift >= 64 { 1673 return 0, ErrIntOverflowPermissions 1674 } 1675 if iNdEx >= l { 1676 return 0, io.ErrUnexpectedEOF 1677 } 1678 b := dAtA[iNdEx] 1679 iNdEx++ 1680 wire |= (uint64(b) & 0x7F) << shift 1681 if b < 0x80 { 1682 break 1683 } 1684 } 1685 wireType := int(wire & 0x7) 1686 switch wireType { 1687 case 0: 1688 for shift := uint(0); ; shift += 7 { 1689 if shift >= 64 { 1690 return 0, ErrIntOverflowPermissions 1691 } 1692 if iNdEx >= l { 1693 return 0, io.ErrUnexpectedEOF 1694 } 1695 iNdEx++ 1696 if dAtA[iNdEx-1] < 0x80 { 1697 break 1698 } 1699 } 1700 case 1: 1701 iNdEx += 8 1702 case 2: 1703 var length int 1704 for shift := uint(0); ; shift += 7 { 1705 if shift >= 64 { 1706 return 0, ErrIntOverflowPermissions 1707 } 1708 if iNdEx >= l { 1709 return 0, io.ErrUnexpectedEOF 1710 } 1711 b := dAtA[iNdEx] 1712 iNdEx++ 1713 length |= (int(b) & 0x7F) << shift 1714 if b < 0x80 { 1715 break 1716 } 1717 } 1718 if length < 0 { 1719 return 0, ErrInvalidLengthPermissions 1720 } 1721 iNdEx += length 1722 case 3: 1723 depth++ 1724 case 4: 1725 if depth == 0 { 1726 return 0, ErrUnexpectedEndOfGroupPermissions 1727 } 1728 depth-- 1729 case 5: 1730 iNdEx += 4 1731 default: 1732 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1733 } 1734 if iNdEx < 0 { 1735 return 0, ErrInvalidLengthPermissions 1736 } 1737 if depth == 0 { 1738 return iNdEx, nil 1739 } 1740 } 1741 return 0, io.ErrUnexpectedEOF 1742 } 1743 1744 var ( 1745 ErrInvalidLengthPermissions = fmt.Errorf("proto: negative length found during unmarshaling") 1746 ErrIntOverflowPermissions = fmt.Errorf("proto: integer overflow") 1747 ErrUnexpectedEndOfGroupPermissions = fmt.Errorf("proto: unexpected end of group") 1748 )