From a5dacd7e92a545599ad0ce927436b411e21af277 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 8 Jun 2022 22:07:10 +0530 Subject: [PATCH 01/19] feat: add account by id cli and grpc api --- api/cosmos/auth/v1beta1/query.pulsar.go | 1172 ++++++++++++++++++++-- api/cosmos/auth/v1beta1/query_grpc.pb.go | 38 + proto/cosmos/auth/v1beta1/query.proto | 16 + x/auth/client/cli/query.go | 42 + x/auth/keeper/account.go | 18 + x/auth/keeper/grpc_query.go | 23 + x/auth/types/keys.go | 9 + x/auth/types/query.pb.go | 482 ++++++++- x/auth/types/query.pb.gw.go | 101 ++ 9 files changed, 1743 insertions(+), 158 deletions(-) diff --git a/api/cosmos/auth/v1beta1/query.pulsar.go b/api/cosmos/auth/v1beta1/query.pulsar.go index aeb2a9f8164e..9b15717bbc86 100644 --- a/api/cosmos/auth/v1beta1/query.pulsar.go +++ b/api/cosmos/auth/v1beta1/query.pulsar.go @@ -5981,6 +5981,845 @@ func (x *fastReflection_AddressStringToBytesResponse) ProtoMethods() *protoiface } } +var ( + md_QueryAccountByIdRequest protoreflect.MessageDescriptor + fd_QueryAccountByIdRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_query_proto_init() + md_QueryAccountByIdRequest = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountByIdRequest") + fd_QueryAccountByIdRequest_id = md_QueryAccountByIdRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryAccountByIdRequest)(nil) + +type fastReflection_QueryAccountByIdRequest QueryAccountByIdRequest + +func (x *QueryAccountByIdRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountByIdRequest)(x) +} + +func (x *QueryAccountByIdRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAccountByIdRequest_messageType fastReflection_QueryAccountByIdRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountByIdRequest_messageType{} + +type fastReflection_QueryAccountByIdRequest_messageType struct{} + +func (x fastReflection_QueryAccountByIdRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountByIdRequest)(nil) +} +func (x fastReflection_QueryAccountByIdRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountByIdRequest) +} +func (x fastReflection_QueryAccountByIdRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountByIdRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAccountByIdRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountByIdRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAccountByIdRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountByIdRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAccountByIdRequest) New() protoreflect.Message { + return new(fastReflection_QueryAccountByIdRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAccountByIdRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAccountByIdRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAccountByIdRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_QueryAccountByIdRequest_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAccountByIdRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + return x.Id != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + x.Id = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAccountByIdRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + x.Id = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + panic(fmt.Errorf("field id of message cosmos.auth.v1beta1.QueryAccountByIdRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAccountByIdRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAccountByIdRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountByIdRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAccountByIdRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAccountByIdRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAccountByIdRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountByIdRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountByIdRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAccountByIdResponse protoreflect.MessageDescriptor + fd_QueryAccountByIdResponse_account protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_query_proto_init() + md_QueryAccountByIdResponse = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountByIdResponse") + fd_QueryAccountByIdResponse_account = md_QueryAccountByIdResponse.Fields().ByName("account") +} + +var _ protoreflect.Message = (*fastReflection_QueryAccountByIdResponse)(nil) + +type fastReflection_QueryAccountByIdResponse QueryAccountByIdResponse + +func (x *QueryAccountByIdResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountByIdResponse)(x) +} + +func (x *QueryAccountByIdResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAccountByIdResponse_messageType fastReflection_QueryAccountByIdResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountByIdResponse_messageType{} + +type fastReflection_QueryAccountByIdResponse_messageType struct{} + +func (x fastReflection_QueryAccountByIdResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountByIdResponse)(nil) +} +func (x fastReflection_QueryAccountByIdResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountByIdResponse) +} +func (x fastReflection_QueryAccountByIdResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountByIdResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAccountByIdResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountByIdResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAccountByIdResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountByIdResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAccountByIdResponse) New() protoreflect.Message { + return new(fastReflection_QueryAccountByIdResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAccountByIdResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAccountByIdResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAccountByIdResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Account != nil { + value := protoreflect.ValueOfMessage(x.Account.ProtoReflect()) + if !f(fd_QueryAccountByIdResponse_account, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAccountByIdResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + return x.Account != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + x.Account = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAccountByIdResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + value := x.Account + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + x.Account = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + if x.Account == nil { + x.Account = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Account.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAccountByIdResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAccountByIdResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountByIdResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAccountByIdResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAccountByIdResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAccountByIdResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAccountByIdResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Account != nil { + l = options.Size(x.Account) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountByIdResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Account != nil { + encoded, err := options.Marshal(x.Account) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAccountByIdResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Account == nil { + x.Account = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Account); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -6505,6 +7344,79 @@ func (x *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } +// QueryAccountByIdRequest is the request type for AccountById rpc method +type QueryAccountByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryAccountByIdRequest) Reset() { + *x = QueryAccountByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAccountByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAccountByIdRequest) ProtoMessage() {} + +// Deprecated: Use QueryAccountByIdRequest.ProtoReflect.Descriptor instead. +func (*QueryAccountByIdRequest) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryAccountByIdRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +// QueryAccountByIdResponse is the response type for AccountById rpc method +type QueryAccountByIdResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // account defines the account of the corresponding address. + Account *anypb.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (x *QueryAccountByIdResponse) Reset() { + *x = QueryAccountByIdResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAccountByIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAccountByIdResponse) ProtoMessage() {} + +// Deprecated: Use QueryAccountByIdResponse.ProtoReflect.Descriptor instead. +func (*QueryAccountByIdResponse) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryAccountByIdResponse) GetAccount() *anypb.Any { + if x != nil { + return x.Account + } + return nil +} + var File_cosmos_auth_v1beta1_query_proto protoreflect.FileDescriptor var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ @@ -6586,88 +7498,107 @@ var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, - 0xbd, 0x08, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x88, 0x01, 0x0a, 0x08, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x0c, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, + 0x29, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, + 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x18, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x0c, 0xca, + 0xb4, 0x2d, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x52, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xdb, 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x88, + 0x01, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, - 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, + 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0b, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x2c, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, + 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, + 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x62, + 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x88, 0x01, - 0x0a, 0x0c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x28, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, - 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, + 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, + 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, + 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, + 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x42, - 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, - 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, + 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, + 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x7d, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, + 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, + 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -6682,7 +7613,7 @@ func file_cosmos_auth_v1beta1_query_proto_rawDescGZIP() []byte { return file_cosmos_auth_v1beta1_query_proto_rawDescData } -var file_cosmos_auth_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_cosmos_auth_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_cosmos_auth_v1beta1_query_proto_goTypes = []interface{}{ (*QueryAccountsRequest)(nil), // 0: cosmos.auth.v1beta1.QueryAccountsRequest (*QueryAccountsResponse)(nil), // 1: cosmos.auth.v1beta1.QueryAccountsResponse @@ -6698,37 +7629,42 @@ var file_cosmos_auth_v1beta1_query_proto_goTypes = []interface{}{ (*AddressBytesToStringResponse)(nil), // 11: cosmos.auth.v1beta1.AddressBytesToStringResponse (*AddressStringToBytesRequest)(nil), // 12: cosmos.auth.v1beta1.AddressStringToBytesRequest (*AddressStringToBytesResponse)(nil), // 13: cosmos.auth.v1beta1.AddressStringToBytesResponse - (*v1beta1.PageRequest)(nil), // 14: cosmos.base.query.v1beta1.PageRequest - (*anypb.Any)(nil), // 15: google.protobuf.Any - (*v1beta1.PageResponse)(nil), // 16: cosmos.base.query.v1beta1.PageResponse - (*Params)(nil), // 17: cosmos.auth.v1beta1.Params + (*QueryAccountByIdRequest)(nil), // 14: cosmos.auth.v1beta1.QueryAccountByIdRequest + (*QueryAccountByIdResponse)(nil), // 15: cosmos.auth.v1beta1.QueryAccountByIdResponse + (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest + (*anypb.Any)(nil), // 17: google.protobuf.Any + (*v1beta1.PageResponse)(nil), // 18: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 19: cosmos.auth.v1beta1.Params } var file_cosmos_auth_v1beta1_query_proto_depIdxs = []int32{ - 14, // 0: cosmos.auth.v1beta1.QueryAccountsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 15, // 1: cosmos.auth.v1beta1.QueryAccountsResponse.accounts:type_name -> google.protobuf.Any - 16, // 2: cosmos.auth.v1beta1.QueryAccountsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 17, // 3: cosmos.auth.v1beta1.QueryParamsResponse.params:type_name -> cosmos.auth.v1beta1.Params - 15, // 4: cosmos.auth.v1beta1.QueryAccountResponse.account:type_name -> google.protobuf.Any - 15, // 5: cosmos.auth.v1beta1.QueryModuleAccountsResponse.accounts:type_name -> google.protobuf.Any - 0, // 6: cosmos.auth.v1beta1.Query.Accounts:input_type -> cosmos.auth.v1beta1.QueryAccountsRequest - 2, // 7: cosmos.auth.v1beta1.Query.Account:input_type -> cosmos.auth.v1beta1.QueryAccountRequest - 6, // 8: cosmos.auth.v1beta1.Query.Params:input_type -> cosmos.auth.v1beta1.QueryParamsRequest - 3, // 9: cosmos.auth.v1beta1.Query.ModuleAccounts:input_type -> cosmos.auth.v1beta1.QueryModuleAccountsRequest - 8, // 10: cosmos.auth.v1beta1.Query.Bech32Prefix:input_type -> cosmos.auth.v1beta1.Bech32PrefixRequest - 10, // 11: cosmos.auth.v1beta1.Query.AddressBytesToString:input_type -> cosmos.auth.v1beta1.AddressBytesToStringRequest - 12, // 12: cosmos.auth.v1beta1.Query.AddressStringToBytes:input_type -> cosmos.auth.v1beta1.AddressStringToBytesRequest - 1, // 13: cosmos.auth.v1beta1.Query.Accounts:output_type -> cosmos.auth.v1beta1.QueryAccountsResponse - 5, // 14: cosmos.auth.v1beta1.Query.Account:output_type -> cosmos.auth.v1beta1.QueryAccountResponse - 4, // 15: cosmos.auth.v1beta1.Query.Params:output_type -> cosmos.auth.v1beta1.QueryParamsResponse - 7, // 16: cosmos.auth.v1beta1.Query.ModuleAccounts:output_type -> cosmos.auth.v1beta1.QueryModuleAccountsResponse - 9, // 17: cosmos.auth.v1beta1.Query.Bech32Prefix:output_type -> cosmos.auth.v1beta1.Bech32PrefixResponse - 11, // 18: cosmos.auth.v1beta1.Query.AddressBytesToString:output_type -> cosmos.auth.v1beta1.AddressBytesToStringResponse - 13, // 19: cosmos.auth.v1beta1.Query.AddressStringToBytes:output_type -> cosmos.auth.v1beta1.AddressStringToBytesResponse - 13, // [13:20] is the sub-list for method output_type - 6, // [6:13] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 16, // 0: cosmos.auth.v1beta1.QueryAccountsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 17, // 1: cosmos.auth.v1beta1.QueryAccountsResponse.accounts:type_name -> google.protobuf.Any + 18, // 2: cosmos.auth.v1beta1.QueryAccountsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 19, // 3: cosmos.auth.v1beta1.QueryParamsResponse.params:type_name -> cosmos.auth.v1beta1.Params + 17, // 4: cosmos.auth.v1beta1.QueryAccountResponse.account:type_name -> google.protobuf.Any + 17, // 5: cosmos.auth.v1beta1.QueryModuleAccountsResponse.accounts:type_name -> google.protobuf.Any + 17, // 6: cosmos.auth.v1beta1.QueryAccountByIdResponse.account:type_name -> google.protobuf.Any + 0, // 7: cosmos.auth.v1beta1.Query.Accounts:input_type -> cosmos.auth.v1beta1.QueryAccountsRequest + 2, // 8: cosmos.auth.v1beta1.Query.Account:input_type -> cosmos.auth.v1beta1.QueryAccountRequest + 14, // 9: cosmos.auth.v1beta1.Query.AccountById:input_type -> cosmos.auth.v1beta1.QueryAccountByIdRequest + 6, // 10: cosmos.auth.v1beta1.Query.Params:input_type -> cosmos.auth.v1beta1.QueryParamsRequest + 3, // 11: cosmos.auth.v1beta1.Query.ModuleAccounts:input_type -> cosmos.auth.v1beta1.QueryModuleAccountsRequest + 8, // 12: cosmos.auth.v1beta1.Query.Bech32Prefix:input_type -> cosmos.auth.v1beta1.Bech32PrefixRequest + 10, // 13: cosmos.auth.v1beta1.Query.AddressBytesToString:input_type -> cosmos.auth.v1beta1.AddressBytesToStringRequest + 12, // 14: cosmos.auth.v1beta1.Query.AddressStringToBytes:input_type -> cosmos.auth.v1beta1.AddressStringToBytesRequest + 1, // 15: cosmos.auth.v1beta1.Query.Accounts:output_type -> cosmos.auth.v1beta1.QueryAccountsResponse + 5, // 16: cosmos.auth.v1beta1.Query.Account:output_type -> cosmos.auth.v1beta1.QueryAccountResponse + 15, // 17: cosmos.auth.v1beta1.Query.AccountById:output_type -> cosmos.auth.v1beta1.QueryAccountByIdResponse + 4, // 18: cosmos.auth.v1beta1.Query.Params:output_type -> cosmos.auth.v1beta1.QueryParamsResponse + 7, // 19: cosmos.auth.v1beta1.Query.ModuleAccounts:output_type -> cosmos.auth.v1beta1.QueryModuleAccountsResponse + 9, // 20: cosmos.auth.v1beta1.Query.Bech32Prefix:output_type -> cosmos.auth.v1beta1.Bech32PrefixResponse + 11, // 21: cosmos.auth.v1beta1.Query.AddressBytesToString:output_type -> cosmos.auth.v1beta1.AddressBytesToStringResponse + 13, // 22: cosmos.auth.v1beta1.Query.AddressStringToBytes:output_type -> cosmos.auth.v1beta1.AddressStringToBytesResponse + 15, // [15:23] is the sub-list for method output_type + 7, // [7:15] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_cosmos_auth_v1beta1_query_proto_init() } @@ -6906,6 +7842,30 @@ func file_cosmos_auth_v1beta1_query_proto_init() { return nil } } + file_cosmos_auth_v1beta1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAccountByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_v1beta1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAccountByIdResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -6913,7 +7873,7 @@ func file_cosmos_auth_v1beta1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_auth_v1beta1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/auth/v1beta1/query_grpc.pb.go b/api/cosmos/auth/v1beta1/query_grpc.pb.go index f016a932e9f4..3a24ec57f3dd 100644 --- a/api/cosmos/auth/v1beta1/query_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/query_grpc.pb.go @@ -28,6 +28,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) + // AccountById returns account details based on account id + AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -74,6 +76,15 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } +func (c *queryClient) AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) { + out := new(QueryAccountByIdResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Params", in, out, opts...) @@ -129,6 +140,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) + // AccountById returns account details based on account id + AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -160,6 +173,9 @@ func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } +func (UnimplementedQueryServer) AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountById not implemented") +} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } @@ -224,6 +240,24 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_AccountById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AccountById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountById(ctx, req.(*QueryAccountByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryParamsRequest) if err := dec(in); err != nil { @@ -329,6 +363,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Account", Handler: _Query_Account_Handler, }, + { + MethodName: "AccountById", + Handler: _Query_AccountById_Handler, + }, { MethodName: "Params", Handler: _Query_Params_Handler, diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index 894429bdaaf0..b4a77b787e92 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -24,6 +24,11 @@ service Query { option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; } + // AccountById returns account details based on account id + rpc AccountById(QueryAccountByIdRequest) returns (QueryAccountByIdResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/account_by_id/{id}"; + } + // Params queries all parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/params"; @@ -152,3 +157,14 @@ message AddressStringToBytesRequest { message AddressStringToBytesResponse { bytes address_bytes = 1; } + +// QueryAccountByIdRequest is the request type for AccountById rpc method +message QueryAccountByIdRequest{ + uint64 id = 1; +} + +// QueryAccountByIdResponse is the response type for AccountById rpc method +message QueryAccountByIdResponse { + // account defines the account of the corresponding address. + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; +} \ No newline at end of file diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 41fd652dc86b..5b87a56f2f37 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -3,6 +3,7 @@ package cli import ( "context" "fmt" + "strconv" "strings" "github.com/spf13/cobra" @@ -41,6 +42,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetAccountCmd(), + GetAccountByIdCmd(), GetAccountsCmd(), QueryParamsCmd(), QueryModuleAccountsCmd(), @@ -124,6 +126,46 @@ func GetAccountCmd() *cobra.Command { return cmd } +// GetAccountByIdCmd returns a query account that will display the state of the +// account at a given account id. +func GetAccountByIdCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "account-by-id [id]", + Short: "Query for account by account id", + Args: cobra.ExactArgs(1), + Example: fmt.Sprintf( + "%s q auth account-by-id 1", version.AppName, + ), + Long: strings.TrimSpace(`Query the account by id: + +$ query auth account-by-id [id] +`), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + id, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.AccountById(cmd.Context(), &types.QueryAccountByIdRequest{Id: uint64(id)}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res.Account) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // GetAccountsCmd returns a query command that will display a list of accounts func GetAccountsCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index 7474e93a5469..2c771a5c88c4 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -31,6 +31,12 @@ func (ak AccountKeeper) HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool { return store.Has(types.AddressStoreKey(addr)) } +// HasAccountById checks account exsits by id +func (ak AccountKeeper) HasAccountById(ctx sdk.Context, id uint64) bool { + store := ctx.KVStore(ak.key) + return store.Has(types.AccountNumberStoreKey(id)) +} + // GetAccount implements AccountKeeperI. func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI { store := ctx.KVStore(ak.key) @@ -42,6 +48,17 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A return ak.decodeAccount(bz) } +// GetAccount implements AccountKeeperI. +func (ak AccountKeeper) GetAccountById(ctx sdk.Context, id uint64) types.AccountI { + store := ctx.KVStore(ak.key) + bz := store.Get(types.AccountNumberStoreKey(id)) + if bz == nil { + return nil + } + + return ak.decodeAccount(bz) +} + // GetAllAccounts returns all accounts in the accountKeeper. func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.AccountI) { ak.IterateAccounts(ctx, func(acc types.AccountI) (stop bool) { @@ -63,6 +80,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { } store.Set(types.AddressStoreKey(addr), bz) + store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), bz) } // RemoveAccount removes an account for the account mapper store. diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 8bd3a40e0aec..39cfd8edd4be 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -19,6 +19,29 @@ import ( var _ types.QueryServer = AccountKeeper{} +func (ak AccountKeeper) AccountById(c context.Context, req *types.QueryAccountByIdRequest) (*types.QueryAccountByIdResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + if req.Id < 0 { + return nil, status.Error(codes.InvalidArgument, "Account Id cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + account := ak.GetAccountById(ctx, req.GetId()) + if account == nil { + return nil, status.Errorf(codes.NotFound, "account is not found with id %d", req.Id) + } + + any, err := codectypes.NewAnyWithValue(account) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + return &types.QueryAccountByIdResponse{Account: any}, nil +} + func (ak AccountKeeper) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") diff --git a/x/auth/types/keys.go b/x/auth/types/keys.go index 4cb2538f252c..0149460cd837 100644 --- a/x/auth/types/keys.go +++ b/x/auth/types/keys.go @@ -1,6 +1,8 @@ package types import ( + "strconv" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -24,9 +26,16 @@ var ( // param key for global account number GlobalAccountNumberKey = []byte("globalAccountNumber") + + // AccountNumberStoreKeyPrefix prefix for account-by-id store + AccountNumberStoreKeyPrefix = []byte("accountNumber") ) // AddressStoreKey turn an address to key used to get it from the account store func AddressStoreKey(addr sdk.AccAddress) []byte { return append(AddressStoreKeyPrefix, addr.Bytes()...) } + +func AccountNumberStoreKey(accountNumber uint64) []byte { + return append(AccountNumberStoreKeyPrefix, []byte(strconv.Itoa(int(accountNumber)))...) +} diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 6903dfc8ecac..94ae9e6ee535 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -665,6 +665,97 @@ func (m *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } +// QueryAccountByIdRequest is the request type for AccountById rpc method +type QueryAccountByIdRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryAccountByIdRequest) Reset() { *m = QueryAccountByIdRequest{} } +func (m *QueryAccountByIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountByIdRequest) ProtoMessage() {} +func (*QueryAccountByIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{14} +} +func (m *QueryAccountByIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountByIdRequest.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 *QueryAccountByIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountByIdRequest.Merge(m, src) +} +func (m *QueryAccountByIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountByIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountByIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountByIdRequest proto.InternalMessageInfo + +func (m *QueryAccountByIdRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +// QueryAccountByIdResponse is the response type for AccountById rpc method +type QueryAccountByIdResponse struct { + // account defines the account of the corresponding address. + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (m *QueryAccountByIdResponse) Reset() { *m = QueryAccountByIdResponse{} } +func (m *QueryAccountByIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountByIdResponse) ProtoMessage() {} +func (*QueryAccountByIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{15} +} +func (m *QueryAccountByIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountByIdResponse.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 *QueryAccountByIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountByIdResponse.Merge(m, src) +} +func (m *QueryAccountByIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountByIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountByIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountByIdResponse proto.InternalMessageInfo + +func (m *QueryAccountByIdResponse) GetAccount() *types.Any { + if m != nil { + return m.Account + } + return nil +} + func init() { proto.RegisterType((*QueryAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryAccountsRequest") proto.RegisterType((*QueryAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryAccountsResponse") @@ -680,63 +771,69 @@ func init() { proto.RegisterType((*AddressBytesToStringResponse)(nil), "cosmos.auth.v1beta1.AddressBytesToStringResponse") proto.RegisterType((*AddressStringToBytesRequest)(nil), "cosmos.auth.v1beta1.AddressStringToBytesRequest") proto.RegisterType((*AddressStringToBytesResponse)(nil), "cosmos.auth.v1beta1.AddressStringToBytesResponse") + proto.RegisterType((*QueryAccountByIdRequest)(nil), "cosmos.auth.v1beta1.QueryAccountByIdRequest") + proto.RegisterType((*QueryAccountByIdResponse)(nil), "cosmos.auth.v1beta1.QueryAccountByIdResponse") } func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } var fileDescriptor_c451370b3929a27c = []byte{ - // 814 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xcf, 0x4f, 0x13, 0x4d, - 0x18, 0xc7, 0xbb, 0xbc, 0xef, 0x0b, 0x7d, 0x87, 0xc2, 0x61, 0x28, 0x09, 0xef, 0x16, 0x5a, 0xb2, - 0xbc, 0x40, 0x8b, 0x74, 0x57, 0x8a, 0x17, 0x7f, 0xc4, 0x84, 0x82, 0x1a, 0x0f, 0x26, 0xb5, 0x70, - 0xf2, 0x60, 0x33, 0xdb, 0x0e, 0x4b, 0x23, 0xdd, 0x29, 0x9d, 0xad, 0xa1, 0x31, 0x24, 0xc6, 0x13, - 0x37, 0x4d, 0xfc, 0x07, 0xf0, 0x3f, 0xd0, 0x84, 0xab, 0x77, 0xc2, 0x89, 0xe8, 0xc5, 0x93, 0x31, - 0xe0, 0xc1, 0x3f, 0xc3, 0x74, 0xe6, 0xd9, 0xb6, 0x4b, 0xa6, 0xed, 0x7a, 0xa2, 0x3b, 0xf3, 0x7c, - 0xbf, 0xcf, 0x67, 0x9e, 0x67, 0x9e, 0x01, 0xa5, 0xca, 0x8c, 0xd7, 0x18, 0xb7, 0x48, 0xd3, 0xdb, - 0xb3, 0x5e, 0xae, 0xd9, 0xd4, 0x23, 0x6b, 0xd6, 0x41, 0x93, 0x36, 0x5a, 0x66, 0xbd, 0xc1, 0x3c, - 0x86, 0xa7, 0x64, 0x80, 0xd9, 0x0e, 0x30, 0x21, 0x40, 0x5f, 0x01, 0x95, 0x4d, 0x38, 0x95, 0xd1, - 0x1d, 0x6d, 0x9d, 0x38, 0x55, 0x97, 0x78, 0x55, 0xe6, 0x4a, 0x03, 0x3d, 0xee, 0x30, 0x87, 0x89, - 0x9f, 0x56, 0xfb, 0x17, 0xac, 0xfe, 0xe7, 0x30, 0xe6, 0xec, 0x53, 0x4b, 0x7c, 0xd9, 0xcd, 0x5d, - 0x8b, 0xb8, 0x90, 0x51, 0x9f, 0x85, 0x2d, 0x52, 0xaf, 0x5a, 0xc4, 0x75, 0x99, 0x27, 0xdc, 0x38, - 0xec, 0x26, 0x55, 0xc0, 0x02, 0x0e, 0x8c, 0xe5, 0x7e, 0x49, 0x66, 0x04, 0x78, 0xf1, 0x61, 0x3c, - 0x47, 0xf1, 0xa7, 0x6d, 0xd6, 0x8d, 0x72, 0x99, 0x35, 0x5d, 0x8f, 0x17, 0xe9, 0x41, 0x93, 0x72, - 0x0f, 0x3f, 0x44, 0xa8, 0x4b, 0x3d, 0xa3, 0xcd, 0x6b, 0xe9, 0xf1, 0xdc, 0x92, 0x09, 0xd2, 0xf6, - 0x11, 0x4d, 0x59, 0x10, 0xc8, 0x66, 0x16, 0x88, 0x43, 0x41, 0x5b, 0xec, 0x51, 0x1a, 0x27, 0x1a, - 0x9a, 0xbe, 0x96, 0x80, 0xd7, 0x99, 0xcb, 0x29, 0xbe, 0x8f, 0xa2, 0x04, 0xd6, 0x66, 0xb4, 0xf9, - 0xbf, 0xd2, 0xe3, 0xb9, 0xb8, 0x29, 0x4f, 0x69, 0xfa, 0x05, 0x30, 0x37, 0xdc, 0x56, 0x3e, 0x76, - 0x7e, 0x9a, 0x8d, 0x82, 0xfa, 0x71, 0xb1, 0xa3, 0xc1, 0x8f, 0x02, 0x84, 0x23, 0x82, 0x70, 0x79, - 0x28, 0xa1, 0x4c, 0x1e, 0x40, 0xdc, 0x46, 0x53, 0xbd, 0x84, 0x7e, 0x05, 0x72, 0x68, 0x8c, 0x54, - 0x2a, 0x0d, 0xca, 0xb9, 0x38, 0xfe, 0xbf, 0xf9, 0x99, 0x2f, 0xa7, 0xd9, 0x38, 0xf8, 0x6f, 0xc8, - 0x9d, 0x6d, 0xaf, 0x51, 0x75, 0x9d, 0xa2, 0x1f, 0x78, 0x27, 0x7a, 0x7c, 0x92, 0x8a, 0xfc, 0x3a, - 0x49, 0x45, 0x8c, 0x59, 0xa4, 0x0b, 0xd3, 0x27, 0xac, 0xd2, 0xdc, 0xa7, 0xd7, 0xaa, 0x6b, 0x14, - 0x20, 0x65, 0x81, 0x34, 0x48, 0xad, 0x5b, 0x92, 0xdb, 0x68, 0xb4, 0x2e, 0x56, 0xa0, 0xe0, 0x09, - 0x53, 0x71, 0xd1, 0x4c, 0x29, 0xca, 0xff, 0x7d, 0xf6, 0x3d, 0x15, 0x29, 0x82, 0xc0, 0xd8, 0x09, - 0xf6, 0xb1, 0x63, 0x79, 0x0f, 0x8d, 0x41, 0xc5, 0xc0, 0x33, 0x4c, 0x91, 0x7d, 0x89, 0x11, 0x47, - 0x38, 0xc0, 0x29, 0xe9, 0xcb, 0x28, 0xa1, 0x3c, 0x1b, 0xa4, 0xdc, 0x0a, 0xd9, 0x58, 0x7c, 0x7e, - 0x9a, 0x9d, 0x0c, 0x78, 0xf4, 0xb4, 0xd7, 0x98, 0x46, 0x53, 0x79, 0x5a, 0xde, 0x5b, 0xcf, 0x15, - 0x1a, 0x74, 0xb7, 0x7a, 0xe8, 0xe7, 0xbe, 0x8b, 0xe2, 0xc1, 0x65, 0x48, 0xba, 0x80, 0x26, 0x6c, - 0xb1, 0x5e, 0xaa, 0x8b, 0x0d, 0xd9, 0xb3, 0x62, 0xcc, 0xee, 0x09, 0x36, 0xf2, 0x28, 0x01, 0x8d, - 0xcb, 0xb7, 0x3c, 0xca, 0x77, 0x18, 0xf4, 0x0f, 0x3a, 0xbe, 0x80, 0x26, 0xa0, 0x91, 0x25, 0xbb, - 0xbd, 0x2f, 0x3c, 0x62, 0xc5, 0x18, 0xe9, 0xd1, 0x18, 0x0f, 0xd0, 0xac, 0xda, 0x03, 0x40, 0x16, - 0xd1, 0xa4, 0x6f, 0xc2, 0xc5, 0x0e, 0x90, 0xf8, 0xd6, 0x32, 0xdc, 0xd8, 0xea, 0xa0, 0xc8, 0x85, - 0x1d, 0x26, 0xec, 0x7c, 0x94, 0x90, 0x2e, 0x9b, 0x1d, 0x98, 0x6b, 0x2e, 0xdd, 0xaa, 0x0c, 0x3d, - 0x51, 0xee, 0x73, 0x14, 0xfd, 0x23, 0xfa, 0x89, 0x8f, 0x35, 0xe4, 0x5f, 0x02, 0x8e, 0x33, 0xca, - 0xcb, 0xa7, 0x7a, 0x2c, 0xf4, 0x95, 0x30, 0xa1, 0x12, 0xc9, 0x58, 0x7c, 0xf3, 0xf5, 0xe7, 0xfb, - 0x91, 0x14, 0x9e, 0xb3, 0x94, 0x8f, 0x96, 0x9f, 0xfd, 0xad, 0x86, 0xc6, 0x40, 0x8b, 0xd3, 0x43, - 0xed, 0x7d, 0x90, 0x4c, 0x88, 0x48, 0xe0, 0xb0, 0x04, 0x47, 0x06, 0x2f, 0x0f, 0xe4, 0xb0, 0x5e, - 0x41, 0xa9, 0x8e, 0xf0, 0x6b, 0x0d, 0x8d, 0xca, 0x39, 0xc0, 0xcb, 0xfd, 0xd3, 0x04, 0x26, 0x45, - 0x4f, 0x0f, 0x0f, 0x04, 0x9c, 0x05, 0x81, 0x33, 0x87, 0x13, 0x4a, 0x1c, 0x39, 0xe4, 0xf8, 0x83, - 0x86, 0x82, 0x03, 0xc3, 0xb1, 0xd5, 0x3f, 0x83, 0xf2, 0xe9, 0xd1, 0x6f, 0x86, 0x17, 0x00, 0xda, - 0xaa, 0x40, 0x5b, 0xc2, 0xff, 0x2b, 0xd1, 0x6a, 0x42, 0x54, 0xea, 0x34, 0xee, 0x58, 0x43, 0xb1, - 0xde, 0x09, 0xed, 0xd3, 0x3d, 0xc5, 0x6c, 0xf7, 0xe9, 0x9e, 0x6a, 0xdc, 0x87, 0x94, 0x4b, 0x0e, - 0x3d, 0xfe, 0xa8, 0xa1, 0xb8, 0x6a, 0x56, 0xb1, 0xba, 0x06, 0x03, 0x9e, 0x06, 0x7d, 0xed, 0x0f, - 0x14, 0x80, 0xb8, 0x2e, 0x10, 0xb3, 0xf8, 0xc6, 0x00, 0xc4, 0xce, 0xf5, 0x92, 0xe3, 0x79, 0x84, - 0x3f, 0x75, 0x91, 0x03, 0x13, 0x3d, 0x18, 0x59, 0xf5, 0x84, 0x0c, 0x46, 0x56, 0x3e, 0x17, 0xc6, - 0x2d, 0x81, 0x6c, 0xe2, 0xd5, 0x50, 0xc8, 0xf2, 0x61, 0x3a, 0xca, 0x6f, 0x9e, 0x5d, 0x26, 0xb5, - 0x8b, 0xcb, 0xa4, 0xf6, 0xe3, 0x32, 0xa9, 0xbd, 0xbb, 0x4a, 0x46, 0x2e, 0xae, 0x92, 0x91, 0x6f, - 0x57, 0xc9, 0xc8, 0xb3, 0x8c, 0x53, 0xf5, 0xf6, 0x9a, 0xb6, 0x59, 0x66, 0x35, 0xdf, 0x51, 0xfe, - 0xc9, 0xf2, 0xca, 0x0b, 0xeb, 0x50, 0xda, 0x7b, 0xad, 0x3a, 0xe5, 0xf6, 0xa8, 0xf8, 0xd7, 0xb0, - 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x15, 0x47, 0x58, 0x91, 0x7c, 0x09, 0x00, 0x00, + // 873 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x4f, 0x3b, 0x55, + 0x14, 0xc6, 0x3b, 0x15, 0x79, 0xb9, 0x14, 0x16, 0x97, 0x12, 0xeb, 0x14, 0x5a, 0x32, 0x08, 0xb4, + 0x48, 0x67, 0xa4, 0xb8, 0xf1, 0x25, 0x26, 0x0c, 0xa8, 0x61, 0x61, 0x52, 0x07, 0x16, 0xc6, 0x85, + 0xcd, 0x4c, 0x67, 0x18, 0x26, 0xd2, 0xb9, 0xa5, 0x77, 0x6a, 0x68, 0x48, 0x13, 0xe3, 0x8a, 0x9d, + 0x26, 0x2e, 0xdd, 0xe0, 0x37, 0xd0, 0x84, 0x0f, 0x41, 0x58, 0x11, 0xdd, 0x98, 0x98, 0x18, 0x03, + 0x2e, 0xfc, 0x18, 0xa6, 0xf7, 0x9e, 0x69, 0x67, 0xf0, 0xb6, 0x1d, 0x92, 0xff, 0x8a, 0xce, 0x3d, + 0xe7, 0x3c, 0xe7, 0x77, 0xcf, 0xb9, 0x3c, 0xa8, 0xd8, 0x20, 0xb4, 0x49, 0xa8, 0x66, 0x76, 0x82, + 0x33, 0xed, 0x9b, 0x5d, 0xcb, 0x09, 0xcc, 0x5d, 0xed, 0xa2, 0xe3, 0xb4, 0xbb, 0x6a, 0xab, 0x4d, + 0x02, 0x82, 0x97, 0x78, 0x82, 0xda, 0x4f, 0x50, 0x21, 0x41, 0xde, 0x86, 0x2a, 0xcb, 0xa4, 0x0e, + 0xcf, 0x1e, 0xd4, 0xb6, 0x4c, 0xd7, 0xf3, 0xcd, 0xc0, 0x23, 0x3e, 0x17, 0x90, 0xb3, 0x2e, 0x71, + 0x09, 0xfb, 0xa9, 0xf5, 0x7f, 0xc1, 0xe9, 0x9b, 0x2e, 0x21, 0xee, 0xb9, 0xa3, 0xb1, 0x2f, 0xab, + 0x73, 0xaa, 0x99, 0x3e, 0x74, 0x94, 0x57, 0x20, 0x64, 0xb6, 0x3c, 0xcd, 0xf4, 0x7d, 0x12, 0x30, + 0x35, 0x0a, 0xd1, 0x82, 0x08, 0x98, 0xc1, 0x81, 0x30, 0x8f, 0xd7, 0x79, 0x47, 0x80, 0x67, 0x1f, + 0xca, 0x57, 0x28, 0xfb, 0x79, 0x9f, 0x75, 0xbf, 0xd1, 0x20, 0x1d, 0x3f, 0xa0, 0x86, 0x73, 0xd1, + 0x71, 0x68, 0x80, 0x3f, 0x41, 0x68, 0x48, 0x9d, 0x93, 0xd6, 0xa4, 0xd2, 0x7c, 0x75, 0x53, 0x85, + 0xd2, 0xfe, 0x15, 0x55, 0x3e, 0x10, 0xe8, 0xa6, 0xd6, 0x4c, 0xd7, 0x81, 0x5a, 0x23, 0x52, 0xa9, + 0xdc, 0x48, 0x68, 0xf9, 0x59, 0x03, 0xda, 0x22, 0x3e, 0x75, 0xf0, 0x47, 0x68, 0xd6, 0x84, 0xb3, + 0x9c, 0xb4, 0xf6, 0x5a, 0x69, 0xbe, 0x9a, 0x55, 0xf9, 0x2d, 0xd5, 0x70, 0x00, 0xea, 0xbe, 0xdf, + 0xd5, 0x33, 0xf7, 0xb7, 0x95, 0x59, 0xa8, 0x3e, 0x32, 0x06, 0x35, 0xf8, 0xd3, 0x18, 0x61, 0x9a, + 0x11, 0x6e, 0x4d, 0x24, 0xe4, 0xcd, 0x63, 0x88, 0xc7, 0x68, 0x29, 0x4a, 0x18, 0x4e, 0xa0, 0x8a, + 0x66, 0x4c, 0xdb, 0x6e, 0x3b, 0x94, 0xb2, 0xeb, 0xcf, 0xe9, 0xb9, 0xdf, 0x6e, 0x2b, 0x59, 0xd0, + 0xdf, 0xe7, 0x91, 0xe3, 0xa0, 0xed, 0xf9, 0xae, 0x11, 0x26, 0xbe, 0x3f, 0x7b, 0x7d, 0x53, 0x4c, + 0xfd, 0x7b, 0x53, 0x4c, 0x29, 0x2b, 0x48, 0x66, 0xa2, 0x9f, 0x11, 0xbb, 0x73, 0xee, 0x3c, 0x9b, + 0xae, 0x52, 0x83, 0x96, 0x35, 0xb3, 0x6d, 0x36, 0x87, 0x23, 0x79, 0x0f, 0x4d, 0xb7, 0xd8, 0x09, + 0x0c, 0x3c, 0xaf, 0x0a, 0x1e, 0x9a, 0xca, 0x8b, 0xf4, 0xa9, 0xbb, 0xbf, 0x8a, 0x29, 0x03, 0x0a, + 0x94, 0x93, 0xf8, 0x1e, 0x07, 0x92, 0x1f, 0xa2, 0x19, 0x98, 0x18, 0x68, 0x26, 0x19, 0x72, 0x58, + 0xa2, 0x64, 0x11, 0x8e, 0x71, 0x72, 0xfa, 0x06, 0xca, 0x0b, 0xef, 0x06, 0x2d, 0x0f, 0x13, 0x2e, + 0x16, 0xdf, 0xdf, 0x56, 0x16, 0x63, 0x1a, 0x91, 0xf5, 0x2a, 0xcb, 0x68, 0x49, 0x77, 0x1a, 0x67, + 0x7b, 0xd5, 0x5a, 0xdb, 0x39, 0xf5, 0x2e, 0xc3, 0xde, 0x1f, 0xa0, 0x6c, 0xfc, 0x18, 0x9a, 0xae, + 0xa3, 0x05, 0x8b, 0x9d, 0xd7, 0x5b, 0x2c, 0xc0, 0x77, 0x66, 0x64, 0xac, 0x48, 0xb2, 0xa2, 0xa3, + 0x3c, 0x2c, 0x4e, 0xef, 0x06, 0x0e, 0x3d, 0x21, 0xb0, 0x3f, 0xd8, 0xf8, 0x3a, 0x5a, 0x80, 0x45, + 0xd6, 0xad, 0x7e, 0x9c, 0x69, 0x64, 0x8c, 0x8c, 0x19, 0xa9, 0x51, 0x3e, 0x46, 0x2b, 0x62, 0x0d, + 0x00, 0xd9, 0x40, 0x8b, 0xa1, 0x08, 0x65, 0x11, 0x20, 0x09, 0xa5, 0x79, 0xba, 0x72, 0x38, 0x40, + 0xe1, 0x07, 0x27, 0x84, 0xc9, 0x85, 0x28, 0x09, 0x55, 0x0e, 0x06, 0x30, 0xcf, 0x54, 0x86, 0x53, + 0x99, 0x7c, 0xa3, 0x32, 0x7a, 0x23, 0xfa, 0x74, 0xf4, 0xee, 0x91, 0x1d, 0x62, 0x2c, 0xa2, 0xb4, + 0x67, 0xb3, 0xa2, 0x29, 0x23, 0xed, 0xd9, 0xca, 0x17, 0x28, 0xf7, 0xff, 0xd4, 0x57, 0xf1, 0xd2, + 0xaa, 0x7f, 0xce, 0xa1, 0xd7, 0x99, 0x34, 0xbe, 0x96, 0x50, 0x18, 0xa7, 0xb8, 0x2c, 0xfc, 0x0f, + 0x10, 0x39, 0x96, 0xbc, 0x9d, 0x24, 0x95, 0xb3, 0x2a, 0x1b, 0xdf, 0xfd, 0xfe, 0xcf, 0x8f, 0xe9, + 0x22, 0x5e, 0xd5, 0x84, 0xce, 0x19, 0x76, 0xff, 0x5e, 0x42, 0x33, 0x50, 0x8b, 0x4b, 0x13, 0xe5, + 0x43, 0x90, 0x72, 0x82, 0x4c, 0xe0, 0xd0, 0x18, 0x47, 0x19, 0x6f, 0x8d, 0xe5, 0xd0, 0xae, 0x60, + 0x5f, 0x3d, 0xfc, 0x93, 0x84, 0xe6, 0x23, 0xc3, 0xc7, 0x3b, 0x13, 0x7b, 0x45, 0xd6, 0x29, 0x57, + 0x12, 0x66, 0xbf, 0x84, 0xae, 0x6e, 0x75, 0xeb, 0x9e, 0xad, 0x5d, 0x79, 0x76, 0x0f, 0x7f, 0x2b, + 0xa1, 0x69, 0x6e, 0x15, 0x78, 0x6b, 0x74, 0xab, 0x98, 0x99, 0xc8, 0xa5, 0xc9, 0x89, 0x80, 0xb3, + 0xce, 0x70, 0x56, 0x71, 0x5e, 0x88, 0xc3, 0x7d, 0x10, 0xff, 0x2c, 0xa1, 0xb8, 0xa7, 0x50, 0xac, + 0x8d, 0xee, 0x20, 0x74, 0x67, 0xf9, 0x9d, 0xe4, 0x05, 0x80, 0xb6, 0xc3, 0xd0, 0x36, 0xf1, 0x5b, + 0x42, 0xb4, 0x26, 0x2b, 0xaa, 0x0f, 0x9e, 0xd5, 0xb5, 0x84, 0x32, 0x51, 0x13, 0x1b, 0xf1, 0xb6, + 0x04, 0xf6, 0x37, 0xe2, 0x6d, 0x89, 0x1c, 0x71, 0xc2, 0xb8, 0xb8, 0x2f, 0xe2, 0x5f, 0x24, 0x94, + 0x15, 0xd9, 0x19, 0x16, 0xcf, 0x60, 0x8c, 0x7b, 0xca, 0xbb, 0x2f, 0xa8, 0x00, 0xc4, 0x3d, 0x86, + 0x58, 0xc1, 0x6f, 0x8f, 0x41, 0x1c, 0x3c, 0x7e, 0xee, 0x60, 0x3d, 0xfc, 0xeb, 0x10, 0x39, 0x66, + 0x7a, 0xe3, 0x91, 0x45, 0x2e, 0x3b, 0x1e, 0x59, 0xe8, 0xa8, 0xca, 0xbb, 0x0c, 0x59, 0xc5, 0x3b, + 0x89, 0x90, 0xb9, 0x77, 0xf7, 0xf4, 0x83, 0xbb, 0xc7, 0x82, 0xf4, 0xf0, 0x58, 0x90, 0xfe, 0x7e, + 0x2c, 0x48, 0x3f, 0x3c, 0x15, 0x52, 0x0f, 0x4f, 0x85, 0xd4, 0x1f, 0x4f, 0x85, 0xd4, 0x97, 0x65, + 0xd7, 0x0b, 0xce, 0x3a, 0x96, 0xda, 0x20, 0xcd, 0x50, 0x91, 0xff, 0xa9, 0x50, 0xfb, 0x6b, 0xed, + 0x92, 0xcb, 0x07, 0xdd, 0x96, 0x43, 0xad, 0x69, 0xe6, 0xa3, 0x7b, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x45, 0x90, 0x67, 0x2a, 0x9f, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -757,6 +854,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) + // AccountById returns account details based on account id + AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -803,6 +902,15 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } +func (c *queryClient) AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) { + out := new(QueryAccountByIdResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Params", in, out, opts...) @@ -856,6 +964,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) + // AccountById returns account details based on account id + AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -886,6 +996,9 @@ func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccount func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } +func (*UnimplementedQueryServer) AccountById(ctx context.Context, req *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountById not implemented") +} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } @@ -942,6 +1055,24 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_AccountById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AccountById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountById(ctx, req.(*QueryAccountByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryParamsRequest) if err := dec(in); err != nil { @@ -1044,6 +1175,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Account", Handler: _Query_Account_Handler, }, + { + MethodName: "AccountById", + Handler: _Query_AccountById_Handler, + }, { MethodName: "Params", Handler: _Query_Params_Handler, @@ -1507,6 +1642,69 @@ func (m *AddressStringToBytesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryAccountByIdRequest) 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 *QueryAccountByIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountByIdResponse) 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 *QueryAccountByIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Account != nil { + { + size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1694,6 +1892,31 @@ func (m *AddressStringToBytesResponse) Size() (n int) { return n } +func (m *QueryAccountByIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryAccountByIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2805,6 +3028,161 @@ func (m *AddressStringToBytesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAccountByIdRequest) 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 ErrIntOverflowQuery + } + 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: QueryAccountByIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountByIdResponse) 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 ErrIntOverflowQuery + } + 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: QueryAccountByIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/types/query.pb.gw.go b/x/auth/types/query.pb.gw.go index 0911d0d5115a..021a0c14fd81 100644 --- a/x/auth/types/query.pb.gw.go +++ b/x/auth/types/query.pb.gw.go @@ -123,6 +123,60 @@ func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marsha } +func request_Query_AccountById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.AccountById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AccountById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.AccountById(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest var metadata runtime.ServerMetadata @@ -337,6 +391,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AccountById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AccountById_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -533,6 +610,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AccountById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AccountById_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -641,6 +738,8 @@ var ( pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AccountById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "account_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ModuleAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "module_accounts"}, "", runtime.AssumeColonVerbOpt(false))) @@ -657,6 +756,8 @@ var ( forward_Query_Account_0 = runtime.ForwardResponseMessage + forward_Query_AccountById_0 = runtime.ForwardResponseMessage + forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_ModuleAccounts_0 = runtime.ForwardResponseMessage From 1ffcd114e034eddee30c3f10253fc5be09ae3447 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 11:31:08 +0530 Subject: [PATCH 02/19] refactor: remove auth info and add acc-addr by id --- api/cosmos/auth/v1beta1/query.pulsar.go | 656 +++++++++++------------ api/cosmos/auth/v1beta1/query_grpc.pb.go | 32 +- proto/cosmos/auth/v1beta1/query.proto | 20 +- x/auth/client/cli/query.go | 21 +- x/auth/keeper/account.go | 16 +- x/auth/keeper/grpc_query.go | 13 +- x/auth/types/keys.go | 2 +- x/auth/types/query.pb.go | 286 +++++----- x/auth/types/query.pb.gw.go | 32 +- 9 files changed, 526 insertions(+), 552 deletions(-) diff --git a/api/cosmos/auth/v1beta1/query.pulsar.go b/api/cosmos/auth/v1beta1/query.pulsar.go index 9b15717bbc86..1d28b5013c93 100644 --- a/api/cosmos/auth/v1beta1/query.pulsar.go +++ b/api/cosmos/auth/v1beta1/query.pulsar.go @@ -5982,25 +5982,25 @@ func (x *fastReflection_AddressStringToBytesResponse) ProtoMethods() *protoiface } var ( - md_QueryAccountByIdRequest protoreflect.MessageDescriptor - fd_QueryAccountByIdRequest_id protoreflect.FieldDescriptor + md_QueryAccountAddressByIdRequest protoreflect.MessageDescriptor + fd_QueryAccountAddressByIdRequest_id protoreflect.FieldDescriptor ) func init() { file_cosmos_auth_v1beta1_query_proto_init() - md_QueryAccountByIdRequest = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountByIdRequest") - fd_QueryAccountByIdRequest_id = md_QueryAccountByIdRequest.Fields().ByName("id") + md_QueryAccountAddressByIdRequest = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIdRequest") + fd_QueryAccountAddressByIdRequest_id = md_QueryAccountAddressByIdRequest.Fields().ByName("id") } -var _ protoreflect.Message = (*fastReflection_QueryAccountByIdRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIdRequest)(nil) -type fastReflection_QueryAccountByIdRequest QueryAccountByIdRequest +type fastReflection_QueryAccountAddressByIdRequest QueryAccountAddressByIdRequest -func (x *QueryAccountByIdRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountByIdRequest)(x) +func (x *QueryAccountAddressByIdRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIdRequest)(x) } -func (x *QueryAccountByIdRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountAddressByIdRequest) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6012,43 +6012,43 @@ func (x *QueryAccountByIdRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAccountByIdRequest_messageType fastReflection_QueryAccountByIdRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountByIdRequest_messageType{} +var _fastReflection_QueryAccountAddressByIdRequest_messageType fastReflection_QueryAccountAddressByIdRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIdRequest_messageType{} -type fastReflection_QueryAccountByIdRequest_messageType struct{} +type fastReflection_QueryAccountAddressByIdRequest_messageType struct{} -func (x fastReflection_QueryAccountByIdRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountByIdRequest)(nil) +func (x fastReflection_QueryAccountAddressByIdRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIdRequest)(nil) } -func (x fastReflection_QueryAccountByIdRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountByIdRequest) +func (x fastReflection_QueryAccountAddressByIdRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIdRequest) } -func (x fastReflection_QueryAccountByIdRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountByIdRequest +func (x fastReflection_QueryAccountAddressByIdRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIdRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountByIdRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountByIdRequest +func (x *fastReflection_QueryAccountAddressByIdRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIdRequest } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAccountByIdRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountByIdRequest_messageType +func (x *fastReflection_QueryAccountAddressByIdRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountAddressByIdRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountByIdRequest) New() protoreflect.Message { - return new(fastReflection_QueryAccountByIdRequest) +func (x *fastReflection_QueryAccountAddressByIdRequest) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIdRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountByIdRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAccountByIdRequest)(x) +func (x *fastReflection_QueryAccountAddressByIdRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAccountAddressByIdRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -6056,10 +6056,10 @@ func (x *fastReflection_QueryAccountByIdRequest) Interface() protoreflect.ProtoM // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountByIdRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_QueryAccountByIdRequest_id, value) { +func (x *fastReflection_QueryAccountAddressByIdRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != int64(0) { + value := protoreflect.ValueOfInt64(x.Id) + if !f(fd_QueryAccountAddressByIdRequest_id, value) { return } } @@ -6076,15 +6076,15 @@ func (x *fastReflection_QueryAccountByIdRequest) Range(f func(protoreflect.Field // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAccountByIdRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountAddressByIdRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": - return x.Id != uint64(0) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + return x.Id != int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) } } @@ -6094,15 +6094,15 @@ func (x *fastReflection_QueryAccountByIdRequest) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountAddressByIdRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": - x.Id = uint64(0) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + x.Id = int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) } } @@ -6112,16 +6112,16 @@ func (x *fastReflection_QueryAccountByIdRequest) Clear(fd protoreflect.FieldDesc // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAccountByIdRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": value := x.Id - return protoreflect.ValueOfUint64(value) + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", descriptor.FullName())) } } @@ -6135,15 +6135,15 @@ func (x *fastReflection_QueryAccountByIdRequest) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountAddressByIdRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": - x.Id = value.Uint() + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + x.Id = value.Int() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) } } @@ -6157,40 +6157,40 @@ func (x *fastReflection_QueryAccountByIdRequest) Set(fd protoreflect.FieldDescri // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": - panic(fmt.Errorf("field id of message cosmos.auth.v1beta1.QueryAccountByIdRequest is not mutable")) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + panic(fmt.Errorf("field id of message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAccountByIdRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdRequest.id": - return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAccountByIdRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountAddressByIdRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountByIdRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIdRequest", d.FullName())) } panic("unreachable") } @@ -6198,7 +6198,7 @@ func (x *fastReflection_QueryAccountByIdRequest) WhichOneof(d protoreflect.Oneof // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAccountByIdRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountAddressByIdRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6209,7 +6209,7 @@ func (x *fastReflection_QueryAccountByIdRequest) GetUnknown() protoreflect.RawFi // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountAddressByIdRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6221,7 +6221,7 @@ func (x *fastReflection_QueryAccountByIdRequest) SetUnknown(fields protoreflect. // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryAccountByIdRequest) IsValid() bool { +func (x *fastReflection_QueryAccountAddressByIdRequest) IsValid() bool { return x != nil } @@ -6231,9 +6231,9 @@ func (x *fastReflection_QueryAccountByIdRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIdRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6258,7 +6258,7 @@ func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIdRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6293,7 +6293,7 @@ func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIdRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6325,10 +6325,10 @@ func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Meth fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6345,7 +6345,7 @@ func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Meth } b := dAtA[iNdEx] iNdEx++ - x.Id |= uint64(b&0x7F) << shift + x.Id |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -6386,25 +6386,25 @@ func (x *fastReflection_QueryAccountByIdRequest) ProtoMethods() *protoiface.Meth } var ( - md_QueryAccountByIdResponse protoreflect.MessageDescriptor - fd_QueryAccountByIdResponse_account protoreflect.FieldDescriptor + md_QueryAccountAddressByIdResponse protoreflect.MessageDescriptor + fd_QueryAccountAddressByIdResponse_account_address protoreflect.FieldDescriptor ) func init() { file_cosmos_auth_v1beta1_query_proto_init() - md_QueryAccountByIdResponse = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountByIdResponse") - fd_QueryAccountByIdResponse_account = md_QueryAccountByIdResponse.Fields().ByName("account") + md_QueryAccountAddressByIdResponse = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIdResponse") + fd_QueryAccountAddressByIdResponse_account_address = md_QueryAccountAddressByIdResponse.Fields().ByName("account_address") } -var _ protoreflect.Message = (*fastReflection_QueryAccountByIdResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIdResponse)(nil) -type fastReflection_QueryAccountByIdResponse QueryAccountByIdResponse +type fastReflection_QueryAccountAddressByIdResponse QueryAccountAddressByIdResponse -func (x *QueryAccountByIdResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountByIdResponse)(x) +func (x *QueryAccountAddressByIdResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIdResponse)(x) } -func (x *QueryAccountByIdResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountAddressByIdResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6416,43 +6416,43 @@ func (x *QueryAccountByIdResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAccountByIdResponse_messageType fastReflection_QueryAccountByIdResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountByIdResponse_messageType{} +var _fastReflection_QueryAccountAddressByIdResponse_messageType fastReflection_QueryAccountAddressByIdResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIdResponse_messageType{} -type fastReflection_QueryAccountByIdResponse_messageType struct{} +type fastReflection_QueryAccountAddressByIdResponse_messageType struct{} -func (x fastReflection_QueryAccountByIdResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountByIdResponse)(nil) +func (x fastReflection_QueryAccountAddressByIdResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIdResponse)(nil) } -func (x fastReflection_QueryAccountByIdResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountByIdResponse) +func (x fastReflection_QueryAccountAddressByIdResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIdResponse) } -func (x fastReflection_QueryAccountByIdResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountByIdResponse +func (x fastReflection_QueryAccountAddressByIdResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIdResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountByIdResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountByIdResponse +func (x *fastReflection_QueryAccountAddressByIdResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIdResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAccountByIdResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountByIdResponse_messageType +func (x *fastReflection_QueryAccountAddressByIdResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountAddressByIdResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountByIdResponse) New() protoreflect.Message { - return new(fastReflection_QueryAccountByIdResponse) +func (x *fastReflection_QueryAccountAddressByIdResponse) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIdResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountByIdResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAccountByIdResponse)(x) +func (x *fastReflection_QueryAccountAddressByIdResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAccountAddressByIdResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -6460,10 +6460,10 @@ func (x *fastReflection_QueryAccountByIdResponse) Interface() protoreflect.Proto // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountByIdResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Account != nil { - value := protoreflect.ValueOfMessage(x.Account.ProtoReflect()) - if !f(fd_QueryAccountByIdResponse_account, value) { +func (x *fastReflection_QueryAccountAddressByIdResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AccountAddress != "" { + value := protoreflect.ValueOfString(x.AccountAddress) + if !f(fd_QueryAccountAddressByIdResponse_account_address, value) { return } } @@ -6480,15 +6480,15 @@ func (x *fastReflection_QueryAccountByIdResponse) Range(f func(protoreflect.Fiel // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAccountByIdResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountAddressByIdResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - return x.Account != nil + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + return x.AccountAddress != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) } } @@ -6498,15 +6498,15 @@ func (x *fastReflection_QueryAccountByIdResponse) Has(fd protoreflect.FieldDescr // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountAddressByIdResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - x.Account = nil + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + x.AccountAddress = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) } } @@ -6516,16 +6516,16 @@ func (x *fastReflection_QueryAccountByIdResponse) Clear(fd protoreflect.FieldDes // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAccountByIdResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - value := x.Account - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + value := x.AccountAddress + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", descriptor.FullName())) } } @@ -6539,15 +6539,15 @@ func (x *fastReflection_QueryAccountByIdResponse) Get(descriptor protoreflect.Fi // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountAddressByIdResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - x.Account = value.Message().Interface().(*anypb.Any) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + x.AccountAddress = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) } } @@ -6561,44 +6561,40 @@ func (x *fastReflection_QueryAccountByIdResponse) Set(fd protoreflect.FieldDescr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - if x.Account == nil { - x.Account = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.Account.ProtoReflect()) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + panic(fmt.Errorf("field account_address of message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAccountByIdResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIdResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountByIdResponse.account": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAccountByIdResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountAddressByIdResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountByIdResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIdResponse", d.FullName())) } panic("unreachable") } @@ -6606,7 +6602,7 @@ func (x *fastReflection_QueryAccountByIdResponse) WhichOneof(d protoreflect.Oneo // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAccountByIdResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountAddressByIdResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6617,7 +6613,7 @@ func (x *fastReflection_QueryAccountByIdResponse) GetUnknown() protoreflect.RawF // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountByIdResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountAddressByIdResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6629,7 +6625,7 @@ func (x *fastReflection_QueryAccountByIdResponse) SetUnknown(fields protoreflect // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryAccountByIdResponse) IsValid() bool { +func (x *fastReflection_QueryAccountAddressByIdResponse) IsValid() bool { return x != nil } @@ -6639,9 +6635,9 @@ func (x *fastReflection_QueryAccountByIdResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountAddressByIdResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIdResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6653,8 +6649,8 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met var n int var l int _ = l - if x.Account != nil { - l = options.Size(x.Account) + l = len(x.AccountAddress) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -6667,7 +6663,7 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIdResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6686,17 +6682,10 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Account != nil { - encoded, err := options.Marshal(x.Account) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.AccountAddress) > 0 { + i -= len(x.AccountAddress) + copy(dAtA[i:], x.AccountAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccountAddress))) i-- dAtA[i] = 0xa } @@ -6711,7 +6700,7 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIdResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6743,17 +6732,17 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6763,27 +6752,23 @@ func (x *fastReflection_QueryAccountByIdResponse) ProtoMethods() *protoiface.Met } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Account == nil { - x.Account = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Account); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.AccountAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7344,17 +7329,17 @@ func (x *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } -// QueryAccountByIdRequest is the request type for AccountById rpc method -type QueryAccountByIdRequest struct { +// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method +type QueryAccountAddressByIdRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *QueryAccountByIdRequest) Reset() { - *x = QueryAccountByIdRequest{} +func (x *QueryAccountAddressByIdRequest) Reset() { + *x = QueryAccountAddressByIdRequest{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -7362,36 +7347,36 @@ func (x *QueryAccountByIdRequest) Reset() { } } -func (x *QueryAccountByIdRequest) String() string { +func (x *QueryAccountAddressByIdRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAccountByIdRequest) ProtoMessage() {} +func (*QueryAccountAddressByIdRequest) ProtoMessage() {} -// Deprecated: Use QueryAccountByIdRequest.ProtoReflect.Descriptor instead. -func (*QueryAccountByIdRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountAddressByIdRequest.ProtoReflect.Descriptor instead. +func (*QueryAccountAddressByIdRequest) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{14} } -func (x *QueryAccountByIdRequest) GetId() uint64 { +func (x *QueryAccountAddressByIdRequest) GetId() int64 { if x != nil { return x.Id } return 0 } -// QueryAccountByIdResponse is the response type for AccountById rpc method -type QueryAccountByIdResponse struct { +// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method +type QueryAccountAddressByIdResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // account defines the account of the corresponding address. - Account *anypb.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` } -func (x *QueryAccountByIdResponse) Reset() { - *x = QueryAccountByIdResponse{} +func (x *QueryAccountAddressByIdResponse) Reset() { + *x = QueryAccountAddressByIdResponse{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -7399,22 +7384,22 @@ func (x *QueryAccountByIdResponse) Reset() { } } -func (x *QueryAccountByIdResponse) String() string { +func (x *QueryAccountAddressByIdResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAccountByIdResponse) ProtoMessage() {} +func (*QueryAccountAddressByIdResponse) ProtoMessage() {} -// Deprecated: Use QueryAccountByIdResponse.ProtoReflect.Descriptor instead. -func (*QueryAccountByIdResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountAddressByIdResponse.ProtoReflect.Descriptor instead. +func (*QueryAccountAddressByIdResponse) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{15} } -func (x *QueryAccountByIdResponse) GetAccount() *anypb.Any { +func (x *QueryAccountAddressByIdResponse) GetAccountAddress() string { if x != nil { - return x.Account + return x.AccountAddress } - return nil + return "" } var File_cosmos_auth_v1beta1_query_proto protoreflect.FileDescriptor @@ -7499,106 +7484,108 @@ var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, - 0x29, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x18, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x0c, 0xca, - 0xb4, 0x2d, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x52, 0x07, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xdb, 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x88, - 0x01, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0b, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x2c, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, - 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x30, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x64, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0xf0, 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x88, 0x01, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, - 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x62, - 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, - 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, - 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, - 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, - 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x8f, 0x01, 0x0a, + 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb0, + 0x01, 0x0a, 0x12, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x42, 0x79, 0x49, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, + 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x63, + 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, - 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x7d, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, + 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, + 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, + 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, - 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, - 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7615,26 +7602,26 @@ func file_cosmos_auth_v1beta1_query_proto_rawDescGZIP() []byte { var file_cosmos_auth_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_cosmos_auth_v1beta1_query_proto_goTypes = []interface{}{ - (*QueryAccountsRequest)(nil), // 0: cosmos.auth.v1beta1.QueryAccountsRequest - (*QueryAccountsResponse)(nil), // 1: cosmos.auth.v1beta1.QueryAccountsResponse - (*QueryAccountRequest)(nil), // 2: cosmos.auth.v1beta1.QueryAccountRequest - (*QueryModuleAccountsRequest)(nil), // 3: cosmos.auth.v1beta1.QueryModuleAccountsRequest - (*QueryParamsResponse)(nil), // 4: cosmos.auth.v1beta1.QueryParamsResponse - (*QueryAccountResponse)(nil), // 5: cosmos.auth.v1beta1.QueryAccountResponse - (*QueryParamsRequest)(nil), // 6: cosmos.auth.v1beta1.QueryParamsRequest - (*QueryModuleAccountsResponse)(nil), // 7: cosmos.auth.v1beta1.QueryModuleAccountsResponse - (*Bech32PrefixRequest)(nil), // 8: cosmos.auth.v1beta1.Bech32PrefixRequest - (*Bech32PrefixResponse)(nil), // 9: cosmos.auth.v1beta1.Bech32PrefixResponse - (*AddressBytesToStringRequest)(nil), // 10: cosmos.auth.v1beta1.AddressBytesToStringRequest - (*AddressBytesToStringResponse)(nil), // 11: cosmos.auth.v1beta1.AddressBytesToStringResponse - (*AddressStringToBytesRequest)(nil), // 12: cosmos.auth.v1beta1.AddressStringToBytesRequest - (*AddressStringToBytesResponse)(nil), // 13: cosmos.auth.v1beta1.AddressStringToBytesResponse - (*QueryAccountByIdRequest)(nil), // 14: cosmos.auth.v1beta1.QueryAccountByIdRequest - (*QueryAccountByIdResponse)(nil), // 15: cosmos.auth.v1beta1.QueryAccountByIdResponse - (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest - (*anypb.Any)(nil), // 17: google.protobuf.Any - (*v1beta1.PageResponse)(nil), // 18: cosmos.base.query.v1beta1.PageResponse - (*Params)(nil), // 19: cosmos.auth.v1beta1.Params + (*QueryAccountsRequest)(nil), // 0: cosmos.auth.v1beta1.QueryAccountsRequest + (*QueryAccountsResponse)(nil), // 1: cosmos.auth.v1beta1.QueryAccountsResponse + (*QueryAccountRequest)(nil), // 2: cosmos.auth.v1beta1.QueryAccountRequest + (*QueryModuleAccountsRequest)(nil), // 3: cosmos.auth.v1beta1.QueryModuleAccountsRequest + (*QueryParamsResponse)(nil), // 4: cosmos.auth.v1beta1.QueryParamsResponse + (*QueryAccountResponse)(nil), // 5: cosmos.auth.v1beta1.QueryAccountResponse + (*QueryParamsRequest)(nil), // 6: cosmos.auth.v1beta1.QueryParamsRequest + (*QueryModuleAccountsResponse)(nil), // 7: cosmos.auth.v1beta1.QueryModuleAccountsResponse + (*Bech32PrefixRequest)(nil), // 8: cosmos.auth.v1beta1.Bech32PrefixRequest + (*Bech32PrefixResponse)(nil), // 9: cosmos.auth.v1beta1.Bech32PrefixResponse + (*AddressBytesToStringRequest)(nil), // 10: cosmos.auth.v1beta1.AddressBytesToStringRequest + (*AddressBytesToStringResponse)(nil), // 11: cosmos.auth.v1beta1.AddressBytesToStringResponse + (*AddressStringToBytesRequest)(nil), // 12: cosmos.auth.v1beta1.AddressStringToBytesRequest + (*AddressStringToBytesResponse)(nil), // 13: cosmos.auth.v1beta1.AddressStringToBytesResponse + (*QueryAccountAddressByIdRequest)(nil), // 14: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest + (*QueryAccountAddressByIdResponse)(nil), // 15: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse + (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest + (*anypb.Any)(nil), // 17: google.protobuf.Any + (*v1beta1.PageResponse)(nil), // 18: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 19: cosmos.auth.v1beta1.Params } var file_cosmos_auth_v1beta1_query_proto_depIdxs = []int32{ 16, // 0: cosmos.auth.v1beta1.QueryAccountsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest @@ -7643,28 +7630,27 @@ var file_cosmos_auth_v1beta1_query_proto_depIdxs = []int32{ 19, // 3: cosmos.auth.v1beta1.QueryParamsResponse.params:type_name -> cosmos.auth.v1beta1.Params 17, // 4: cosmos.auth.v1beta1.QueryAccountResponse.account:type_name -> google.protobuf.Any 17, // 5: cosmos.auth.v1beta1.QueryModuleAccountsResponse.accounts:type_name -> google.protobuf.Any - 17, // 6: cosmos.auth.v1beta1.QueryAccountByIdResponse.account:type_name -> google.protobuf.Any - 0, // 7: cosmos.auth.v1beta1.Query.Accounts:input_type -> cosmos.auth.v1beta1.QueryAccountsRequest - 2, // 8: cosmos.auth.v1beta1.Query.Account:input_type -> cosmos.auth.v1beta1.QueryAccountRequest - 14, // 9: cosmos.auth.v1beta1.Query.AccountById:input_type -> cosmos.auth.v1beta1.QueryAccountByIdRequest - 6, // 10: cosmos.auth.v1beta1.Query.Params:input_type -> cosmos.auth.v1beta1.QueryParamsRequest - 3, // 11: cosmos.auth.v1beta1.Query.ModuleAccounts:input_type -> cosmos.auth.v1beta1.QueryModuleAccountsRequest - 8, // 12: cosmos.auth.v1beta1.Query.Bech32Prefix:input_type -> cosmos.auth.v1beta1.Bech32PrefixRequest - 10, // 13: cosmos.auth.v1beta1.Query.AddressBytesToString:input_type -> cosmos.auth.v1beta1.AddressBytesToStringRequest - 12, // 14: cosmos.auth.v1beta1.Query.AddressStringToBytes:input_type -> cosmos.auth.v1beta1.AddressStringToBytesRequest - 1, // 15: cosmos.auth.v1beta1.Query.Accounts:output_type -> cosmos.auth.v1beta1.QueryAccountsResponse - 5, // 16: cosmos.auth.v1beta1.Query.Account:output_type -> cosmos.auth.v1beta1.QueryAccountResponse - 15, // 17: cosmos.auth.v1beta1.Query.AccountById:output_type -> cosmos.auth.v1beta1.QueryAccountByIdResponse - 4, // 18: cosmos.auth.v1beta1.Query.Params:output_type -> cosmos.auth.v1beta1.QueryParamsResponse - 7, // 19: cosmos.auth.v1beta1.Query.ModuleAccounts:output_type -> cosmos.auth.v1beta1.QueryModuleAccountsResponse - 9, // 20: cosmos.auth.v1beta1.Query.Bech32Prefix:output_type -> cosmos.auth.v1beta1.Bech32PrefixResponse - 11, // 21: cosmos.auth.v1beta1.Query.AddressBytesToString:output_type -> cosmos.auth.v1beta1.AddressBytesToStringResponse - 13, // 22: cosmos.auth.v1beta1.Query.AddressStringToBytes:output_type -> cosmos.auth.v1beta1.AddressStringToBytesResponse - 15, // [15:23] is the sub-list for method output_type - 7, // [7:15] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 0, // 6: cosmos.auth.v1beta1.Query.Accounts:input_type -> cosmos.auth.v1beta1.QueryAccountsRequest + 2, // 7: cosmos.auth.v1beta1.Query.Account:input_type -> cosmos.auth.v1beta1.QueryAccountRequest + 14, // 8: cosmos.auth.v1beta1.Query.AccountAddressById:input_type -> cosmos.auth.v1beta1.QueryAccountAddressByIdRequest + 6, // 9: cosmos.auth.v1beta1.Query.Params:input_type -> cosmos.auth.v1beta1.QueryParamsRequest + 3, // 10: cosmos.auth.v1beta1.Query.ModuleAccounts:input_type -> cosmos.auth.v1beta1.QueryModuleAccountsRequest + 8, // 11: cosmos.auth.v1beta1.Query.Bech32Prefix:input_type -> cosmos.auth.v1beta1.Bech32PrefixRequest + 10, // 12: cosmos.auth.v1beta1.Query.AddressBytesToString:input_type -> cosmos.auth.v1beta1.AddressBytesToStringRequest + 12, // 13: cosmos.auth.v1beta1.Query.AddressStringToBytes:input_type -> cosmos.auth.v1beta1.AddressStringToBytesRequest + 1, // 14: cosmos.auth.v1beta1.Query.Accounts:output_type -> cosmos.auth.v1beta1.QueryAccountsResponse + 5, // 15: cosmos.auth.v1beta1.Query.Account:output_type -> cosmos.auth.v1beta1.QueryAccountResponse + 15, // 16: cosmos.auth.v1beta1.Query.AccountAddressById:output_type -> cosmos.auth.v1beta1.QueryAccountAddressByIdResponse + 4, // 17: cosmos.auth.v1beta1.Query.Params:output_type -> cosmos.auth.v1beta1.QueryParamsResponse + 7, // 18: cosmos.auth.v1beta1.Query.ModuleAccounts:output_type -> cosmos.auth.v1beta1.QueryModuleAccountsResponse + 9, // 19: cosmos.auth.v1beta1.Query.Bech32Prefix:output_type -> cosmos.auth.v1beta1.Bech32PrefixResponse + 11, // 20: cosmos.auth.v1beta1.Query.AddressBytesToString:output_type -> cosmos.auth.v1beta1.AddressBytesToStringResponse + 13, // 21: cosmos.auth.v1beta1.Query.AddressStringToBytes:output_type -> cosmos.auth.v1beta1.AddressStringToBytesResponse + 14, // [14:22] is the sub-list for method output_type + 6, // [6:14] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_auth_v1beta1_query_proto_init() } @@ -7843,7 +7829,7 @@ func file_cosmos_auth_v1beta1_query_proto_init() { } } file_cosmos_auth_v1beta1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAccountByIdRequest); i { + switch v := v.(*QueryAccountAddressByIdRequest); i { case 0: return &v.state case 1: @@ -7855,7 +7841,7 @@ func file_cosmos_auth_v1beta1_query_proto_init() { } } file_cosmos_auth_v1beta1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAccountByIdResponse); i { + switch v := v.(*QueryAccountAddressByIdResponse); i { case 0: return &v.state case 1: diff --git a/api/cosmos/auth/v1beta1/query_grpc.pb.go b/api/cosmos/auth/v1beta1/query_grpc.pb.go index 3a24ec57f3dd..5bca8d73574d 100644 --- a/api/cosmos/auth/v1beta1/query_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/query_grpc.pb.go @@ -28,8 +28,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // AccountById returns account details based on account id - AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) + // AccountAddressById returns account address based on account id + AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -76,9 +76,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } -func (c *queryClient) AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) { - out := new(QueryAccountByIdResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountById", in, out, opts...) +func (c *queryClient) AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) { + out := new(QueryAccountAddressByIdResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressById", in, out, opts...) if err != nil { return nil, err } @@ -140,8 +140,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // AccountById returns account details based on account id - AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) + // AccountAddressById returns account address based on account id + AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -173,8 +173,8 @@ func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } -func (UnimplementedQueryServer) AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountById not implemented") +func (UnimplementedQueryServer) AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountAddressById not implemented") } func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -240,20 +240,20 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_AccountById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountByIdRequest) +func _Query_AccountAddressById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountAddressByIdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AccountById(ctx, in) + return srv.(QueryServer).AccountAddressById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountById", + FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountById(ctx, req.(*QueryAccountByIdRequest)) + return srv.(QueryServer).AccountAddressById(ctx, req.(*QueryAccountAddressByIdRequest)) } return interceptor(ctx, in, info, handler) } @@ -364,8 +364,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Account_Handler, }, { - MethodName: "AccountById", - Handler: _Query_AccountById_Handler, + MethodName: "AccountAddressById", + Handler: _Query_AccountAddressById_Handler, }, { MethodName: "Params", diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index b4a77b787e92..dd8bd4d7297e 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -24,9 +24,9 @@ service Query { option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; } - // AccountById returns account details based on account id - rpc AccountById(QueryAccountByIdRequest) returns (QueryAccountByIdResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/account_by_id/{id}"; + // AccountAddressById returns account address based on account id + rpc AccountAddressById(QueryAccountAddressByIdRequest) returns (QueryAccountAddressByIdResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; } // Params queries all parameters. @@ -158,13 +158,13 @@ message AddressStringToBytesResponse { bytes address_bytes = 1; } -// QueryAccountByIdRequest is the request type for AccountById rpc method -message QueryAccountByIdRequest{ - uint64 id = 1; +// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method +message QueryAccountAddressByIdRequest{ + int64 id = 1; } -// QueryAccountByIdResponse is the response type for AccountById rpc method -message QueryAccountByIdResponse { +// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method +message QueryAccountAddressByIdResponse { // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; -} \ No newline at end of file + string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 5b87a56f2f37..8e4af58eee76 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -42,7 +42,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetAccountCmd(), - GetAccountByIdCmd(), + GetAccountAddressByIdCmd(), GetAccountsCmd(), QueryParamsCmd(), QueryModuleAccountsCmd(), @@ -126,19 +126,18 @@ func GetAccountCmd() *cobra.Command { return cmd } -// GetAccountByIdCmd returns a query account that will display the state of the -// account at a given account id. -func GetAccountByIdCmd() *cobra.Command { +// GetAccountAddressByIdCmd returns a query account address that will display the address of given account id. +func GetAccountAddressByIdCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "account-by-id [id]", - Short: "Query for account by account id", + Use: "address-by-id [id]", + Short: "Query for account address by account id", Args: cobra.ExactArgs(1), Example: fmt.Sprintf( - "%s q auth account-by-id 1", version.AppName, + "%s q auth address-by-id 1", version.AppName, ), Long: strings.TrimSpace(`Query the account by id: -$ query auth account-by-id [id] +$ query auth address-by-id [id] `), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -146,18 +145,18 @@ $ query auth account-by-id [id] return err } - id, err := strconv.Atoi(args[0]) + id, err := strconv.ParseInt(args[0], 10, 64) if err != nil { return err } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AccountById(cmd.Context(), &types.QueryAccountByIdRequest{Id: uint64(id)}) + res, err := queryClient.AccountAddressById(cmd.Context(), &types.QueryAccountAddressByIdRequest{Id: id}) if err != nil { return err } - return clientCtx.PrintProto(res.Account) + return clientCtx.PrintProto(res) }, } diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index 2c771a5c88c4..ae16a2a3fc30 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -1,6 +1,7 @@ package keeper import ( + "github.com/cosmos/cosmos-sdk/internal/conv" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -31,8 +32,8 @@ func (ak AccountKeeper) HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool { return store.Has(types.AddressStoreKey(addr)) } -// HasAccountById checks account exsits by id -func (ak AccountKeeper) HasAccountById(ctx sdk.Context, id uint64) bool { +// HasAccountAddressById checks account address exsits by id. +func (ak AccountKeeper) HasAccountAddressById(ctx sdk.Context, id int64) bool { store := ctx.KVStore(ak.key) return store.Has(types.AccountNumberStoreKey(id)) } @@ -48,15 +49,15 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A return ak.decodeAccount(bz) } -// GetAccount implements AccountKeeperI. -func (ak AccountKeeper) GetAccountById(ctx sdk.Context, id uint64) types.AccountI { +// GetAccountAddressById returns account address by id. +func (ak AccountKeeper) GetAccountAddressById(ctx sdk.Context, id int64) string { store := ctx.KVStore(ak.key) bz := store.Get(types.AccountNumberStoreKey(id)) if bz == nil { - return nil + return "" } - return ak.decodeAccount(bz) + return conv.UnsafeBytesToStr(bz) } // GetAllAccounts returns all accounts in the accountKeeper. @@ -80,7 +81,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { } store.Set(types.AddressStoreKey(addr), bz) - store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), bz) + store.Set(types.AccountNumberStoreKey(int64(acc.GetAccountNumber())), conv.UnsafeStrToBytes(addr.String())) } // RemoveAccount removes an account for the account mapper store. @@ -89,6 +90,7 @@ func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) store.Delete(types.AddressStoreKey(addr)) + store.Delete(types.AccountNumberStoreKey(int64(acc.GetAccountNumber()))) } // IterateAccounts iterates over all the stored accounts and performs a callback function. diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 39cfd8edd4be..5aa9a301d57f 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -19,7 +19,7 @@ import ( var _ types.QueryServer = AccountKeeper{} -func (ak AccountKeeper) AccountById(c context.Context, req *types.QueryAccountByIdRequest) (*types.QueryAccountByIdResponse, error) { +func (ak AccountKeeper) AccountAddressById(c context.Context, req *types.QueryAccountAddressByIdRequest) (*types.QueryAccountAddressByIdResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -29,17 +29,12 @@ func (ak AccountKeeper) AccountById(c context.Context, req *types.QueryAccountBy } ctx := sdk.UnwrapSDKContext(c) - account := ak.GetAccountById(ctx, req.GetId()) - if account == nil { + address := ak.GetAccountAddressById(ctx, req.GetId()) + if len(address) == 0 { return nil, status.Errorf(codes.NotFound, "account is not found with id %d", req.Id) } - any, err := codectypes.NewAnyWithValue(account) - if err != nil { - return nil, status.Errorf(codes.Internal, err.Error()) - } - - return &types.QueryAccountByIdResponse{Account: any}, nil + return &types.QueryAccountAddressByIdResponse{AccountAddress: address}, nil } func (ak AccountKeeper) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { diff --git a/x/auth/types/keys.go b/x/auth/types/keys.go index 0149460cd837..06d14f9233f0 100644 --- a/x/auth/types/keys.go +++ b/x/auth/types/keys.go @@ -36,6 +36,6 @@ func AddressStoreKey(addr sdk.AccAddress) []byte { return append(AddressStoreKeyPrefix, addr.Bytes()...) } -func AccountNumberStoreKey(accountNumber uint64) []byte { +func AccountNumberStoreKey(accountNumber int64) []byte { return append(AccountNumberStoreKeyPrefix, []byte(strconv.Itoa(int(accountNumber)))...) } diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 94ae9e6ee535..5534dff3ba9e 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -665,23 +665,23 @@ func (m *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } -// QueryAccountByIdRequest is the request type for AccountById rpc method -type QueryAccountByIdRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method +type QueryAccountAddressByIdRequest struct { + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryAccountByIdRequest) Reset() { *m = QueryAccountByIdRequest{} } -func (m *QueryAccountByIdRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountByIdRequest) ProtoMessage() {} -func (*QueryAccountByIdRequest) Descriptor() ([]byte, []int) { +func (m *QueryAccountAddressByIdRequest) Reset() { *m = QueryAccountAddressByIdRequest{} } +func (m *QueryAccountAddressByIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIdRequest) ProtoMessage() {} +func (*QueryAccountAddressByIdRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c451370b3929a27c, []int{14} } -func (m *QueryAccountByIdRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountAddressByIdRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAccountByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountAddressByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAccountByIdRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountAddressByIdRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -691,43 +691,43 @@ func (m *QueryAccountByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryAccountByIdRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountByIdRequest.Merge(m, src) +func (m *QueryAccountAddressByIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIdRequest.Merge(m, src) } -func (m *QueryAccountByIdRequest) XXX_Size() int { +func (m *QueryAccountAddressByIdRequest) XXX_Size() int { return m.Size() } -func (m *QueryAccountByIdRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountByIdRequest.DiscardUnknown(m) +func (m *QueryAccountAddressByIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIdRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAccountByIdRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountAddressByIdRequest proto.InternalMessageInfo -func (m *QueryAccountByIdRequest) GetId() uint64 { +func (m *QueryAccountAddressByIdRequest) GetId() int64 { if m != nil { return m.Id } return 0 } -// QueryAccountByIdResponse is the response type for AccountById rpc method -type QueryAccountByIdResponse struct { +// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method +type QueryAccountAddressByIdResponse struct { // account defines the account of the corresponding address. - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` } -func (m *QueryAccountByIdResponse) Reset() { *m = QueryAccountByIdResponse{} } -func (m *QueryAccountByIdResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountByIdResponse) ProtoMessage() {} -func (*QueryAccountByIdResponse) Descriptor() ([]byte, []int) { +func (m *QueryAccountAddressByIdResponse) Reset() { *m = QueryAccountAddressByIdResponse{} } +func (m *QueryAccountAddressByIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIdResponse) ProtoMessage() {} +func (*QueryAccountAddressByIdResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c451370b3929a27c, []int{15} } -func (m *QueryAccountByIdResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountAddressByIdResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAccountByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountAddressByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAccountByIdResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountAddressByIdResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -737,23 +737,23 @@ func (m *QueryAccountByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *QueryAccountByIdResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountByIdResponse.Merge(m, src) +func (m *QueryAccountAddressByIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIdResponse.Merge(m, src) } -func (m *QueryAccountByIdResponse) XXX_Size() int { +func (m *QueryAccountAddressByIdResponse) XXX_Size() int { return m.Size() } -func (m *QueryAccountByIdResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountByIdResponse.DiscardUnknown(m) +func (m *QueryAccountAddressByIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIdResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAccountByIdResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountAddressByIdResponse proto.InternalMessageInfo -func (m *QueryAccountByIdResponse) GetAccount() *types.Any { +func (m *QueryAccountAddressByIdResponse) GetAccountAddress() string { if m != nil { - return m.Account + return m.AccountAddress } - return nil + return "" } func init() { @@ -771,69 +771,70 @@ func init() { proto.RegisterType((*AddressBytesToStringResponse)(nil), "cosmos.auth.v1beta1.AddressBytesToStringResponse") proto.RegisterType((*AddressStringToBytesRequest)(nil), "cosmos.auth.v1beta1.AddressStringToBytesRequest") proto.RegisterType((*AddressStringToBytesResponse)(nil), "cosmos.auth.v1beta1.AddressStringToBytesResponse") - proto.RegisterType((*QueryAccountByIdRequest)(nil), "cosmos.auth.v1beta1.QueryAccountByIdRequest") - proto.RegisterType((*QueryAccountByIdResponse)(nil), "cosmos.auth.v1beta1.QueryAccountByIdResponse") + proto.RegisterType((*QueryAccountAddressByIdRequest)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest") + proto.RegisterType((*QueryAccountAddressByIdResponse)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse") } func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } var fileDescriptor_c451370b3929a27c = []byte{ - // 873 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x4f, 0x3b, 0x55, - 0x14, 0xc6, 0x3b, 0x15, 0x79, 0xb9, 0x14, 0x16, 0x97, 0x12, 0xeb, 0x14, 0x5a, 0x32, 0x08, 0xb4, - 0x48, 0x67, 0xa4, 0xb8, 0xf1, 0x25, 0x26, 0x0c, 0xa8, 0x61, 0x61, 0x52, 0x07, 0x16, 0xc6, 0x85, - 0xcd, 0x4c, 0x67, 0x18, 0x26, 0xd2, 0xb9, 0xa5, 0x77, 0x6a, 0x68, 0x48, 0x13, 0xe3, 0x8a, 0x9d, - 0x26, 0x2e, 0xdd, 0xe0, 0x37, 0xd0, 0x84, 0x0f, 0x41, 0x58, 0x11, 0xdd, 0x98, 0x98, 0x18, 0x03, - 0x2e, 0xfc, 0x18, 0xa6, 0xf7, 0x9e, 0x69, 0x67, 0xf0, 0xb6, 0x1d, 0x92, 0xff, 0x8a, 0xce, 0x3d, - 0xe7, 0x3c, 0xe7, 0x77, 0xcf, 0xb9, 0x3c, 0xa8, 0xd8, 0x20, 0xb4, 0x49, 0xa8, 0x66, 0x76, 0x82, - 0x33, 0xed, 0x9b, 0x5d, 0xcb, 0x09, 0xcc, 0x5d, 0xed, 0xa2, 0xe3, 0xb4, 0xbb, 0x6a, 0xab, 0x4d, - 0x02, 0x82, 0x97, 0x78, 0x82, 0xda, 0x4f, 0x50, 0x21, 0x41, 0xde, 0x86, 0x2a, 0xcb, 0xa4, 0x0e, - 0xcf, 0x1e, 0xd4, 0xb6, 0x4c, 0xd7, 0xf3, 0xcd, 0xc0, 0x23, 0x3e, 0x17, 0x90, 0xb3, 0x2e, 0x71, - 0x09, 0xfb, 0xa9, 0xf5, 0x7f, 0xc1, 0xe9, 0x9b, 0x2e, 0x21, 0xee, 0xb9, 0xa3, 0xb1, 0x2f, 0xab, - 0x73, 0xaa, 0x99, 0x3e, 0x74, 0x94, 0x57, 0x20, 0x64, 0xb6, 0x3c, 0xcd, 0xf4, 0x7d, 0x12, 0x30, - 0x35, 0x0a, 0xd1, 0x82, 0x08, 0x98, 0xc1, 0x81, 0x30, 0x8f, 0xd7, 0x79, 0x47, 0x80, 0x67, 0x1f, - 0xca, 0x57, 0x28, 0xfb, 0x79, 0x9f, 0x75, 0xbf, 0xd1, 0x20, 0x1d, 0x3f, 0xa0, 0x86, 0x73, 0xd1, - 0x71, 0x68, 0x80, 0x3f, 0x41, 0x68, 0x48, 0x9d, 0x93, 0xd6, 0xa4, 0xd2, 0x7c, 0x75, 0x53, 0x85, - 0xd2, 0xfe, 0x15, 0x55, 0x3e, 0x10, 0xe8, 0xa6, 0xd6, 0x4c, 0xd7, 0x81, 0x5a, 0x23, 0x52, 0xa9, - 0xdc, 0x48, 0x68, 0xf9, 0x59, 0x03, 0xda, 0x22, 0x3e, 0x75, 0xf0, 0x47, 0x68, 0xd6, 0x84, 0xb3, - 0x9c, 0xb4, 0xf6, 0x5a, 0x69, 0xbe, 0x9a, 0x55, 0xf9, 0x2d, 0xd5, 0x70, 0x00, 0xea, 0xbe, 0xdf, - 0xd5, 0x33, 0xf7, 0xb7, 0x95, 0x59, 0xa8, 0x3e, 0x32, 0x06, 0x35, 0xf8, 0xd3, 0x18, 0x61, 0x9a, - 0x11, 0x6e, 0x4d, 0x24, 0xe4, 0xcd, 0x63, 0x88, 0xc7, 0x68, 0x29, 0x4a, 0x18, 0x4e, 0xa0, 0x8a, - 0x66, 0x4c, 0xdb, 0x6e, 0x3b, 0x94, 0xb2, 0xeb, 0xcf, 0xe9, 0xb9, 0xdf, 0x6e, 0x2b, 0x59, 0xd0, - 0xdf, 0xe7, 0x91, 0xe3, 0xa0, 0xed, 0xf9, 0xae, 0x11, 0x26, 0xbe, 0x3f, 0x7b, 0x7d, 0x53, 0x4c, - 0xfd, 0x7b, 0x53, 0x4c, 0x29, 0x2b, 0x48, 0x66, 0xa2, 0x9f, 0x11, 0xbb, 0x73, 0xee, 0x3c, 0x9b, - 0xae, 0x52, 0x83, 0x96, 0x35, 0xb3, 0x6d, 0x36, 0x87, 0x23, 0x79, 0x0f, 0x4d, 0xb7, 0xd8, 0x09, - 0x0c, 0x3c, 0xaf, 0x0a, 0x1e, 0x9a, 0xca, 0x8b, 0xf4, 0xa9, 0xbb, 0xbf, 0x8a, 0x29, 0x03, 0x0a, - 0x94, 0x93, 0xf8, 0x1e, 0x07, 0x92, 0x1f, 0xa2, 0x19, 0x98, 0x18, 0x68, 0x26, 0x19, 0x72, 0x58, - 0xa2, 0x64, 0x11, 0x8e, 0x71, 0x72, 0xfa, 0x06, 0xca, 0x0b, 0xef, 0x06, 0x2d, 0x0f, 0x13, 0x2e, - 0x16, 0xdf, 0xdf, 0x56, 0x16, 0x63, 0x1a, 0x91, 0xf5, 0x2a, 0xcb, 0x68, 0x49, 0x77, 0x1a, 0x67, - 0x7b, 0xd5, 0x5a, 0xdb, 0x39, 0xf5, 0x2e, 0xc3, 0xde, 0x1f, 0xa0, 0x6c, 0xfc, 0x18, 0x9a, 0xae, - 0xa3, 0x05, 0x8b, 0x9d, 0xd7, 0x5b, 0x2c, 0xc0, 0x77, 0x66, 0x64, 0xac, 0x48, 0xb2, 0xa2, 0xa3, - 0x3c, 0x2c, 0x4e, 0xef, 0x06, 0x0e, 0x3d, 0x21, 0xb0, 0x3f, 0xd8, 0xf8, 0x3a, 0x5a, 0x80, 0x45, - 0xd6, 0xad, 0x7e, 0x9c, 0x69, 0x64, 0x8c, 0x8c, 0x19, 0xa9, 0x51, 0x3e, 0x46, 0x2b, 0x62, 0x0d, - 0x00, 0xd9, 0x40, 0x8b, 0xa1, 0x08, 0x65, 0x11, 0x20, 0x09, 0xa5, 0x79, 0xba, 0x72, 0x38, 0x40, - 0xe1, 0x07, 0x27, 0x84, 0xc9, 0x85, 0x28, 0x09, 0x55, 0x0e, 0x06, 0x30, 0xcf, 0x54, 0x86, 0x53, - 0x99, 0x7c, 0xa3, 0x32, 0x7a, 0x23, 0xfa, 0x74, 0xf4, 0xee, 0x91, 0x1d, 0x62, 0x2c, 0xa2, 0xb4, - 0x67, 0xb3, 0xa2, 0x29, 0x23, 0xed, 0xd9, 0xca, 0x17, 0x28, 0xf7, 0xff, 0xd4, 0x57, 0xf1, 0xd2, - 0xaa, 0x7f, 0xce, 0xa1, 0xd7, 0x99, 0x34, 0xbe, 0x96, 0x50, 0x18, 0xa7, 0xb8, 0x2c, 0xfc, 0x0f, - 0x10, 0x39, 0x96, 0xbc, 0x9d, 0x24, 0x95, 0xb3, 0x2a, 0x1b, 0xdf, 0xfd, 0xfe, 0xcf, 0x8f, 0xe9, - 0x22, 0x5e, 0xd5, 0x84, 0xce, 0x19, 0x76, 0xff, 0x5e, 0x42, 0x33, 0x50, 0x8b, 0x4b, 0x13, 0xe5, - 0x43, 0x90, 0x72, 0x82, 0x4c, 0xe0, 0xd0, 0x18, 0x47, 0x19, 0x6f, 0x8d, 0xe5, 0xd0, 0xae, 0x60, - 0x5f, 0x3d, 0xfc, 0x93, 0x84, 0xe6, 0x23, 0xc3, 0xc7, 0x3b, 0x13, 0x7b, 0x45, 0xd6, 0x29, 0x57, - 0x12, 0x66, 0xbf, 0x84, 0xae, 0x6e, 0x75, 0xeb, 0x9e, 0xad, 0x5d, 0x79, 0x76, 0x0f, 0x7f, 0x2b, - 0xa1, 0x69, 0x6e, 0x15, 0x78, 0x6b, 0x74, 0xab, 0x98, 0x99, 0xc8, 0xa5, 0xc9, 0x89, 0x80, 0xb3, - 0xce, 0x70, 0x56, 0x71, 0x5e, 0x88, 0xc3, 0x7d, 0x10, 0xff, 0x2c, 0xa1, 0xb8, 0xa7, 0x50, 0xac, - 0x8d, 0xee, 0x20, 0x74, 0x67, 0xf9, 0x9d, 0xe4, 0x05, 0x80, 0xb6, 0xc3, 0xd0, 0x36, 0xf1, 0x5b, - 0x42, 0xb4, 0x26, 0x2b, 0xaa, 0x0f, 0x9e, 0xd5, 0xb5, 0x84, 0x32, 0x51, 0x13, 0x1b, 0xf1, 0xb6, - 0x04, 0xf6, 0x37, 0xe2, 0x6d, 0x89, 0x1c, 0x71, 0xc2, 0xb8, 0xb8, 0x2f, 0xe2, 0x5f, 0x24, 0x94, - 0x15, 0xd9, 0x19, 0x16, 0xcf, 0x60, 0x8c, 0x7b, 0xca, 0xbb, 0x2f, 0xa8, 0x00, 0xc4, 0x3d, 0x86, - 0x58, 0xc1, 0x6f, 0x8f, 0x41, 0x1c, 0x3c, 0x7e, 0xee, 0x60, 0x3d, 0xfc, 0xeb, 0x10, 0x39, 0x66, - 0x7a, 0xe3, 0x91, 0x45, 0x2e, 0x3b, 0x1e, 0x59, 0xe8, 0xa8, 0xca, 0xbb, 0x0c, 0x59, 0xc5, 0x3b, - 0x89, 0x90, 0xb9, 0x77, 0xf7, 0xf4, 0x83, 0xbb, 0xc7, 0x82, 0xf4, 0xf0, 0x58, 0x90, 0xfe, 0x7e, - 0x2c, 0x48, 0x3f, 0x3c, 0x15, 0x52, 0x0f, 0x4f, 0x85, 0xd4, 0x1f, 0x4f, 0x85, 0xd4, 0x97, 0x65, - 0xd7, 0x0b, 0xce, 0x3a, 0x96, 0xda, 0x20, 0xcd, 0x50, 0x91, 0xff, 0xa9, 0x50, 0xfb, 0x6b, 0xed, - 0x92, 0xcb, 0x07, 0xdd, 0x96, 0x43, 0xad, 0x69, 0xe6, 0xa3, 0x7b, 0xff, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x45, 0x90, 0x67, 0x2a, 0x9f, 0x0a, 0x00, 0x00, + // 885 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xcf, 0x4e, 0xeb, 0x46, + 0x14, 0xc6, 0xe3, 0xdc, 0x16, 0xb8, 0x73, 0x73, 0x53, 0x69, 0xc8, 0x95, 0xa8, 0xc3, 0x75, 0xae, + 0x4c, 0x81, 0x84, 0x12, 0x1b, 0x12, 0x36, 0xfd, 0xa3, 0x4a, 0x09, 0xb4, 0x15, 0x8b, 0x4a, 0xa9, + 0x61, 0xd5, 0x45, 0x23, 0x3b, 0x36, 0xc6, 0x2a, 0xf1, 0x84, 0x8c, 0x53, 0x11, 0xa1, 0x48, 0x55, + 0x57, 0xec, 0x5a, 0xa9, 0x2f, 0x40, 0xdf, 0xa0, 0x95, 0x78, 0x08, 0xc4, 0x0a, 0xb5, 0x9b, 0xae, + 0xaa, 0x0a, 0xba, 0xe8, 0xb2, 0x8f, 0x70, 0x95, 0x99, 0x63, 0x27, 0x86, 0x49, 0x62, 0x56, 0xb1, + 0x67, 0xce, 0xf9, 0xce, 0x6f, 0xce, 0x19, 0x7f, 0x41, 0x85, 0x16, 0xa1, 0x6d, 0x42, 0x75, 0xb3, + 0x17, 0x1c, 0xeb, 0xdf, 0x6f, 0x5b, 0x4e, 0x60, 0x6e, 0xeb, 0xa7, 0x3d, 0xa7, 0xdb, 0xd7, 0x3a, + 0x5d, 0x12, 0x10, 0xbc, 0xc8, 0x03, 0xb4, 0x61, 0x80, 0x06, 0x01, 0xf2, 0x06, 0x64, 0x59, 0x26, + 0x75, 0x78, 0x74, 0x94, 0xdb, 0x31, 0x5d, 0xcf, 0x37, 0x03, 0x8f, 0xf8, 0x5c, 0x40, 0xce, 0xb9, + 0xc4, 0x25, 0xec, 0x51, 0x1f, 0x3e, 0xc1, 0xea, 0xfb, 0x2e, 0x21, 0xee, 0x89, 0xa3, 0xb3, 0x37, + 0xab, 0x77, 0xa4, 0x9b, 0x3e, 0x54, 0x94, 0x97, 0x61, 0xcb, 0xec, 0x78, 0xba, 0xe9, 0xfb, 0x24, + 0x60, 0x6a, 0x14, 0x76, 0x15, 0x11, 0x30, 0x83, 0x03, 0x61, 0xbe, 0xdf, 0xe4, 0x15, 0x01, 0x9e, + 0xbd, 0xa8, 0xdf, 0xa2, 0xdc, 0xd7, 0x43, 0xd6, 0x5a, 0xab, 0x45, 0x7a, 0x7e, 0x40, 0x0d, 0xe7, + 0xb4, 0xe7, 0xd0, 0x00, 0x7f, 0x81, 0xd0, 0x88, 0x7a, 0x49, 0x7a, 0x23, 0x15, 0x5f, 0x54, 0xd6, + 0x34, 0x48, 0x1d, 0x1e, 0x51, 0xe3, 0x0d, 0x81, 0x6a, 0x5a, 0xc3, 0x74, 0x1d, 0xc8, 0x35, 0xc6, + 0x32, 0xd5, 0x4b, 0x09, 0xbd, 0x7a, 0x50, 0x80, 0x76, 0x88, 0x4f, 0x1d, 0xfc, 0x19, 0x5a, 0x30, + 0x61, 0x6d, 0x49, 0x7a, 0xf3, 0xac, 0xf8, 0xa2, 0x92, 0xd3, 0xf8, 0x29, 0xb5, 0xb0, 0x01, 0x5a, + 0xcd, 0xef, 0xd7, 0x33, 0x37, 0x57, 0xe5, 0x05, 0xc8, 0xde, 0x37, 0xa2, 0x1c, 0xfc, 0x65, 0x8c, + 0x30, 0xcd, 0x08, 0xd7, 0x67, 0x12, 0xf2, 0xe2, 0x31, 0xc4, 0x03, 0xb4, 0x38, 0x4e, 0x18, 0x76, + 0xa0, 0x82, 0xe6, 0x4d, 0xdb, 0xee, 0x3a, 0x94, 0xb2, 0xe3, 0x3f, 0xaf, 0x2f, 0xfd, 0x71, 0x55, + 0xce, 0x81, 0x7e, 0x8d, 0xef, 0x1c, 0x04, 0x5d, 0xcf, 0x77, 0x8d, 0x30, 0xf0, 0xe3, 0x85, 0x8b, + 0xcb, 0x42, 0xea, 0xbf, 0xcb, 0x42, 0x4a, 0x5d, 0x46, 0x32, 0x13, 0xfd, 0x8a, 0xd8, 0xbd, 0x13, + 0xe7, 0x41, 0x77, 0xd5, 0x06, 0x94, 0x6c, 0x98, 0x5d, 0xb3, 0x3d, 0x6a, 0xc9, 0x47, 0x68, 0xae, + 0xc3, 0x56, 0xa0, 0xe1, 0x79, 0x4d, 0x70, 0xd1, 0x34, 0x9e, 0x54, 0x7f, 0xe7, 0xfa, 0xef, 0x42, + 0xca, 0x80, 0x04, 0xf5, 0x30, 0x3e, 0xc7, 0x48, 0xf2, 0x53, 0x34, 0x0f, 0x1d, 0x03, 0xcd, 0x24, + 0x4d, 0x0e, 0x53, 0xd4, 0x1c, 0xc2, 0x31, 0x4e, 0x4e, 0xdf, 0x42, 0x79, 0xe1, 0xd9, 0xa0, 0xe4, + 0x5e, 0xc2, 0xc1, 0xe2, 0x9b, 0xab, 0x72, 0x36, 0xa6, 0x31, 0x36, 0x5e, 0xf5, 0x15, 0x5a, 0xac, + 0x3b, 0xad, 0xe3, 0x6a, 0xa5, 0xd1, 0x75, 0x8e, 0xbc, 0xb3, 0xb0, 0xf6, 0x27, 0x28, 0x17, 0x5f, + 0x86, 0xa2, 0x2b, 0xe8, 0xa5, 0xc5, 0xd6, 0x9b, 0x1d, 0xb6, 0xc1, 0x67, 0x66, 0x64, 0xac, 0xb1, + 0x60, 0xb5, 0x8e, 0xf2, 0x30, 0xb8, 0x7a, 0x3f, 0x70, 0xe8, 0x21, 0x81, 0xf9, 0xc1, 0xc4, 0x57, + 0xd0, 0x4b, 0x18, 0x64, 0xd3, 0x1a, 0xee, 0x33, 0x8d, 0x8c, 0x91, 0x31, 0xc7, 0x72, 0xd4, 0xcf, + 0xd1, 0xb2, 0x58, 0x03, 0x40, 0x56, 0x51, 0x36, 0x14, 0xa1, 0x6c, 0x07, 0x48, 0x42, 0x69, 0x1e, + 0xae, 0xee, 0x45, 0x28, 0x7c, 0xe1, 0x90, 0x30, 0xb9, 0x10, 0x25, 0xa1, 0xca, 0x6e, 0x04, 0xf3, + 0x40, 0x65, 0xd4, 0x95, 0xd9, 0x27, 0xda, 0x42, 0xca, 0xf8, 0xd5, 0x89, 0x4e, 0xb7, 0x6f, 0x87, + 0x34, 0x59, 0x94, 0xf6, 0x6c, 0x96, 0xfb, 0xcc, 0x48, 0x7b, 0xb6, 0x6a, 0xa3, 0xc2, 0xc4, 0x0c, + 0xa8, 0x5c, 0x43, 0xef, 0xc1, 0x28, 0x9b, 0x49, 0xbf, 0xa2, 0xac, 0x19, 0x93, 0xab, 0xfc, 0xff, + 0x1c, 0xbd, 0xcb, 0xca, 0xe0, 0x0b, 0x09, 0x85, 0x97, 0x93, 0xe2, 0x92, 0xf0, 0xa3, 0x10, 0x99, + 0x98, 0xbc, 0x91, 0x24, 0x94, 0x03, 0xab, 0xab, 0x3f, 0xfe, 0xf9, 0xef, 0x2f, 0xe9, 0x02, 0x7e, + 0xad, 0x0b, 0xcd, 0x34, 0xac, 0xfe, 0x93, 0x84, 0xe6, 0x21, 0x17, 0x17, 0x67, 0xca, 0x87, 0x20, + 0xa5, 0x04, 0x91, 0xc0, 0xa1, 0x33, 0x8e, 0x12, 0x5e, 0x9f, 0xca, 0xa1, 0x9f, 0x43, 0x57, 0x07, + 0xf8, 0x37, 0x09, 0xe1, 0xc7, 0x83, 0xc0, 0xd5, 0x99, 0x25, 0x1f, 0x0f, 0x5a, 0xde, 0x79, 0x5a, + 0x52, 0x32, 0xe4, 0xe8, 0x02, 0x36, 0x3d, 0x5b, 0x3f, 0xf7, 0xec, 0x01, 0xfe, 0x41, 0x42, 0x73, + 0xdc, 0x52, 0xf0, 0xfa, 0xe4, 0x8a, 0x31, 0xd3, 0x91, 0x8b, 0xb3, 0x03, 0x01, 0x67, 0x85, 0xe1, + 0xbc, 0xc6, 0x79, 0x21, 0x0e, 0xf7, 0x4b, 0xfc, 0xab, 0x84, 0xe2, 0xde, 0x43, 0xb1, 0x3e, 0xb9, + 0x82, 0xd0, 0xc5, 0xe5, 0xad, 0xe4, 0x09, 0x80, 0xb6, 0xc9, 0xd0, 0xd6, 0xf0, 0x07, 0x42, 0xb4, + 0x36, 0x4b, 0x6a, 0x46, 0x77, 0xed, 0x42, 0x42, 0x99, 0x71, 0xb3, 0x9b, 0x70, 0xe1, 0x04, 0x36, + 0x39, 0xe1, 0xc2, 0x89, 0x9c, 0x73, 0x46, 0xbb, 0xb8, 0x7f, 0x0e, 0x2f, 0x59, 0x4e, 0x64, 0x7b, + 0x58, 0xdc, 0x83, 0x29, 0x2e, 0x2b, 0x6f, 0x3f, 0x21, 0x03, 0x10, 0xab, 0x0c, 0xb1, 0x8c, 0x3f, + 0x9c, 0x82, 0x18, 0x7d, 0x11, 0xdc, 0xe9, 0x06, 0xf8, 0xf7, 0x11, 0x72, 0xcc, 0x1c, 0xa7, 0x23, + 0x8b, 0xdc, 0x78, 0x3a, 0xb2, 0xd0, 0x79, 0xd5, 0x1d, 0x86, 0xac, 0xe1, 0xcd, 0x44, 0xc8, 0xdc, + 0xe3, 0x07, 0xf5, 0xdd, 0xeb, 0x3b, 0x45, 0xba, 0xbd, 0x53, 0xa4, 0x7f, 0xee, 0x14, 0xe9, 0xe7, + 0x7b, 0x25, 0x75, 0x7b, 0xaf, 0xa4, 0xfe, 0xba, 0x57, 0x52, 0xdf, 0x94, 0x5c, 0x2f, 0x38, 0xee, + 0x59, 0x5a, 0x8b, 0xb4, 0x43, 0x45, 0xfe, 0x53, 0xa6, 0xf6, 0x77, 0xfa, 0x19, 0x97, 0x0f, 0xfa, + 0x1d, 0x87, 0x5a, 0x73, 0xec, 0x5f, 0xb6, 0xfa, 0x36, 0x00, 0x00, 0xff, 0xff, 0x44, 0x50, 0x73, + 0xdf, 0xc7, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -854,8 +855,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // AccountById returns account details based on account id - AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) + // AccountAddressById returns account address based on account id + AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -902,9 +903,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } -func (c *queryClient) AccountById(ctx context.Context, in *QueryAccountByIdRequest, opts ...grpc.CallOption) (*QueryAccountByIdResponse, error) { - out := new(QueryAccountByIdResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountById", in, out, opts...) +func (c *queryClient) AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) { + out := new(QueryAccountAddressByIdResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressById", in, out, opts...) if err != nil { return nil, err } @@ -964,8 +965,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // AccountById returns account details based on account id - AccountById(context.Context, *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) + // AccountAddressById returns account address based on account id + AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -996,8 +997,8 @@ func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccount func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } -func (*UnimplementedQueryServer) AccountById(ctx context.Context, req *QueryAccountByIdRequest) (*QueryAccountByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountById not implemented") +func (*UnimplementedQueryServer) AccountAddressById(ctx context.Context, req *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountAddressById not implemented") } func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -1055,20 +1056,20 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_AccountById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountByIdRequest) +func _Query_AccountAddressById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountAddressByIdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AccountById(ctx, in) + return srv.(QueryServer).AccountAddressById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountById", + FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressById", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountById(ctx, req.(*QueryAccountByIdRequest)) + return srv.(QueryServer).AccountAddressById(ctx, req.(*QueryAccountAddressByIdRequest)) } return interceptor(ctx, in, info, handler) } @@ -1176,8 +1177,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Account_Handler, }, { - MethodName: "AccountById", - Handler: _Query_AccountById_Handler, + MethodName: "AccountAddressById", + Handler: _Query_AccountAddressById_Handler, }, { MethodName: "Params", @@ -1642,7 +1643,7 @@ func (m *AddressStringToBytesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryAccountByIdRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountAddressByIdRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1652,12 +1653,12 @@ func (m *QueryAccountByIdRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAccountByIdRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIdRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAccountByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1670,7 +1671,7 @@ func (m *QueryAccountByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryAccountByIdResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountAddressByIdResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1680,25 +1681,20 @@ func (m *QueryAccountByIdResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAccountByIdResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIdResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAccountByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Account != nil { - { - size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if len(m.AccountAddress) > 0 { + i -= len(m.AccountAddress) + copy(dAtA[i:], m.AccountAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountAddress))) i-- dAtA[i] = 0xa } @@ -1892,7 +1888,7 @@ func (m *AddressStringToBytesResponse) Size() (n int) { return n } -func (m *QueryAccountByIdRequest) Size() (n int) { +func (m *QueryAccountAddressByIdRequest) Size() (n int) { if m == nil { return 0 } @@ -1904,14 +1900,14 @@ func (m *QueryAccountByIdRequest) Size() (n int) { return n } -func (m *QueryAccountByIdResponse) Size() (n int) { +func (m *QueryAccountAddressByIdResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Account != nil { - l = m.Account.Size() + l = len(m.AccountAddress) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n @@ -3028,7 +3024,7 @@ func (m *AddressStringToBytesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAccountByIdRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAccountAddressByIdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3051,10 +3047,10 @@ func (m *QueryAccountByIdRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAccountByIdRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountAddressByIdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountAddressByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3071,7 +3067,7 @@ func (m *QueryAccountByIdRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + m.Id |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -3097,7 +3093,7 @@ func (m *QueryAccountByIdRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAccountByIdResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAccountAddressByIdResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3120,17 +3116,17 @@ func (m *QueryAccountByIdResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAccountByIdResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountAddressByIdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountAddressByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3140,27 +3136,23 @@ func (m *QueryAccountByIdResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Account == nil { - m.Account = &types.Any{} - } - if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AccountAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/auth/types/query.pb.gw.go b/x/auth/types/query.pb.gw.go index 021a0c14fd81..7d0d08f956ba 100644 --- a/x/auth/types/query.pb.gw.go +++ b/x/auth/types/query.pb.gw.go @@ -123,8 +123,8 @@ func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marsha } -func request_Query_AccountById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountByIdRequest +func request_Query_AccountAddressById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIdRequest var metadata runtime.ServerMetadata var ( @@ -139,19 +139,19 @@ func request_Query_AccountById_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) + protoReq.Id, err = runtime.Int64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.AccountById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.AccountAddressById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_AccountById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountByIdRequest +func local_request_Query_AccountAddressById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIdRequest var metadata runtime.ServerMetadata var ( @@ -166,13 +166,13 @@ func local_request_Query_AccountById_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) + protoReq.Id, err = runtime.Int64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.AccountById(ctx, &protoReq) + msg, err := server.AccountAddressById(ctx, &protoReq) return msg, metadata, err } @@ -391,7 +391,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AccountById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AccountAddressById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -402,7 +402,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_AccountById_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_AccountAddressById_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -410,7 +410,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AccountById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AccountAddressById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -610,7 +610,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AccountById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AccountAddressById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -619,14 +619,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AccountById_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_AccountAddressById_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_AccountById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AccountAddressById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -738,7 +738,7 @@ var ( pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AccountById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "account_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AccountAddressById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "address_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) @@ -756,7 +756,7 @@ var ( forward_Query_Account_0 = runtime.ForwardResponseMessage - forward_Query_AccountById_0 = runtime.ForwardResponseMessage + forward_Query_AccountAddressById_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage From cd0123239b9840a0fc7fd5ec6ca771e277c0dd1f Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 11:31:52 +0530 Subject: [PATCH 03/19] test: add test cases for acc-addr by id --- x/auth/client/testutil/cli_test.go | 3 -- x/auth/client/testutil/suite.go | 45 +++++++++++++++++++++ x/auth/keeper/grpc_query_test.go | 63 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 3 deletions(-) diff --git a/x/auth/client/testutil/cli_test.go b/x/auth/client/testutil/cli_test.go index f23e88847c30..af7b3cf127fe 100644 --- a/x/auth/client/testutil/cli_test.go +++ b/x/auth/client/testutil/cli_test.go @@ -1,6 +1,3 @@ -//go:build norace -// +build norace - package testutil import ( diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 90a02685d8a2..9c894a64e0d7 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -30,6 +30,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli" bankcli "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" @@ -281,6 +282,50 @@ func (s *IntegrationTestSuite) TestCLISignBatch() { s.Require().Error(err) } +func (s *IntegrationTestSuite) TestCliGetAccountAddressById() { + require := s.Require() + val1 := s.network.Validators[0] + testCases := []struct { + name string + args []string + expectErr bool + }{ + { + "not enough args", + []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, + true, + }, + { + "invalid account id", + []string{fmt.Sprint(-1), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, + true, + }, + { + "success account id", + []string{fmt.Sprint(0), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, + false, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + cmd := authcli.GetAccountAddressByIdCmd() + clientCtx := val1.ClientCtx + + queryResJSON, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + var res types.QueryAccountAddressByIdResponse + require.NoError(val1.ClientCtx.Codec.UnmarshalJSON(queryResJSON.Bytes(), &res)) + require.NotNil(res.GetAccountAddress()) + } + }) + } +} + func (s *IntegrationTestSuite) TestCLISignAminoJSON() { require := s.Require() val1 := s.network.Validators[0] diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index 307fda03356f..879412902312 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "math" "sort" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -153,6 +154,68 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() { } } +func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressById() { + var req *types.QueryAccountAddressByIdRequest + _, _, addr := testdata.KeyTestPubAddr() + + testCases := []struct { + msg string + malleate func() + expPass bool + posttests func(res *types.QueryAccountAddressByIdResponse) + }{ + { + "invalid request", + func() { + req = &types.QueryAccountAddressByIdRequest{Id: -1} + }, + false, + func(res *types.QueryAccountAddressByIdResponse) {}, + }, + { + "account address not found", + func() { + req = &types.QueryAccountAddressByIdRequest{Id: math.MaxInt64} + }, + false, + func(res *types.QueryAccountAddressByIdResponse) {}, + }, + { + "success", + func() { + account := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr) + suite.app.AccountKeeper.SetAccount(suite.ctx, account) + req = &types.QueryAccountAddressByIdRequest{Id: int64(account.GetAccountNumber())} + }, + true, + func(res *types.QueryAccountAddressByIdResponse) { + suite.Require().NotNil(res.AccountAddress) + }, + }, + } + + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := sdk.WrapSDKContext(suite.ctx) + + res, err := suite.queryClient.AccountAddressById(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + } else { + suite.Require().Error(err) + suite.Require().Nil(res) + } + + tc.posttests(res) + }) + } +} + func (suite *KeeperTestSuite) TestGRPCQueryParameters() { var ( req *types.QueryParamsRequest From 96d3cef9487e58b6e6da5291aec851da5dd0a01f Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 13:22:19 +0530 Subject: [PATCH 04/19] add migration for map accAddr to accNum --- x/auth/keeper/migrations.go | 6 ++++++ x/auth/migrations/v046/store.go | 32 ++++++++++++++++++++++++++++ x/auth/migrations/v046/store_test.go | 1 + x/auth/module.go | 5 +++++ 4 files changed, 44 insertions(+) create mode 100644 x/auth/migrations/v046/store.go create mode 100644 x/auth/migrations/v046/store_test.go diff --git a/x/auth/keeper/migrations.go b/x/auth/keeper/migrations.go index 4cbc3694d181..3aa09901995b 100644 --- a/x/auth/keeper/migrations.go +++ b/x/auth/keeper/migrations.go @@ -4,6 +4,8 @@ import ( "github.com/gogo/protobuf/grpc" v043 "github.com/cosmos/cosmos-sdk/x/auth/migrations/v043" + v046 "github.com/cosmos/cosmos-sdk/x/auth/migrations/v046" + "github.com/cosmos/cosmos-sdk/x/auth/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -41,3 +43,7 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { return iterErr } + +func (m Migrator) MapAccAddrsToAccNum(ctx sdk.Context) error { + return v046.MigrateStore(ctx, m.keeper.key, m.keeper.cdc) +} diff --git a/x/auth/migrations/v046/store.go b/x/auth/migrations/v046/store.go new file mode 100644 index 000000000000..d3c5e02f9bb2 --- /dev/null +++ b/x/auth/migrations/v046/store.go @@ -0,0 +1,32 @@ +package v046 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/internal/conv" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +func mapAccountAddressToAccountId(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.AddressStoreKeyPrefix) + + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var acc types.AccountI + if err := cdc.UnmarshalInterface(iterator.Value(), &acc); err != nil { + return err + } + store.Set(types.AccountNumberStoreKey(int64(acc.GetAccountNumber())), conv.UnsafeStrToBytes(acc.GetAddress().String())) + } + + return nil +} + +// MigrateStore performs in-place store migrations from v0.45 to v0.46. The +// migration includes: +// - Add an Account number as an index to get the account address +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { + return mapAccountAddressToAccountId(ctx, storeKey, cdc) +} diff --git a/x/auth/migrations/v046/store_test.go b/x/auth/migrations/v046/store_test.go new file mode 100644 index 000000000000..a5be02bb97cc --- /dev/null +++ b/x/auth/migrations/v046/store_test.go @@ -0,0 +1 @@ +package v046_test diff --git a/x/auth/module.go b/x/auth/module.go index feec8ccaccea..648189f31198 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -137,6 +137,11 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err != nil { panic(err) } + + err = cfg.RegisterMigration(types.ModuleName, 2, m.MapAccAddrsToAccNum) + if err != nil { + panic(err) + } } // InitGenesis performs genesis initialization for the auth module. It returns From 905caf60eac2db583fa2e5609fa78478142c508c Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 16:32:43 +0530 Subject: [PATCH 05/19] refactor: increase the consensus version for auth migration --- x/auth/module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/module.go b/x/auth/module.go index 648189f31198..617cb00ace19 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -161,7 +161,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock returns the begin blocker for the auth module. func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} From aa7ff0b88b8eb4290d5b75ea58fede6a30205b94 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 16:42:11 +0530 Subject: [PATCH 06/19] chroe: address the pr comments --- x/auth/client/cli/query.go | 6 +----- x/auth/client/testutil/cli_test.go | 3 +++ x/auth/client/testutil/suite.go | 2 +- x/auth/keeper/grpc_query.go | 4 ++-- x/auth/keeper/grpc_query_test.go | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 8e4af58eee76..cdfe8f213cbb 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -126,7 +126,7 @@ func GetAccountCmd() *cobra.Command { return cmd } -// GetAccountAddressByIdCmd returns a query account address that will display the address of given account id. +// GetAccountAddressByIdCmd returns a query account address that will display the account address of a given account id. func GetAccountAddressByIdCmd() *cobra.Command { cmd := &cobra.Command{ Use: "address-by-id [id]", @@ -135,10 +135,6 @@ func GetAccountAddressByIdCmd() *cobra.Command { Example: fmt.Sprintf( "%s q auth address-by-id 1", version.AppName, ), - Long: strings.TrimSpace(`Query the account by id: - -$ query auth address-by-id [id] -`), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { diff --git a/x/auth/client/testutil/cli_test.go b/x/auth/client/testutil/cli_test.go index af7b3cf127fe..f23e88847c30 100644 --- a/x/auth/client/testutil/cli_test.go +++ b/x/auth/client/testutil/cli_test.go @@ -1,3 +1,6 @@ +//go:build norace +// +build norace + package testutil import ( diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 9c894a64e0d7..4011a0a255af 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -301,7 +301,7 @@ func (s *IntegrationTestSuite) TestCliGetAccountAddressById() { true, }, { - "success account id", + "valid account id", []string{fmt.Sprint(0), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, false, }, diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 5aa9a301d57f..7cd583d8fb3d 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -25,13 +25,13 @@ func (ak AccountKeeper) AccountAddressById(c context.Context, req *types.QueryAc } if req.Id < 0 { - return nil, status.Error(codes.InvalidArgument, "Account Id cannot be empty") + return nil, status.Error(codes.InvalidArgument, "Invalid account id") } ctx := sdk.UnwrapSDKContext(c) address := ak.GetAccountAddressById(ctx, req.GetId()) if len(address) == 0 { - return nil, status.Errorf(codes.NotFound, "account is not found with id %d", req.Id) + return nil, status.Errorf(codes.NotFound, "account address not found with id %d", req.Id) } return &types.QueryAccountAddressByIdResponse{AccountAddress: address}, nil diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index 879412902312..27365a9a53f7 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -181,7 +181,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressById() { func(res *types.QueryAccountAddressByIdResponse) {}, }, { - "success", + "valid request", func() { account := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr) suite.app.AccountKeeper.SetAccount(suite.ctx, account) From 120608e30c158658576c1acb2a2014ed972be581 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 9 Jun 2022 22:06:34 +0530 Subject: [PATCH 07/19] chore: address the pr comments --- api/cosmos/auth/v1beta1/query.pulsar.go | 315 +++++++++++------------ api/cosmos/auth/v1beta1/query_grpc.pb.go | 32 +-- proto/cosmos/auth/v1beta1/query.proto | 13 +- x/auth/client/cli/query.go | 18 +- x/auth/client/testutil/suite.go | 6 +- x/auth/keeper/account.go | 2 +- x/auth/keeper/grpc_query.go | 6 +- x/auth/keeper/grpc_query_test.go | 20 +- x/auth/types/keys.go | 4 +- x/auth/types/query.pb.go | 175 +++++++------ x/auth/types/query.pb.gw.go | 28 +- 11 files changed, 306 insertions(+), 313 deletions(-) diff --git a/api/cosmos/auth/v1beta1/query.pulsar.go b/api/cosmos/auth/v1beta1/query.pulsar.go index 1d28b5013c93..a8c80520a731 100644 --- a/api/cosmos/auth/v1beta1/query.pulsar.go +++ b/api/cosmos/auth/v1beta1/query.pulsar.go @@ -5982,25 +5982,25 @@ func (x *fastReflection_AddressStringToBytesResponse) ProtoMethods() *protoiface } var ( - md_QueryAccountAddressByIdRequest protoreflect.MessageDescriptor - fd_QueryAccountAddressByIdRequest_id protoreflect.FieldDescriptor + md_QueryAccountAddressByIDRequest protoreflect.MessageDescriptor + fd_QueryAccountAddressByIDRequest_id protoreflect.FieldDescriptor ) func init() { file_cosmos_auth_v1beta1_query_proto_init() - md_QueryAccountAddressByIdRequest = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIdRequest") - fd_QueryAccountAddressByIdRequest_id = md_QueryAccountAddressByIdRequest.Fields().ByName("id") + md_QueryAccountAddressByIDRequest = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIDRequest") + fd_QueryAccountAddressByIDRequest_id = md_QueryAccountAddressByIDRequest.Fields().ByName("id") } -var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIdRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIDRequest)(nil) -type fastReflection_QueryAccountAddressByIdRequest QueryAccountAddressByIdRequest +type fastReflection_QueryAccountAddressByIDRequest QueryAccountAddressByIDRequest -func (x *QueryAccountAddressByIdRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountAddressByIdRequest)(x) +func (x *QueryAccountAddressByIDRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIDRequest)(x) } -func (x *QueryAccountAddressByIdRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountAddressByIDRequest) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6012,43 +6012,43 @@ func (x *QueryAccountAddressByIdRequest) slowProtoReflect() protoreflect.Message return mi.MessageOf(x) } -var _fastReflection_QueryAccountAddressByIdRequest_messageType fastReflection_QueryAccountAddressByIdRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIdRequest_messageType{} +var _fastReflection_QueryAccountAddressByIDRequest_messageType fastReflection_QueryAccountAddressByIDRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIDRequest_messageType{} -type fastReflection_QueryAccountAddressByIdRequest_messageType struct{} +type fastReflection_QueryAccountAddressByIDRequest_messageType struct{} -func (x fastReflection_QueryAccountAddressByIdRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountAddressByIdRequest)(nil) +func (x fastReflection_QueryAccountAddressByIDRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIDRequest)(nil) } -func (x fastReflection_QueryAccountAddressByIdRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountAddressByIdRequest) +func (x fastReflection_QueryAccountAddressByIDRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIDRequest) } -func (x fastReflection_QueryAccountAddressByIdRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountAddressByIdRequest +func (x fastReflection_QueryAccountAddressByIDRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIDRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountAddressByIdRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountAddressByIdRequest +func (x *fastReflection_QueryAccountAddressByIDRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIDRequest } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAccountAddressByIdRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountAddressByIdRequest_messageType +func (x *fastReflection_QueryAccountAddressByIDRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountAddressByIDRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountAddressByIdRequest) New() protoreflect.Message { - return new(fastReflection_QueryAccountAddressByIdRequest) +func (x *fastReflection_QueryAccountAddressByIDRequest) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIDRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountAddressByIdRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAccountAddressByIdRequest)(x) +func (x *fastReflection_QueryAccountAddressByIDRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAccountAddressByIDRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -6056,10 +6056,10 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Interface() protoreflect // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountAddressByIdRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryAccountAddressByIDRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != int64(0) { value := protoreflect.ValueOfInt64(x.Id) - if !f(fd_QueryAccountAddressByIdRequest_id, value) { + if !f(fd_QueryAccountAddressByIDRequest_id, value) { return } } @@ -6076,15 +6076,15 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Range(f func(protoreflec // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAccountAddressByIdRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountAddressByIDRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": return x.Id != int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", fd.FullName())) } } @@ -6094,15 +6094,15 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Has(fd protoreflect.Fiel // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountAddressByIDRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": x.Id = int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", fd.FullName())) } } @@ -6112,16 +6112,16 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Clear(fd protoreflect.Fi // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAccountAddressByIdRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": value := x.Id return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", descriptor.FullName())) } } @@ -6135,15 +6135,15 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Get(descriptor protorefl // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountAddressByIDRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": x.Id = value.Int() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", fd.FullName())) } } @@ -6157,40 +6157,40 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) Set(fd protoreflect.Fiel // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": - panic(fmt.Errorf("field id of message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest is not mutable")) + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": + panic(fmt.Errorf("field id of message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAccountAddressByIdRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest.id": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest.id": return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDRequest does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAccountAddressByIdRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountAddressByIDRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIdRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", d.FullName())) } panic("unreachable") } @@ -6198,7 +6198,7 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) WhichOneof(d protoreflec // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAccountAddressByIdRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountAddressByIDRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6209,7 +6209,7 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) GetUnknown() protoreflec // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountAddressByIDRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6221,7 +6221,7 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) SetUnknown(fields protor // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryAccountAddressByIdRequest) IsValid() bool { +func (x *fastReflection_QueryAccountAddressByIDRequest) IsValid() bool { return x != nil } @@ -6231,9 +6231,9 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountAddressByIDRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountAddressByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIDRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6258,7 +6258,7 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoifa } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountAddressByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIDRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6293,7 +6293,7 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoifa }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountAddressByIdRequest) + x := input.Message.Interface().(*QueryAccountAddressByIDRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6325,10 +6325,10 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoifa fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6386,25 +6386,25 @@ func (x *fastReflection_QueryAccountAddressByIdRequest) ProtoMethods() *protoifa } var ( - md_QueryAccountAddressByIdResponse protoreflect.MessageDescriptor - fd_QueryAccountAddressByIdResponse_account_address protoreflect.FieldDescriptor + md_QueryAccountAddressByIDResponse protoreflect.MessageDescriptor + fd_QueryAccountAddressByIDResponse_account_address protoreflect.FieldDescriptor ) func init() { file_cosmos_auth_v1beta1_query_proto_init() - md_QueryAccountAddressByIdResponse = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIdResponse") - fd_QueryAccountAddressByIdResponse_account_address = md_QueryAccountAddressByIdResponse.Fields().ByName("account_address") + md_QueryAccountAddressByIDResponse = File_cosmos_auth_v1beta1_query_proto.Messages().ByName("QueryAccountAddressByIDResponse") + fd_QueryAccountAddressByIDResponse_account_address = md_QueryAccountAddressByIDResponse.Fields().ByName("account_address") } -var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIdResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAccountAddressByIDResponse)(nil) -type fastReflection_QueryAccountAddressByIdResponse QueryAccountAddressByIdResponse +type fastReflection_QueryAccountAddressByIDResponse QueryAccountAddressByIDResponse -func (x *QueryAccountAddressByIdResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountAddressByIdResponse)(x) +func (x *QueryAccountAddressByIDResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIDResponse)(x) } -func (x *QueryAccountAddressByIdResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryAccountAddressByIDResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6416,43 +6416,43 @@ func (x *QueryAccountAddressByIdResponse) slowProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -var _fastReflection_QueryAccountAddressByIdResponse_messageType fastReflection_QueryAccountAddressByIdResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIdResponse_messageType{} +var _fastReflection_QueryAccountAddressByIDResponse_messageType fastReflection_QueryAccountAddressByIDResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAccountAddressByIDResponse_messageType{} -type fastReflection_QueryAccountAddressByIdResponse_messageType struct{} +type fastReflection_QueryAccountAddressByIDResponse_messageType struct{} -func (x fastReflection_QueryAccountAddressByIdResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountAddressByIdResponse)(nil) +func (x fastReflection_QueryAccountAddressByIDResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAccountAddressByIDResponse)(nil) } -func (x fastReflection_QueryAccountAddressByIdResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountAddressByIdResponse) +func (x fastReflection_QueryAccountAddressByIDResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIDResponse) } -func (x fastReflection_QueryAccountAddressByIdResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountAddressByIdResponse +func (x fastReflection_QueryAccountAddressByIDResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIDResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountAddressByIdResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountAddressByIdResponse +func (x *fastReflection_QueryAccountAddressByIDResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAccountAddressByIDResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAccountAddressByIdResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountAddressByIdResponse_messageType +func (x *fastReflection_QueryAccountAddressByIDResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAccountAddressByIDResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountAddressByIdResponse) New() protoreflect.Message { - return new(fastReflection_QueryAccountAddressByIdResponse) +func (x *fastReflection_QueryAccountAddressByIDResponse) New() protoreflect.Message { + return new(fastReflection_QueryAccountAddressByIDResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountAddressByIdResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAccountAddressByIdResponse)(x) +func (x *fastReflection_QueryAccountAddressByIDResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAccountAddressByIDResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -6460,10 +6460,10 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Interface() protoreflec // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountAddressByIdResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryAccountAddressByIDResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.AccountAddress != "" { value := protoreflect.ValueOfString(x.AccountAddress) - if !f(fd_QueryAccountAddressByIdResponse_account_address, value) { + if !f(fd_QueryAccountAddressByIDResponse_account_address, value) { return } } @@ -6480,15 +6480,15 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Range(f func(protorefle // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAccountAddressByIdResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAccountAddressByIDResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": return x.AccountAddress != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", fd.FullName())) } } @@ -6498,15 +6498,15 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Has(fd protoreflect.Fie // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAccountAddressByIDResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": x.AccountAddress = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", fd.FullName())) } } @@ -6516,16 +6516,16 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Clear(fd protoreflect.F // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAccountAddressByIdResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": value := x.AccountAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", descriptor.FullName())) } } @@ -6539,15 +6539,15 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Get(descriptor protoref // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAccountAddressByIDResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": x.AccountAddress = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", fd.FullName())) } } @@ -6561,40 +6561,40 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) Set(fd protoreflect.Fie // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": - panic(fmt.Errorf("field account_address of message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse is not mutable")) + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": + panic(fmt.Errorf("field account_address of message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAccountAddressByIdResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAccountAddressByIDResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse.account_address": + case "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse.account_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse")) } - panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIdResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.auth.v1beta1.QueryAccountAddressByIDResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAccountAddressByIdResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAccountAddressByIDResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIdResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", d.FullName())) } panic("unreachable") } @@ -6602,7 +6602,7 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) WhichOneof(d protorefle // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAccountAddressByIdResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAccountAddressByIDResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -6613,7 +6613,7 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) GetUnknown() protorefle // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountAddressByIdResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAccountAddressByIDResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -6625,7 +6625,7 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) SetUnknown(fields proto // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryAccountAddressByIdResponse) IsValid() bool { +func (x *fastReflection_QueryAccountAddressByIDResponse) IsValid() bool { return x != nil } @@ -6635,9 +6635,9 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAccountAddressByIdResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAccountAddressByIDResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountAddressByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIDResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6663,7 +6663,7 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) ProtoMethods() *protoif } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountAddressByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIDResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6700,7 +6700,7 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) ProtoMethods() *protoif }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountAddressByIdResponse) + x := input.Message.Interface().(*QueryAccountAddressByIDResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -6732,10 +6732,10 @@ func (x *fastReflection_QueryAccountAddressByIdResponse) ProtoMethods() *protoif fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIDResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountAddressByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7329,8 +7329,8 @@ func (x *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } -// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method -type QueryAccountAddressByIdRequest struct { +// QueryAccountAddressByIDRequest is the request type for AccountAddressById rpc method +type QueryAccountAddressByIDRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -7338,8 +7338,8 @@ type QueryAccountAddressByIdRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *QueryAccountAddressByIdRequest) Reset() { - *x = QueryAccountAddressByIdRequest{} +func (x *QueryAccountAddressByIDRequest) Reset() { + *x = QueryAccountAddressByIDRequest{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -7347,36 +7347,35 @@ func (x *QueryAccountAddressByIdRequest) Reset() { } } -func (x *QueryAccountAddressByIdRequest) String() string { +func (x *QueryAccountAddressByIDRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAccountAddressByIdRequest) ProtoMessage() {} +func (*QueryAccountAddressByIDRequest) ProtoMessage() {} -// Deprecated: Use QueryAccountAddressByIdRequest.ProtoReflect.Descriptor instead. -func (*QueryAccountAddressByIdRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountAddressByIDRequest.ProtoReflect.Descriptor instead. +func (*QueryAccountAddressByIDRequest) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{14} } -func (x *QueryAccountAddressByIdRequest) GetId() int64 { +func (x *QueryAccountAddressByIDRequest) GetId() int64 { if x != nil { return x.Id } return 0 } -// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method -type QueryAccountAddressByIdResponse struct { +// QueryAccountAddressByIDResponse is the response type for AccountAddressById rpc method +type QueryAccountAddressByIDResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // account defines the account of the corresponding address. AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` } -func (x *QueryAccountAddressByIdResponse) Reset() { - *x = QueryAccountAddressByIdResponse{} +func (x *QueryAccountAddressByIDResponse) Reset() { + *x = QueryAccountAddressByIDResponse{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_auth_v1beta1_query_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -7384,18 +7383,18 @@ func (x *QueryAccountAddressByIdResponse) Reset() { } } -func (x *QueryAccountAddressByIdResponse) String() string { +func (x *QueryAccountAddressByIDResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAccountAddressByIdResponse) ProtoMessage() {} +func (*QueryAccountAddressByIDResponse) ProtoMessage() {} -// Deprecated: Use QueryAccountAddressByIdResponse.ProtoReflect.Descriptor instead. -func (*QueryAccountAddressByIdResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAccountAddressByIDResponse.ProtoReflect.Descriptor instead. +func (*QueryAccountAddressByIDResponse) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{15} } -func (x *QueryAccountAddressByIdResponse) GetAccountAddress() string { +func (x *QueryAccountAddressByIDResponse) GetAccountAddress() string { if x != nil { return x.AccountAddress } @@ -7485,10 +7484,10 @@ var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x64, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, @@ -7513,13 +7512,13 @@ var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb0, 0x01, 0x0a, 0x12, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x42, 0x79, 0x49, 0x64, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x73, 0x42, 0x79, 0x49, 0x44, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, - 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, + 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, @@ -7616,8 +7615,8 @@ var file_cosmos_auth_v1beta1_query_proto_goTypes = []interface{}{ (*AddressBytesToStringResponse)(nil), // 11: cosmos.auth.v1beta1.AddressBytesToStringResponse (*AddressStringToBytesRequest)(nil), // 12: cosmos.auth.v1beta1.AddressStringToBytesRequest (*AddressStringToBytesResponse)(nil), // 13: cosmos.auth.v1beta1.AddressStringToBytesResponse - (*QueryAccountAddressByIdRequest)(nil), // 14: cosmos.auth.v1beta1.QueryAccountAddressByIdRequest - (*QueryAccountAddressByIdResponse)(nil), // 15: cosmos.auth.v1beta1.QueryAccountAddressByIdResponse + (*QueryAccountAddressByIDRequest)(nil), // 14: cosmos.auth.v1beta1.QueryAccountAddressByIDRequest + (*QueryAccountAddressByIDResponse)(nil), // 15: cosmos.auth.v1beta1.QueryAccountAddressByIDResponse (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest (*anypb.Any)(nil), // 17: google.protobuf.Any (*v1beta1.PageResponse)(nil), // 18: cosmos.base.query.v1beta1.PageResponse @@ -7632,7 +7631,7 @@ var file_cosmos_auth_v1beta1_query_proto_depIdxs = []int32{ 17, // 5: cosmos.auth.v1beta1.QueryModuleAccountsResponse.accounts:type_name -> google.protobuf.Any 0, // 6: cosmos.auth.v1beta1.Query.Accounts:input_type -> cosmos.auth.v1beta1.QueryAccountsRequest 2, // 7: cosmos.auth.v1beta1.Query.Account:input_type -> cosmos.auth.v1beta1.QueryAccountRequest - 14, // 8: cosmos.auth.v1beta1.Query.AccountAddressById:input_type -> cosmos.auth.v1beta1.QueryAccountAddressByIdRequest + 14, // 8: cosmos.auth.v1beta1.Query.AccountAddressByID:input_type -> cosmos.auth.v1beta1.QueryAccountAddressByIDRequest 6, // 9: cosmos.auth.v1beta1.Query.Params:input_type -> cosmos.auth.v1beta1.QueryParamsRequest 3, // 10: cosmos.auth.v1beta1.Query.ModuleAccounts:input_type -> cosmos.auth.v1beta1.QueryModuleAccountsRequest 8, // 11: cosmos.auth.v1beta1.Query.Bech32Prefix:input_type -> cosmos.auth.v1beta1.Bech32PrefixRequest @@ -7640,7 +7639,7 @@ var file_cosmos_auth_v1beta1_query_proto_depIdxs = []int32{ 12, // 13: cosmos.auth.v1beta1.Query.AddressStringToBytes:input_type -> cosmos.auth.v1beta1.AddressStringToBytesRequest 1, // 14: cosmos.auth.v1beta1.Query.Accounts:output_type -> cosmos.auth.v1beta1.QueryAccountsResponse 5, // 15: cosmos.auth.v1beta1.Query.Account:output_type -> cosmos.auth.v1beta1.QueryAccountResponse - 15, // 16: cosmos.auth.v1beta1.Query.AccountAddressById:output_type -> cosmos.auth.v1beta1.QueryAccountAddressByIdResponse + 15, // 16: cosmos.auth.v1beta1.Query.AccountAddressByID:output_type -> cosmos.auth.v1beta1.QueryAccountAddressByIDResponse 4, // 17: cosmos.auth.v1beta1.Query.Params:output_type -> cosmos.auth.v1beta1.QueryParamsResponse 7, // 18: cosmos.auth.v1beta1.Query.ModuleAccounts:output_type -> cosmos.auth.v1beta1.QueryModuleAccountsResponse 9, // 19: cosmos.auth.v1beta1.Query.Bech32Prefix:output_type -> cosmos.auth.v1beta1.Bech32PrefixResponse @@ -7829,7 +7828,7 @@ func file_cosmos_auth_v1beta1_query_proto_init() { } } file_cosmos_auth_v1beta1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAccountAddressByIdRequest); i { + switch v := v.(*QueryAccountAddressByIDRequest); i { case 0: return &v.state case 1: @@ -7841,7 +7840,7 @@ func file_cosmos_auth_v1beta1_query_proto_init() { } } file_cosmos_auth_v1beta1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAccountAddressByIdResponse); i { + switch v := v.(*QueryAccountAddressByIDResponse); i { case 0: return &v.state case 1: diff --git a/api/cosmos/auth/v1beta1/query_grpc.pb.go b/api/cosmos/auth/v1beta1/query_grpc.pb.go index 5bca8d73574d..47d5a4c3292f 100644 --- a/api/cosmos/auth/v1beta1/query_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/query_grpc.pb.go @@ -28,8 +28,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // AccountAddressById returns account address based on account id - AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) + // AccountAddressByID returns account address based on account id + AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -76,9 +76,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } -func (c *queryClient) AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) { - out := new(QueryAccountAddressByIdResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressById", in, out, opts...) +func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) { + out := new(QueryAccountAddressByIDResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressByID", in, out, opts...) if err != nil { return nil, err } @@ -140,8 +140,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // AccountAddressById returns account address based on account id - AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) + // AccountAddressByID returns account address based on account id + AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -173,8 +173,8 @@ func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } -func (UnimplementedQueryServer) AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountAddressById not implemented") +func (UnimplementedQueryServer) AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountAddressByID not implemented") } func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -240,20 +240,20 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_AccountAddressById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountAddressByIdRequest) +func _Query_AccountAddressByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountAddressByIDRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AccountAddressById(ctx, in) + return srv.(QueryServer).AccountAddressByID(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressById", + FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressByID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountAddressById(ctx, req.(*QueryAccountAddressByIdRequest)) + return srv.(QueryServer).AccountAddressByID(ctx, req.(*QueryAccountAddressByIDRequest)) } return interceptor(ctx, in, info, handler) } @@ -364,8 +364,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Account_Handler, }, { - MethodName: "AccountAddressById", - Handler: _Query_AccountAddressById_Handler, + MethodName: "AccountAddressByID", + Handler: _Query_AccountAddressByID_Handler, }, { MethodName: "Params", diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index dd8bd4d7297e..8403eb76e655 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -24,8 +24,8 @@ service Query { option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; } - // AccountAddressById returns account address based on account id - rpc AccountAddressById(QueryAccountAddressByIdRequest) returns (QueryAccountAddressByIdResponse) { + // AccountAddressByID returns account address based on account id + rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; } @@ -158,13 +158,12 @@ message AddressStringToBytesResponse { bytes address_bytes = 1; } -// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method -message QueryAccountAddressByIdRequest{ +// QueryAccountAddressByIDRequest is the request type for AccountAddressById rpc method +message QueryAccountAddressByIDRequest{ int64 id = 1; } -// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method -message QueryAccountAddressByIdResponse { - // account defines the account of the corresponding address. +// QueryAccountAddressByIDResponse is the response type for AccountAddressById rpc method +message QueryAccountAddressByIDResponse { string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index cdfe8f213cbb..19bb8a80bd87 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -42,7 +42,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetAccountCmd(), - GetAccountAddressByIdCmd(), + GetAccountAddressByIDCmd(), GetAccountsCmd(), QueryParamsCmd(), QueryModuleAccountsCmd(), @@ -126,15 +126,13 @@ func GetAccountCmd() *cobra.Command { return cmd } -// GetAccountAddressByIdCmd returns a query account address that will display the account address of a given account id. -func GetAccountAddressByIdCmd() *cobra.Command { +// GetAccountAddressByIDCmd returns a query account address that will display the account address of a given account id. +func GetAccountAddressByIDCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "address-by-id [id]", - Short: "Query for account address by account id", - Args: cobra.ExactArgs(1), - Example: fmt.Sprintf( - "%s q auth address-by-id 1", version.AppName, - ), + Use: "address-by-id [id]", + Short: "Query for account address by account id", + Args: cobra.ExactArgs(1), + Example: fmt.Sprintf("%s q auth address-by-id 1", version.AppName), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -147,7 +145,7 @@ func GetAccountAddressByIdCmd() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AccountAddressById(cmd.Context(), &types.QueryAccountAddressByIdRequest{Id: id}) + res, err := queryClient.AccountAddressByID(cmd.Context(), &types.QueryAccountAddressByIDRequest{Id: id}) if err != nil { return err } diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 4011a0a255af..13f98d72699d 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -282,7 +282,7 @@ func (s *IntegrationTestSuite) TestCLISignBatch() { s.Require().Error(err) } -func (s *IntegrationTestSuite) TestCliGetAccountAddressById() { +func (s *IntegrationTestSuite) TestCliGetAccountAddressByID() { require := s.Require() val1 := s.network.Validators[0] testCases := []struct { @@ -310,7 +310,7 @@ func (s *IntegrationTestSuite) TestCliGetAccountAddressById() { for _, tc := range testCases { tc := tc s.Run(tc.name, func() { - cmd := authcli.GetAccountAddressByIdCmd() + cmd := authcli.GetAccountAddressByIDCmd() clientCtx := val1.ClientCtx queryResJSON, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -318,7 +318,7 @@ func (s *IntegrationTestSuite) TestCliGetAccountAddressById() { s.Require().Error(err) } else { s.Require().NoError(err) - var res types.QueryAccountAddressByIdResponse + var res types.QueryAccountAddressByIDResponse require.NoError(val1.ClientCtx.Codec.UnmarshalJSON(queryResJSON.Bytes(), &res)) require.NotNil(res.GetAccountAddress()) } diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index ae16a2a3fc30..c544d75a6305 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -50,7 +50,7 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A } // GetAccountAddressById returns account address by id. -func (ak AccountKeeper) GetAccountAddressById(ctx sdk.Context, id int64) string { +func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id int64) string { store := ctx.KVStore(ak.key) bz := store.Get(types.AccountNumberStoreKey(id)) if bz == nil { diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 7cd583d8fb3d..92f81ad3c616 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -19,7 +19,7 @@ import ( var _ types.QueryServer = AccountKeeper{} -func (ak AccountKeeper) AccountAddressById(c context.Context, req *types.QueryAccountAddressByIdRequest) (*types.QueryAccountAddressByIdResponse, error) { +func (ak AccountKeeper) AccountAddressByID(c context.Context, req *types.QueryAccountAddressByIDRequest) (*types.QueryAccountAddressByIDResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -29,12 +29,12 @@ func (ak AccountKeeper) AccountAddressById(c context.Context, req *types.QueryAc } ctx := sdk.UnwrapSDKContext(c) - address := ak.GetAccountAddressById(ctx, req.GetId()) + address := ak.GetAccountAddressByID(ctx, req.GetId()) if len(address) == 0 { return nil, status.Errorf(codes.NotFound, "account address not found with id %d", req.Id) } - return &types.QueryAccountAddressByIdResponse{AccountAddress: address}, nil + return &types.QueryAccountAddressByIDResponse{AccountAddress: address}, nil } func (ak AccountKeeper) Accounts(c context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index 27365a9a53f7..2b99a257aa1e 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -154,41 +154,41 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() { } } -func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressById() { - var req *types.QueryAccountAddressByIdRequest +func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressByID() { + var req *types.QueryAccountAddressByIDRequest _, _, addr := testdata.KeyTestPubAddr() testCases := []struct { msg string malleate func() expPass bool - posttests func(res *types.QueryAccountAddressByIdResponse) + posttests func(res *types.QueryAccountAddressByIDResponse) }{ { "invalid request", func() { - req = &types.QueryAccountAddressByIdRequest{Id: -1} + req = &types.QueryAccountAddressByIDRequest{Id: -1} }, false, - func(res *types.QueryAccountAddressByIdResponse) {}, + func(res *types.QueryAccountAddressByIDResponse) {}, }, { "account address not found", func() { - req = &types.QueryAccountAddressByIdRequest{Id: math.MaxInt64} + req = &types.QueryAccountAddressByIDRequest{Id: math.MaxInt64} }, false, - func(res *types.QueryAccountAddressByIdResponse) {}, + func(res *types.QueryAccountAddressByIDResponse) {}, }, { "valid request", func() { account := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr) suite.app.AccountKeeper.SetAccount(suite.ctx, account) - req = &types.QueryAccountAddressByIdRequest{Id: int64(account.GetAccountNumber())} + req = &types.QueryAccountAddressByIDRequest{Id: int64(account.GetAccountNumber())} }, true, - func(res *types.QueryAccountAddressByIdResponse) { + func(res *types.QueryAccountAddressByIDResponse) { suite.Require().NotNil(res.AccountAddress) }, }, @@ -201,7 +201,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressById() { tc.malleate() ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.AccountAddressById(ctx, req) + res, err := suite.queryClient.AccountAddressByID(ctx, req) if tc.expPass { suite.Require().NoError(err) diff --git a/x/auth/types/keys.go b/x/auth/types/keys.go index 06d14f9233f0..25dbe81d95d6 100644 --- a/x/auth/types/keys.go +++ b/x/auth/types/keys.go @@ -1,8 +1,6 @@ package types import ( - "strconv" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -37,5 +35,5 @@ func AddressStoreKey(addr sdk.AccAddress) []byte { } func AccountNumberStoreKey(accountNumber int64) []byte { - return append(AccountNumberStoreKeyPrefix, []byte(strconv.Itoa(int(accountNumber)))...) + return append(AccountNumberStoreKeyPrefix, sdk.Uint64ToBigEndian(uint64(accountNumber))...) } diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 5534dff3ba9e..a943f9bf7ff1 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -665,23 +665,23 @@ func (m *AddressStringToBytesResponse) GetAddressBytes() []byte { return nil } -// QueryAccountAddressByIdRequest is the request type for AccountAddressById rpc method -type QueryAccountAddressByIdRequest struct { +// QueryAccountAddressByIDRequest is the request type for AccountAddressById rpc method +type QueryAccountAddressByIDRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryAccountAddressByIdRequest) Reset() { *m = QueryAccountAddressByIdRequest{} } -func (m *QueryAccountAddressByIdRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountAddressByIdRequest) ProtoMessage() {} -func (*QueryAccountAddressByIdRequest) Descriptor() ([]byte, []int) { +func (m *QueryAccountAddressByIDRequest) Reset() { *m = QueryAccountAddressByIDRequest{} } +func (m *QueryAccountAddressByIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIDRequest) ProtoMessage() {} +func (*QueryAccountAddressByIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c451370b3929a27c, []int{14} } -func (m *QueryAccountAddressByIdRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountAddressByIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAccountAddressByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountAddressByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAccountAddressByIdRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountAddressByIDRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -691,43 +691,42 @@ func (m *QueryAccountAddressByIdRequest) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *QueryAccountAddressByIdRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountAddressByIdRequest.Merge(m, src) +func (m *QueryAccountAddressByIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIDRequest.Merge(m, src) } -func (m *QueryAccountAddressByIdRequest) XXX_Size() int { +func (m *QueryAccountAddressByIDRequest) XXX_Size() int { return m.Size() } -func (m *QueryAccountAddressByIdRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountAddressByIdRequest.DiscardUnknown(m) +func (m *QueryAccountAddressByIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIDRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAccountAddressByIdRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountAddressByIDRequest proto.InternalMessageInfo -func (m *QueryAccountAddressByIdRequest) GetId() int64 { +func (m *QueryAccountAddressByIDRequest) GetId() int64 { if m != nil { return m.Id } return 0 } -// QueryAccountAddressByIdResponse is the response type for AccountAddressById rpc method -type QueryAccountAddressByIdResponse struct { - // account defines the account of the corresponding address. +// QueryAccountAddressByIDResponse is the response type for AccountAddressById rpc method +type QueryAccountAddressByIDResponse struct { AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` } -func (m *QueryAccountAddressByIdResponse) Reset() { *m = QueryAccountAddressByIdResponse{} } -func (m *QueryAccountAddressByIdResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountAddressByIdResponse) ProtoMessage() {} -func (*QueryAccountAddressByIdResponse) Descriptor() ([]byte, []int) { +func (m *QueryAccountAddressByIDResponse) Reset() { *m = QueryAccountAddressByIDResponse{} } +func (m *QueryAccountAddressByIDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIDResponse) ProtoMessage() {} +func (*QueryAccountAddressByIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c451370b3929a27c, []int{15} } -func (m *QueryAccountAddressByIdResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAccountAddressByIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAccountAddressByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAccountAddressByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAccountAddressByIdResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAccountAddressByIDResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -737,19 +736,19 @@ func (m *QueryAccountAddressByIdResponse) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *QueryAccountAddressByIdResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountAddressByIdResponse.Merge(m, src) +func (m *QueryAccountAddressByIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIDResponse.Merge(m, src) } -func (m *QueryAccountAddressByIdResponse) XXX_Size() int { +func (m *QueryAccountAddressByIDResponse) XXX_Size() int { return m.Size() } -func (m *QueryAccountAddressByIdResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountAddressByIdResponse.DiscardUnknown(m) +func (m *QueryAccountAddressByIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIDResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAccountAddressByIdResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAccountAddressByIDResponse proto.InternalMessageInfo -func (m *QueryAccountAddressByIdResponse) GetAccountAddress() string { +func (m *QueryAccountAddressByIDResponse) GetAccountAddress() string { if m != nil { return m.AccountAddress } @@ -771,14 +770,14 @@ func init() { proto.RegisterType((*AddressBytesToStringResponse)(nil), "cosmos.auth.v1beta1.AddressBytesToStringResponse") proto.RegisterType((*AddressStringToBytesRequest)(nil), "cosmos.auth.v1beta1.AddressStringToBytesRequest") proto.RegisterType((*AddressStringToBytesResponse)(nil), "cosmos.auth.v1beta1.AddressStringToBytesResponse") - proto.RegisterType((*QueryAccountAddressByIdRequest)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIdRequest") - proto.RegisterType((*QueryAccountAddressByIdResponse)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIdResponse") + proto.RegisterType((*QueryAccountAddressByIDRequest)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") + proto.RegisterType((*QueryAccountAddressByIDResponse)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") } func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } var fileDescriptor_c451370b3929a27c = []byte{ - // 885 bytes of a gzipped FileDescriptorProto + // 886 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xcf, 0x4e, 0xeb, 0x46, 0x14, 0xc6, 0xe3, 0xdc, 0x16, 0xb8, 0x73, 0x73, 0x53, 0x69, 0xc8, 0x95, 0xa8, 0xc3, 0x75, 0xae, 0x4c, 0x81, 0x84, 0x12, 0x1b, 0x12, 0x36, 0xfd, 0xa3, 0x4a, 0x09, 0xb4, 0x15, 0x8b, 0x4a, 0xa9, @@ -813,28 +812,28 @@ var fileDescriptor_c451370b3929a27c = []byte{ 0xd0, 0x4b, 0x18, 0x64, 0xd3, 0x1a, 0xee, 0x33, 0x8d, 0x8c, 0x91, 0x31, 0xc7, 0x72, 0xd4, 0xcf, 0xd1, 0xb2, 0x58, 0x03, 0x40, 0x56, 0x51, 0x36, 0x14, 0xa1, 0x6c, 0x07, 0x48, 0x42, 0x69, 0x1e, 0xae, 0xee, 0x45, 0x28, 0x7c, 0xe1, 0x90, 0x30, 0xb9, 0x10, 0x25, 0xa1, 0xca, 0x6e, 0x04, 0xf3, - 0x40, 0x65, 0xd4, 0x95, 0xd9, 0x27, 0xda, 0x42, 0xca, 0xf8, 0xd5, 0x89, 0x4e, 0xb7, 0x6f, 0x87, - 0x34, 0x59, 0x94, 0xf6, 0x6c, 0x96, 0xfb, 0xcc, 0x48, 0x7b, 0xb6, 0x6a, 0xa3, 0xc2, 0xc4, 0x0c, - 0xa8, 0x5c, 0x43, 0xef, 0xc1, 0x28, 0x9b, 0x49, 0xbf, 0xa2, 0xac, 0x19, 0x93, 0xab, 0xfc, 0xff, - 0x1c, 0xbd, 0xcb, 0xca, 0xe0, 0x0b, 0x09, 0x85, 0x97, 0x93, 0xe2, 0x92, 0xf0, 0xa3, 0x10, 0x99, - 0x98, 0xbc, 0x91, 0x24, 0x94, 0x03, 0xab, 0xab, 0x3f, 0xfe, 0xf9, 0xef, 0x2f, 0xe9, 0x02, 0x7e, - 0xad, 0x0b, 0xcd, 0x34, 0xac, 0xfe, 0x93, 0x84, 0xe6, 0x21, 0x17, 0x17, 0x67, 0xca, 0x87, 0x20, - 0xa5, 0x04, 0x91, 0xc0, 0xa1, 0x33, 0x8e, 0x12, 0x5e, 0x9f, 0xca, 0xa1, 0x9f, 0x43, 0x57, 0x07, - 0xf8, 0x37, 0x09, 0xe1, 0xc7, 0x83, 0xc0, 0xd5, 0x99, 0x25, 0x1f, 0x0f, 0x5a, 0xde, 0x79, 0x5a, - 0x52, 0x32, 0xe4, 0xe8, 0x02, 0x36, 0x3d, 0x5b, 0x3f, 0xf7, 0xec, 0x01, 0xfe, 0x41, 0x42, 0x73, - 0xdc, 0x52, 0xf0, 0xfa, 0xe4, 0x8a, 0x31, 0xd3, 0x91, 0x8b, 0xb3, 0x03, 0x01, 0x67, 0x85, 0xe1, - 0xbc, 0xc6, 0x79, 0x21, 0x0e, 0xf7, 0x4b, 0xfc, 0xab, 0x84, 0xe2, 0xde, 0x43, 0xb1, 0x3e, 0xb9, - 0x82, 0xd0, 0xc5, 0xe5, 0xad, 0xe4, 0x09, 0x80, 0xb6, 0xc9, 0xd0, 0xd6, 0xf0, 0x07, 0x42, 0xb4, - 0x36, 0x4b, 0x6a, 0x46, 0x77, 0xed, 0x42, 0x42, 0x99, 0x71, 0xb3, 0x9b, 0x70, 0xe1, 0x04, 0x36, - 0x39, 0xe1, 0xc2, 0x89, 0x9c, 0x73, 0x46, 0xbb, 0xb8, 0x7f, 0x0e, 0x2f, 0x59, 0x4e, 0x64, 0x7b, - 0x58, 0xdc, 0x83, 0x29, 0x2e, 0x2b, 0x6f, 0x3f, 0x21, 0x03, 0x10, 0xab, 0x0c, 0xb1, 0x8c, 0x3f, - 0x9c, 0x82, 0x18, 0x7d, 0x11, 0xdc, 0xe9, 0x06, 0xf8, 0xf7, 0x11, 0x72, 0xcc, 0x1c, 0xa7, 0x23, - 0x8b, 0xdc, 0x78, 0x3a, 0xb2, 0xd0, 0x79, 0xd5, 0x1d, 0x86, 0xac, 0xe1, 0xcd, 0x44, 0xc8, 0xdc, - 0xe3, 0x07, 0xf5, 0xdd, 0xeb, 0x3b, 0x45, 0xba, 0xbd, 0x53, 0xa4, 0x7f, 0xee, 0x14, 0xe9, 0xe7, - 0x7b, 0x25, 0x75, 0x7b, 0xaf, 0xa4, 0xfe, 0xba, 0x57, 0x52, 0xdf, 0x94, 0x5c, 0x2f, 0x38, 0xee, - 0x59, 0x5a, 0x8b, 0xb4, 0x43, 0x45, 0xfe, 0x53, 0xa6, 0xf6, 0x77, 0xfa, 0x19, 0x97, 0x0f, 0xfa, - 0x1d, 0x87, 0x5a, 0x73, 0xec, 0x5f, 0xb6, 0xfa, 0x36, 0x00, 0x00, 0xff, 0xff, 0x44, 0x50, 0x73, - 0xdf, 0xc7, 0x0a, 0x00, 0x00, + 0x40, 0x65, 0xd4, 0x95, 0xd9, 0x27, 0xda, 0x42, 0xca, 0xf8, 0xd5, 0x89, 0x4e, 0xb7, 0xbf, 0x17, + 0xd2, 0x64, 0x51, 0xda, 0xb3, 0x59, 0xee, 0x33, 0x23, 0xed, 0xd9, 0xaa, 0x8d, 0x0a, 0x13, 0x33, + 0xa0, 0x72, 0x0d, 0xbd, 0x07, 0xa3, 0x6c, 0x26, 0xfd, 0x8a, 0xb2, 0x66, 0x4c, 0xae, 0xf2, 0xff, + 0x73, 0xf4, 0x2e, 0x2b, 0x83, 0x2f, 0x24, 0x14, 0x5e, 0x4e, 0x8a, 0x4b, 0xc2, 0x8f, 0x42, 0x64, + 0x62, 0xf2, 0x46, 0x92, 0x50, 0x0e, 0xac, 0xae, 0xfe, 0xf8, 0xe7, 0xbf, 0xbf, 0xa4, 0x0b, 0xf8, + 0xb5, 0x2e, 0x34, 0xd3, 0xb0, 0xfa, 0x4f, 0x12, 0x9a, 0x87, 0x5c, 0x5c, 0x9c, 0x29, 0x1f, 0x82, + 0x94, 0x12, 0x44, 0x02, 0x87, 0xce, 0x38, 0x4a, 0x78, 0x7d, 0x2a, 0x87, 0x7e, 0x0e, 0x5d, 0x1d, + 0xe0, 0xdf, 0x24, 0x84, 0x1f, 0x0f, 0x02, 0x57, 0x67, 0x96, 0x7c, 0x3c, 0x68, 0x79, 0xe7, 0x69, + 0x49, 0xc9, 0x90, 0xa3, 0x0b, 0xd8, 0xf4, 0x6c, 0xfd, 0xdc, 0xb3, 0x07, 0xf8, 0x07, 0x09, 0xcd, + 0x71, 0x4b, 0xc1, 0xeb, 0x93, 0x2b, 0xc6, 0x4c, 0x47, 0x2e, 0xce, 0x0e, 0x04, 0x9c, 0x15, 0x86, + 0xf3, 0x1a, 0xe7, 0x85, 0x38, 0xdc, 0x2f, 0xf1, 0xaf, 0x12, 0x8a, 0x7b, 0x0f, 0xc5, 0xfa, 0xe4, + 0x0a, 0x42, 0x17, 0x97, 0xb7, 0x92, 0x27, 0x00, 0xda, 0x26, 0x43, 0x5b, 0xc3, 0x1f, 0x08, 0xd1, + 0xda, 0x2c, 0xa9, 0x19, 0xdd, 0xb5, 0x0b, 0x09, 0x65, 0xc6, 0xcd, 0x6e, 0xc2, 0x85, 0x13, 0xd8, + 0xe4, 0x84, 0x0b, 0x27, 0x72, 0xce, 0x19, 0xed, 0xe2, 0xfe, 0x39, 0xbc, 0x64, 0x39, 0x91, 0xed, + 0x61, 0x71, 0x0f, 0xa6, 0xb8, 0xac, 0xbc, 0xfd, 0x84, 0x0c, 0x40, 0xac, 0x32, 0xc4, 0x32, 0xfe, + 0x70, 0x0a, 0x62, 0xf4, 0x45, 0x70, 0xa7, 0x1b, 0xe0, 0xdf, 0x47, 0xc8, 0x31, 0x73, 0x9c, 0x8e, + 0x2c, 0x72, 0xe3, 0xe9, 0xc8, 0x42, 0xe7, 0x55, 0x77, 0x18, 0xb2, 0x86, 0x37, 0x13, 0x21, 0x73, + 0x8f, 0x1f, 0xd4, 0x77, 0xaf, 0xef, 0x14, 0xe9, 0xf6, 0x4e, 0x91, 0xfe, 0xb9, 0x53, 0xa4, 0x9f, + 0xef, 0x95, 0xd4, 0xed, 0xbd, 0x92, 0xfa, 0xeb, 0x5e, 0x49, 0x7d, 0x53, 0x72, 0xbd, 0xe0, 0xb8, + 0x67, 0x69, 0x2d, 0xd2, 0x0e, 0x15, 0xf9, 0x4f, 0x99, 0xda, 0xdf, 0xe9, 0x67, 0x5c, 0x3e, 0xe8, + 0x77, 0x1c, 0x6a, 0xcd, 0xb1, 0x7f, 0xd9, 0xea, 0xdb, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x78, + 0xb2, 0xf3, 0xc7, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -855,8 +854,8 @@ type QueryClient interface { Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // AccountAddressById returns account address based on account id - AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) + // AccountAddressByID returns account address based on account id + AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) // Params queries all parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -903,9 +902,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } -func (c *queryClient) AccountAddressById(ctx context.Context, in *QueryAccountAddressByIdRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIdResponse, error) { - out := new(QueryAccountAddressByIdResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressById", in, out, opts...) +func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) { + out := new(QueryAccountAddressByIDResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressByID", in, out, opts...) if err != nil { return nil, err } @@ -965,8 +964,8 @@ type QueryServer interface { Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) // Account returns account details based on address. Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // AccountAddressById returns account address based on account id - AccountAddressById(context.Context, *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) + // AccountAddressByID returns account address based on account id + AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) // Params queries all parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. @@ -997,8 +996,8 @@ func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccount func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } -func (*UnimplementedQueryServer) AccountAddressById(ctx context.Context, req *QueryAccountAddressByIdRequest) (*QueryAccountAddressByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountAddressById not implemented") +func (*UnimplementedQueryServer) AccountAddressByID(ctx context.Context, req *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountAddressByID not implemented") } func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -1056,20 +1055,20 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_AccountAddressById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountAddressByIdRequest) +func _Query_AccountAddressByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountAddressByIDRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AccountAddressById(ctx, in) + return srv.(QueryServer).AccountAddressByID(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressById", + FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressByID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountAddressById(ctx, req.(*QueryAccountAddressByIdRequest)) + return srv.(QueryServer).AccountAddressByID(ctx, req.(*QueryAccountAddressByIDRequest)) } return interceptor(ctx, in, info, handler) } @@ -1177,8 +1176,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Account_Handler, }, { - MethodName: "AccountAddressById", - Handler: _Query_AccountAddressById_Handler, + MethodName: "AccountAddressByID", + Handler: _Query_AccountAddressByID_Handler, }, { MethodName: "Params", @@ -1643,7 +1642,7 @@ func (m *AddressStringToBytesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryAccountAddressByIdRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountAddressByIDRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1653,12 +1652,12 @@ func (m *QueryAccountAddressByIdRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAccountAddressByIdRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIDRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAccountAddressByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1671,7 +1670,7 @@ func (m *QueryAccountAddressByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryAccountAddressByIdResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAccountAddressByIDResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1681,12 +1680,12 @@ func (m *QueryAccountAddressByIdResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAccountAddressByIdResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIDResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAccountAddressByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAccountAddressByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1888,7 +1887,7 @@ func (m *AddressStringToBytesResponse) Size() (n int) { return n } -func (m *QueryAccountAddressByIdRequest) Size() (n int) { +func (m *QueryAccountAddressByIDRequest) Size() (n int) { if m == nil { return 0 } @@ -1900,7 +1899,7 @@ func (m *QueryAccountAddressByIdRequest) Size() (n int) { return n } -func (m *QueryAccountAddressByIdResponse) Size() (n int) { +func (m *QueryAccountAddressByIDResponse) Size() (n int) { if m == nil { return 0 } @@ -3024,7 +3023,7 @@ func (m *AddressStringToBytesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAccountAddressByIdRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAccountAddressByIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3047,10 +3046,10 @@ func (m *QueryAccountAddressByIdRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAccountAddressByIdRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountAddressByIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountAddressByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountAddressByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3093,7 +3092,7 @@ func (m *QueryAccountAddressByIdRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAccountAddressByIdResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAccountAddressByIDResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3116,10 +3115,10 @@ func (m *QueryAccountAddressByIdResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAccountAddressByIdResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAccountAddressByIDResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountAddressByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAccountAddressByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/auth/types/query.pb.gw.go b/x/auth/types/query.pb.gw.go index 7d0d08f956ba..e1353ae21b49 100644 --- a/x/auth/types/query.pb.gw.go +++ b/x/auth/types/query.pb.gw.go @@ -123,8 +123,8 @@ func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marsha } -func request_Query_AccountAddressById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountAddressByIdRequest +func request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIDRequest var metadata runtime.ServerMetadata var ( @@ -145,13 +145,13 @@ func request_Query_AccountAddressById_0(ctx context.Context, marshaler runtime.M return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.AccountAddressById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.AccountAddressByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_AccountAddressById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountAddressByIdRequest +func local_request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIDRequest var metadata runtime.ServerMetadata var ( @@ -172,7 +172,7 @@ func local_request_Query_AccountAddressById_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.AccountAddressById(ctx, &protoReq) + msg, err := server.AccountAddressByID(ctx, &protoReq) return msg, metadata, err } @@ -391,7 +391,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AccountAddressById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -402,7 +402,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_AccountAddressById_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_AccountAddressByID_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -410,7 +410,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AccountAddressById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -610,7 +610,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AccountAddressById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -619,14 +619,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AccountAddressById_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_AccountAddressByID_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_AccountAddressById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -738,7 +738,7 @@ var ( pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AccountAddressById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "address_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AccountAddressByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "address_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) @@ -756,7 +756,7 @@ var ( forward_Query_Account_0 = runtime.ForwardResponseMessage - forward_Query_AccountAddressById_0 = runtime.ForwardResponseMessage + forward_Query_AccountAddressByID_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage From 4cdb80b91c5aaecd160e02c7ecff5f52ce7b9cb0 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 10 Jun 2022 10:31:09 +0530 Subject: [PATCH 08/19] chore: address the pr comments --- x/auth/keeper/account.go | 10 +++++----- x/auth/migrations/v046/store.go | 2 +- x/auth/types/keys.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index c544d75a6305..fa1939a69d6f 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -32,8 +32,8 @@ func (ak AccountKeeper) HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool { return store.Has(types.AddressStoreKey(addr)) } -// HasAccountAddressById checks account address exsits by id. -func (ak AccountKeeper) HasAccountAddressById(ctx sdk.Context, id int64) bool { +// HasAccountAddressByID checks account address exists by id. +func (ak AccountKeeper) HasAccountAddressByID(ctx sdk.Context, id uint64) bool { store := ctx.KVStore(ak.key) return store.Has(types.AccountNumberStoreKey(id)) } @@ -52,7 +52,7 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A // GetAccountAddressById returns account address by id. func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id int64) string { store := ctx.KVStore(ak.key) - bz := store.Get(types.AccountNumberStoreKey(id)) + bz := store.Get(types.AccountNumberStoreKey(uint64(id))) if bz == nil { return "" } @@ -81,7 +81,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { } store.Set(types.AddressStoreKey(addr), bz) - store.Set(types.AccountNumberStoreKey(int64(acc.GetAccountNumber())), conv.UnsafeStrToBytes(addr.String())) + store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), conv.UnsafeStrToBytes(addr.String())) } // RemoveAccount removes an account for the account mapper store. @@ -90,7 +90,7 @@ func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) store.Delete(types.AddressStoreKey(addr)) - store.Delete(types.AccountNumberStoreKey(int64(acc.GetAccountNumber()))) + store.Delete(types.AccountNumberStoreKey(acc.GetAccountNumber())) } // IterateAccounts iterates over all the stored accounts and performs a callback function. diff --git a/x/auth/migrations/v046/store.go b/x/auth/migrations/v046/store.go index d3c5e02f9bb2..f3cf85e09e29 100644 --- a/x/auth/migrations/v046/store.go +++ b/x/auth/migrations/v046/store.go @@ -18,7 +18,7 @@ func mapAccountAddressToAccountId(ctx sdk.Context, storeKey storetypes.StoreKey, if err := cdc.UnmarshalInterface(iterator.Value(), &acc); err != nil { return err } - store.Set(types.AccountNumberStoreKey(int64(acc.GetAccountNumber())), conv.UnsafeStrToBytes(acc.GetAddress().String())) + store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), conv.UnsafeStrToBytes(acc.GetAddress().String())) } return nil diff --git a/x/auth/types/keys.go b/x/auth/types/keys.go index 25dbe81d95d6..221b6b2161bb 100644 --- a/x/auth/types/keys.go +++ b/x/auth/types/keys.go @@ -34,6 +34,6 @@ func AddressStoreKey(addr sdk.AccAddress) []byte { return append(AddressStoreKeyPrefix, addr.Bytes()...) } -func AccountNumberStoreKey(accountNumber int64) []byte { - return append(AccountNumberStoreKeyPrefix, sdk.Uint64ToBigEndian(uint64(accountNumber))...) +func AccountNumberStoreKey(accountNumber uint64) []byte { + return append(AccountNumberStoreKeyPrefix, sdk.Uint64ToBigEndian(accountNumber)...) } From a00e900926bdd9af369fded800dc73919221b5a5 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 10 Jun 2022 10:33:05 +0530 Subject: [PATCH 09/19] chore: address the pr comments++ --- x/auth/migrations/v046/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/auth/migrations/v046/store.go b/x/auth/migrations/v046/store.go index f3cf85e09e29..dfbca51b3d67 100644 --- a/x/auth/migrations/v046/store.go +++ b/x/auth/migrations/v046/store.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) -func mapAccountAddressToAccountId(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { +func mapAccountAddressToAccountID(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { store := ctx.KVStore(storeKey) iterator := sdk.KVStorePrefixIterator(store, types.AddressStoreKeyPrefix) @@ -28,5 +28,5 @@ func mapAccountAddressToAccountId(ctx sdk.Context, storeKey storetypes.StoreKey, // migration includes: // - Add an Account number as an index to get the account address func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { - return mapAccountAddressToAccountId(ctx, storeKey, cdc) + return mapAccountAddressToAccountID(ctx, storeKey, cdc) } From 455e023e10a2bad5893adbeb07c0fc9d6521d648 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 10 Jun 2022 09:42:38 -0400 Subject: [PATCH 10/19] Update x/auth/keeper/account.go Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- x/auth/keeper/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index fa1939a69d6f..8e2d78edeecc 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -50,7 +50,7 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A } // GetAccountAddressById returns account address by id. -func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id int64) string { +func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string { store := ctx.KVStore(ak.key) bz := store.Get(types.AccountNumberStoreKey(uint64(id))) if bz == nil { From 3d4d28181ec2c83e5047b258565a4fc1aeff3fc3 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 10 Jun 2022 09:42:43 -0400 Subject: [PATCH 11/19] Update x/auth/keeper/account.go Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- x/auth/keeper/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index 8e2d78edeecc..f9e7388ed8af 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -52,7 +52,7 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.A // GetAccountAddressById returns account address by id. func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string { store := ctx.KVStore(ak.key) - bz := store.Get(types.AccountNumberStoreKey(uint64(id))) + bz := store.Get(types.AccountNumberStoreKey(id)) if bz == nil { return "" } From 74857f8d50a13827b800080d34c86791eb33fbe9 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 10 Jun 2022 09:42:49 -0400 Subject: [PATCH 12/19] Update x/auth/client/cli/query.go Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- x/auth/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 19bb8a80bd87..c3eda5b2d03e 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -126,7 +126,7 @@ func GetAccountCmd() *cobra.Command { return cmd } -// GetAccountAddressByIDCmd returns a query account address that will display the account address of a given account id. +// GetAccountAddressByIDCmd returns a query account that will display the account address of a given account id. func GetAccountAddressByIDCmd() *cobra.Command { cmd := &cobra.Command{ Use: "address-by-id [id]", From 4bf13208c54dec138107e152ab1923f1caabfe10 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 10 Jun 2022 09:42:53 -0400 Subject: [PATCH 13/19] Update proto/cosmos/auth/v1beta1/query.proto Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- proto/cosmos/auth/v1beta1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index 8403eb76e655..ab0719163b9b 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -163,7 +163,7 @@ message QueryAccountAddressByIDRequest{ int64 id = 1; } -// QueryAccountAddressByIDResponse is the response type for AccountAddressById rpc method +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method message QueryAccountAddressByIDResponse { string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } From 1eb42c93b6353f5042dda8d637ad7ca4d834a69a Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Fri, 10 Jun 2022 09:42:58 -0400 Subject: [PATCH 14/19] Update proto/cosmos/auth/v1beta1/query.proto Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- proto/cosmos/auth/v1beta1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index ab0719163b9b..d09c63c113cc 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -158,7 +158,7 @@ message AddressStringToBytesResponse { bytes address_bytes = 1; } -// QueryAccountAddressByIDRequest is the request type for AccountAddressById rpc method +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method message QueryAccountAddressByIDRequest{ int64 id = 1; } From fa633b1cc381847f3b011684d01ebe35fb2a78e4 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 14 Jun 2022 11:11:23 +0530 Subject: [PATCH 15/19] chore: address the pr comments 1. Removed conv from str to bytes and bytes to string --- x/auth/keeper/account.go | 6 ++---- x/auth/keeper/grpc_query.go | 2 +- x/auth/migrations/v046/store.go | 3 +-- x/auth/types/keys.go | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index f9e7388ed8af..a18a5240dce8 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -1,7 +1,6 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/internal/conv" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -56,8 +55,7 @@ func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string if bz == nil { return "" } - - return conv.UnsafeBytesToStr(bz) + return sdk.AccAddress(bz).String() } // GetAllAccounts returns all accounts in the accountKeeper. @@ -81,7 +79,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { } store.Set(types.AddressStoreKey(addr), bz) - store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), conv.UnsafeStrToBytes(addr.String())) + store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), addr.Bytes()) } // RemoveAccount removes an account for the account mapper store. diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 92f81ad3c616..9d37a4ecc9f6 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -29,7 +29,7 @@ func (ak AccountKeeper) AccountAddressByID(c context.Context, req *types.QueryAc } ctx := sdk.UnwrapSDKContext(c) - address := ak.GetAccountAddressByID(ctx, req.GetId()) + address := ak.GetAccountAddressByID(ctx, uint64(req.GetId())) if len(address) == 0 { return nil, status.Errorf(codes.NotFound, "account address not found with id %d", req.Id) } diff --git a/x/auth/migrations/v046/store.go b/x/auth/migrations/v046/store.go index dfbca51b3d67..8cb7c15bd6a9 100644 --- a/x/auth/migrations/v046/store.go +++ b/x/auth/migrations/v046/store.go @@ -2,7 +2,6 @@ package v046 import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/internal/conv" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -18,7 +17,7 @@ func mapAccountAddressToAccountID(ctx sdk.Context, storeKey storetypes.StoreKey, if err := cdc.UnmarshalInterface(iterator.Value(), &acc); err != nil { return err } - store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), conv.UnsafeStrToBytes(acc.GetAddress().String())) + store.Set(types.AccountNumberStoreKey(acc.GetAccountNumber()), acc.GetAddress().Bytes()) } return nil diff --git a/x/auth/types/keys.go b/x/auth/types/keys.go index 221b6b2161bb..e3488bbc07a2 100644 --- a/x/auth/types/keys.go +++ b/x/auth/types/keys.go @@ -34,6 +34,7 @@ func AddressStoreKey(addr sdk.AccAddress) []byte { return append(AddressStoreKeyPrefix, addr.Bytes()...) } +// AccountNumberStoreKey turn an account number to key used to get the account address from account store func AccountNumberStoreKey(accountNumber uint64) []byte { return append(AccountNumberStoreKeyPrefix, sdk.Uint64ToBigEndian(accountNumber)...) } From 2219c564dae2c080ade7066fd0353a4bc69bddad Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 14 Jun 2022 15:13:00 +0530 Subject: [PATCH 16/19] test: fix the test cases --- baseapp/block_gas_test.go | 2 +- x/auth/ante/ante_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 99bbbae22ebf..173ba79b0e81 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -124,7 +124,7 @@ func TestBaseApp_BlockGas(t *testing.T) { require.Equal(t, []byte("ok"), okValue) } // check block gas is always consumed - baseGas := uint64(63724) // baseGas is the gas consumed before tx msg + baseGas := uint64(70184) // baseGas is the gas consumed before tx msg expGasConsumed := addUint64Saturating(tc.gasToConsume, baseGas) if expGasConsumed > txtypes.MaxGasWanted { // capped by gasLimit diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 1e6f8ace5bcd..f2bc8f83a726 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -571,7 +571,7 @@ func (suite *AnteTestSuite) TestAnteHandlerMemoGas() { "tx with memo has enough gas", func() { feeAmount = sdk.NewCoins(sdk.NewInt64Coin("atom", 0)) - gasLimit = 50000 + gasLimit = 60000 suite.txBuilder.SetMemo(strings.Repeat("0123456789", 10)) }, false, From ce0d710d29481df587280c7823855d7c9053f090 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 15 Jun 2022 13:50:48 +0530 Subject: [PATCH 17/19] test: add state migration test cases --- x/auth/keeper/migrations.go | 15 +++++++ x/auth/migrations/v046/store_test.go | 66 ++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/x/auth/keeper/migrations.go b/x/auth/keeper/migrations.go index 3aa09901995b..f98e4d7c4a68 100644 --- a/x/auth/keeper/migrations.go +++ b/x/auth/keeper/migrations.go @@ -47,3 +47,18 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { func (m Migrator) MapAccAddrsToAccNum(ctx sdk.Context) error { return v046.MigrateStore(ctx, m.keeper.key, m.keeper.cdc) } + +// V45_SetAccount implements V45_SetAccount +// set the account without map to accAddr to accNumber +func (m Migrator) V45_SetAccount(ctx sdk.Context, acc types.AccountI) error { + addr := acc.GetAddress() + store := ctx.KVStore(m.keeper.key) + + bz, err := m.keeper.MarshalAccount(acc) + if err != nil { + return err + } + + store.Set(types.AddressStoreKey(addr), bz) + return nil +} diff --git a/x/auth/migrations/v046/store_test.go b/x/auth/migrations/v046/store_test.go index a5be02bb97cc..3a3ffb6471a3 100644 --- a/x/auth/migrations/v046/store_test.go +++ b/x/auth/migrations/v046/store_test.go @@ -1 +1,67 @@ package v046_test + +import ( + "math/rand" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +) + +// TestMigrateMapAccAddressToAccNumberKey test cases for state migration of map to accAddr to accNum +func TestMigrateMapAccAddressToAccNumberKey(t *testing.T) { + app := simapp.Setup(t, false) + + // new base account + senderPrivKey := secp256k1.GenPrivKey() + randAccNumber := uint64(rand.Intn(100000-10000) + 10000) + acc := types.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), randAccNumber, 0) + + ctx := app.App.BaseApp.NewContext(false, tmproto.Header{ + Time: time.Now(), + }) + + // migrator + m := keeper.NewMigrator(app.AccountKeeper, app.GRPCQueryRouter()) + // set the account to store with map acc addr to acc number + require.NoError(t, m.V45_SetAccount(ctx, acc)) + + testCases := []struct { + name string + doMigration bool + accNum uint64 + }{ + { + name: "without state migration", + doMigration: false, + accNum: acc.AccountNumber, + }, + { + name: "with state migration", + doMigration: true, + accNum: acc.AccountNumber, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if tc.doMigration { + require.NoError(t, m.MapAccAddrsToAccNum(ctx)) + } + + // get the account address by acc id + accAddr := app.AccountKeeper.GetAccountAddressByID(ctx, tc.accNum) + + if tc.doMigration { + require.Equal(t, accAddr, acc.Address) + } else { + require.Equal(t, len(accAddr), 0) + } + }) + } +} From 4bef7c2d28955c870ed72ae1b760063b97353119 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 15 Jun 2022 20:47:55 +0530 Subject: [PATCH 18/19] chore: address the pr comments --- x/auth/keeper/migrations.go | 4 +++- x/auth/migrations/v046/store_test.go | 2 +- x/auth/module.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/x/auth/keeper/migrations.go b/x/auth/keeper/migrations.go index f98e4d7c4a68..36c7ec0a41e8 100644 --- a/x/auth/keeper/migrations.go +++ b/x/auth/keeper/migrations.go @@ -44,7 +44,9 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { return iterErr } -func (m Migrator) MapAccAddrsToAccNum(ctx sdk.Context) error { +// Migrate2to3 migrates from consensus version 2 to version 3. Specifically, for each account +// we index the account's ID to their address. +func (m Migrator) Migrate2to3(ctx sdk.Context) error { return v046.MigrateStore(ctx, m.keeper.key, m.keeper.cdc) } diff --git a/x/auth/migrations/v046/store_test.go b/x/auth/migrations/v046/store_test.go index 3a3ffb6471a3..698cdbb8c24d 100644 --- a/x/auth/migrations/v046/store_test.go +++ b/x/auth/migrations/v046/store_test.go @@ -51,7 +51,7 @@ func TestMigrateMapAccAddressToAccNumberKey(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { if tc.doMigration { - require.NoError(t, m.MapAccAddrsToAccNum(ctx)) + require.NoError(t, m.Migrate2to3(ctx)) } // get the account address by acc id diff --git a/x/auth/module.go b/x/auth/module.go index d9f2ff207f97..f267c8e8c9af 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -138,7 +138,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { panic(err) } - err = cfg.RegisterMigration(types.ModuleName, 2, m.MapAccAddrsToAccNum) + err = cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3) if err != nil { panic(err) } From cf7e8cf7b574f07770777b3f2fa72035fb170e00 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 15 Jun 2022 21:25:36 +0530 Subject: [PATCH 19/19] chore: address the pr comments++ --- x/auth/keeper/migrations.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/auth/keeper/migrations.go b/x/auth/keeper/migrations.go index 36c7ec0a41e8..768bc7c10caa 100644 --- a/x/auth/keeper/migrations.go +++ b/x/auth/keeper/migrations.go @@ -51,7 +51,9 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { } // V45_SetAccount implements V45_SetAccount -// set the account without map to accAddr to accNumber +// set the account without map to accAddr to accNumber. +// +// NOTE: This is used for testing purposes only. func (m Migrator) V45_SetAccount(ctx sdk.Context, acc types.AccountI) error { addr := acc.GetAddress() store := ctx.KVStore(m.keeper.key)