diff --git a/api/cosmos/accounts/v1/query.pulsar.go b/api/cosmos/accounts/v1/query.pulsar.go index 73f12ef52015..8bcaa173d3e5 100644 --- a/api/cosmos/accounts/v1/query.pulsar.go +++ b/api/cosmos/accounts/v1/query.pulsar.go @@ -2100,7 +2100,7 @@ func (x *SchemaResponse_Handler) ProtoReflect() protoreflect.Message { } func (x *SchemaResponse_Handler) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2563,26 +2563,866 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho } var ( - md_AccountTypeRequest protoreflect.MessageDescriptor - fd_AccountTypeRequest_address protoreflect.FieldDescriptor + md_AccountTypeRequest protoreflect.MessageDescriptor + fd_AccountTypeRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_query_proto_init() + md_AccountTypeRequest = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountTypeRequest") + fd_AccountTypeRequest_address = md_AccountTypeRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_AccountTypeRequest)(nil) + +type fastReflection_AccountTypeRequest AccountTypeRequest + +func (x *AccountTypeRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountTypeRequest)(x) +} + +func (x *AccountTypeRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[4] + 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_AccountTypeRequest_messageType fastReflection_AccountTypeRequest_messageType +var _ protoreflect.MessageType = fastReflection_AccountTypeRequest_messageType{} + +type fastReflection_AccountTypeRequest_messageType struct{} + +func (x fastReflection_AccountTypeRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountTypeRequest)(nil) +} +func (x fastReflection_AccountTypeRequest_messageType) New() protoreflect.Message { + return new(fastReflection_AccountTypeRequest) +} +func (x fastReflection_AccountTypeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountTypeRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccountTypeRequest) Descriptor() protoreflect.MessageDescriptor { + return md_AccountTypeRequest +} + +// 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_AccountTypeRequest) Type() protoreflect.MessageType { + return _fastReflection_AccountTypeRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccountTypeRequest) New() protoreflect.Message { + return new(fastReflection_AccountTypeRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccountTypeRequest) Interface() protoreflect.ProtoMessage { + return (*AccountTypeRequest)(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_AccountTypeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_AccountTypeRequest_address, 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_AccountTypeRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + panic(fmt.Errorf("field address of message cosmos.accounts.v1.AccountTypeRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest 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_AccountTypeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountTypeRequest", 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_AccountTypeRequest) 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_AccountTypeRequest) 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_AccountTypeRequest) 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_AccountTypeRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccountTypeRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + 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().(*AccountTypeRequest) + 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 len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*AccountTypeRequest) + 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: AccountTypeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeRequest: 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 Address", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + 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 + } + x.Address = string(dAtA[iNdEx:postIndex]) + 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, + } +} + +var ( + md_AccountTypeResponse protoreflect.MessageDescriptor + fd_AccountTypeResponse_account_type protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_query_proto_init() + md_AccountTypeResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountTypeResponse") + fd_AccountTypeResponse_account_type = md_AccountTypeResponse.Fields().ByName("account_type") +} + +var _ protoreflect.Message = (*fastReflection_AccountTypeResponse)(nil) + +type fastReflection_AccountTypeResponse AccountTypeResponse + +func (x *AccountTypeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountTypeResponse)(x) +} + +func (x *AccountTypeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[5] + 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_AccountTypeResponse_messageType fastReflection_AccountTypeResponse_messageType +var _ protoreflect.MessageType = fastReflection_AccountTypeResponse_messageType{} + +type fastReflection_AccountTypeResponse_messageType struct{} + +func (x fastReflection_AccountTypeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountTypeResponse)(nil) +} +func (x fastReflection_AccountTypeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_AccountTypeResponse) +} +func (x fastReflection_AccountTypeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountTypeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccountTypeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_AccountTypeResponse +} + +// 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_AccountTypeResponse) Type() protoreflect.MessageType { + return _fastReflection_AccountTypeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccountTypeResponse) New() protoreflect.Message { + return new(fastReflection_AccountTypeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccountTypeResponse) Interface() protoreflect.ProtoMessage { + return (*AccountTypeResponse)(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_AccountTypeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AccountType != "" { + value := protoreflect.ValueOfString(x.AccountType) + if !f(fd_AccountTypeResponse_account_type, 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_AccountTypeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + return x.AccountType != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + x.AccountType = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + value := x.AccountType + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + x.AccountType = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + panic(fmt.Errorf("field account_type of message cosmos.accounts.v1.AccountTypeResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.AccountTypeResponse.account_type": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse 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_AccountTypeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountTypeResponse", 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_AccountTypeResponse) 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_AccountTypeResponse) 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_AccountTypeResponse) 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_AccountTypeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccountTypeResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AccountType) + if l > 0 { + 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().(*AccountTypeResponse) + 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 len(x.AccountType) > 0 { + i -= len(x.AccountType) + copy(dAtA[i:], x.AccountType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccountType))) + 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().(*AccountTypeResponse) + 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: AccountTypeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeResponse: 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 AccountType", wireType) + } + var stringLen 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++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + 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 + } + x.AccountType = string(dAtA[iNdEx:postIndex]) + 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, + } +} + +var ( + md_AccountNumberRequest protoreflect.MessageDescriptor + fd_AccountNumberRequest_address protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_query_proto_init() - md_AccountTypeRequest = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountTypeRequest") - fd_AccountTypeRequest_address = md_AccountTypeRequest.Fields().ByName("address") + md_AccountNumberRequest = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountNumberRequest") + fd_AccountNumberRequest_address = md_AccountNumberRequest.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_AccountTypeRequest)(nil) +var _ protoreflect.Message = (*fastReflection_AccountNumberRequest)(nil) -type fastReflection_AccountTypeRequest AccountTypeRequest +type fastReflection_AccountNumberRequest AccountNumberRequest -func (x *AccountTypeRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_AccountTypeRequest)(x) +func (x *AccountNumberRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountNumberRequest)(x) } -func (x *AccountTypeRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[4] +func (x *AccountNumberRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2593,43 +3433,43 @@ func (x *AccountTypeRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_AccountTypeRequest_messageType fastReflection_AccountTypeRequest_messageType -var _ protoreflect.MessageType = fastReflection_AccountTypeRequest_messageType{} +var _fastReflection_AccountNumberRequest_messageType fastReflection_AccountNumberRequest_messageType +var _ protoreflect.MessageType = fastReflection_AccountNumberRequest_messageType{} -type fastReflection_AccountTypeRequest_messageType struct{} +type fastReflection_AccountNumberRequest_messageType struct{} -func (x fastReflection_AccountTypeRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_AccountTypeRequest)(nil) +func (x fastReflection_AccountNumberRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountNumberRequest)(nil) } -func (x fastReflection_AccountTypeRequest_messageType) New() protoreflect.Message { - return new(fastReflection_AccountTypeRequest) +func (x fastReflection_AccountNumberRequest_messageType) New() protoreflect.Message { + return new(fastReflection_AccountNumberRequest) } -func (x fastReflection_AccountTypeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_AccountTypeRequest +func (x fastReflection_AccountNumberRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountNumberRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_AccountTypeRequest) Descriptor() protoreflect.MessageDescriptor { - return md_AccountTypeRequest +func (x *fastReflection_AccountNumberRequest) Descriptor() protoreflect.MessageDescriptor { + return md_AccountNumberRequest } // 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_AccountTypeRequest) Type() protoreflect.MessageType { - return _fastReflection_AccountTypeRequest_messageType +func (x *fastReflection_AccountNumberRequest) Type() protoreflect.MessageType { + return _fastReflection_AccountNumberRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_AccountTypeRequest) New() protoreflect.Message { - return new(fastReflection_AccountTypeRequest) +func (x *fastReflection_AccountNumberRequest) New() protoreflect.Message { + return new(fastReflection_AccountNumberRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_AccountTypeRequest) Interface() protoreflect.ProtoMessage { - return (*AccountTypeRequest)(x) +func (x *fastReflection_AccountNumberRequest) Interface() protoreflect.ProtoMessage { + return (*AccountNumberRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -2637,10 +3477,10 @@ func (x *fastReflection_AccountTypeRequest) Interface() protoreflect.ProtoMessag // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_AccountTypeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_AccountNumberRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_AccountTypeRequest_address, value) { + if !f(fd_AccountNumberRequest_address, value) { return } } @@ -2657,15 +3497,15 @@ func (x *fastReflection_AccountTypeRequest) Range(f func(protoreflect.FieldDescr // 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_AccountTypeRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_AccountNumberRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": + case "cosmos.accounts.v1.AccountNumberRequest.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest does not contain field %s", fd.FullName())) } } @@ -2675,15 +3515,15 @@ func (x *fastReflection_AccountTypeRequest) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_AccountNumberRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": + case "cosmos.accounts.v1.AccountNumberRequest.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest does not contain field %s", fd.FullName())) } } @@ -2693,16 +3533,16 @@ func (x *fastReflection_AccountTypeRequest) Clear(fd protoreflect.FieldDescripto // 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_AccountTypeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": + case "cosmos.accounts.v1.AccountNumberRequest.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest does not contain field %s", descriptor.FullName())) } } @@ -2716,15 +3556,15 @@ func (x *fastReflection_AccountTypeRequest) Get(descriptor protoreflect.FieldDes // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_AccountNumberRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": + case "cosmos.accounts.v1.AccountNumberRequest.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest does not contain field %s", fd.FullName())) } } @@ -2738,40 +3578,40 @@ func (x *fastReflection_AccountTypeRequest) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": - panic(fmt.Errorf("field address of message cosmos.accounts.v1.AccountTypeRequest is not mutable")) + case "cosmos.accounts.v1.AccountNumberRequest.address": + panic(fmt.Errorf("field address of message cosmos.accounts.v1.AccountNumberRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest 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_AccountTypeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeRequest.address": + case "cosmos.accounts.v1.AccountNumberRequest.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberRequest")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberRequest 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_AccountTypeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_AccountNumberRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountTypeRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountNumberRequest", d.FullName())) } panic("unreachable") } @@ -2779,7 +3619,7 @@ func (x *fastReflection_AccountTypeRequest) WhichOneof(d protoreflect.OneofDescr // 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_AccountTypeRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_AccountNumberRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2790,7 +3630,7 @@ func (x *fastReflection_AccountTypeRequest) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_AccountNumberRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2802,7 +3642,7 @@ func (x *fastReflection_AccountTypeRequest) SetUnknown(fields protoreflect.RawFi // 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_AccountTypeRequest) IsValid() bool { +func (x *fastReflection_AccountNumberRequest) IsValid() bool { return x != nil } @@ -2812,9 +3652,9 @@ func (x *fastReflection_AccountTypeRequest) 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_AccountTypeRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_AccountNumberRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*AccountTypeRequest) + x := input.Message.Interface().(*AccountNumberRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2840,7 +3680,7 @@ func (x *fastReflection_AccountTypeRequest) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*AccountTypeRequest) + x := input.Message.Interface().(*AccountNumberRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2877,7 +3717,7 @@ func (x *fastReflection_AccountTypeRequest) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*AccountTypeRequest) + x := input.Message.Interface().(*AccountNumberRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2909,10 +3749,10 @@ func (x *fastReflection_AccountTypeRequest) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountNumberRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountNumberRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2983,26 +3823,26 @@ func (x *fastReflection_AccountTypeRequest) ProtoMethods() *protoiface.Methods { } var ( - md_AccountTypeResponse protoreflect.MessageDescriptor - fd_AccountTypeResponse_account_type protoreflect.FieldDescriptor + md_AccountNumberResponse protoreflect.MessageDescriptor + fd_AccountNumberResponse_number protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_query_proto_init() - md_AccountTypeResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountTypeResponse") - fd_AccountTypeResponse_account_type = md_AccountTypeResponse.Fields().ByName("account_type") + md_AccountNumberResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("AccountNumberResponse") + fd_AccountNumberResponse_number = md_AccountNumberResponse.Fields().ByName("number") } -var _ protoreflect.Message = (*fastReflection_AccountTypeResponse)(nil) +var _ protoreflect.Message = (*fastReflection_AccountNumberResponse)(nil) -type fastReflection_AccountTypeResponse AccountTypeResponse +type fastReflection_AccountNumberResponse AccountNumberResponse -func (x *AccountTypeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_AccountTypeResponse)(x) +func (x *AccountNumberResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountNumberResponse)(x) } -func (x *AccountTypeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[5] +func (x *AccountNumberResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3013,43 +3853,43 @@ func (x *AccountTypeResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_AccountTypeResponse_messageType fastReflection_AccountTypeResponse_messageType -var _ protoreflect.MessageType = fastReflection_AccountTypeResponse_messageType{} +var _fastReflection_AccountNumberResponse_messageType fastReflection_AccountNumberResponse_messageType +var _ protoreflect.MessageType = fastReflection_AccountNumberResponse_messageType{} -type fastReflection_AccountTypeResponse_messageType struct{} +type fastReflection_AccountNumberResponse_messageType struct{} -func (x fastReflection_AccountTypeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_AccountTypeResponse)(nil) +func (x fastReflection_AccountNumberResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountNumberResponse)(nil) } -func (x fastReflection_AccountTypeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_AccountTypeResponse) +func (x fastReflection_AccountNumberResponse_messageType) New() protoreflect.Message { + return new(fastReflection_AccountNumberResponse) } -func (x fastReflection_AccountTypeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_AccountTypeResponse +func (x fastReflection_AccountNumberResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountNumberResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_AccountTypeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_AccountTypeResponse +func (x *fastReflection_AccountNumberResponse) Descriptor() protoreflect.MessageDescriptor { + return md_AccountNumberResponse } // 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_AccountTypeResponse) Type() protoreflect.MessageType { - return _fastReflection_AccountTypeResponse_messageType +func (x *fastReflection_AccountNumberResponse) Type() protoreflect.MessageType { + return _fastReflection_AccountNumberResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_AccountTypeResponse) New() protoreflect.Message { - return new(fastReflection_AccountTypeResponse) +func (x *fastReflection_AccountNumberResponse) New() protoreflect.Message { + return new(fastReflection_AccountNumberResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_AccountTypeResponse) Interface() protoreflect.ProtoMessage { - return (*AccountTypeResponse)(x) +func (x *fastReflection_AccountNumberResponse) Interface() protoreflect.ProtoMessage { + return (*AccountNumberResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -3057,10 +3897,10 @@ func (x *fastReflection_AccountTypeResponse) Interface() protoreflect.ProtoMessa // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_AccountTypeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.AccountType != "" { - value := protoreflect.ValueOfString(x.AccountType) - if !f(fd_AccountTypeResponse_account_type, value) { +func (x *fastReflection_AccountNumberResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Number != uint64(0) { + value := protoreflect.ValueOfUint64(x.Number) + if !f(fd_AccountNumberResponse_number, value) { return } } @@ -3077,15 +3917,15 @@ func (x *fastReflection_AccountTypeResponse) Range(f func(protoreflect.FieldDesc // 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_AccountTypeResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_AccountNumberResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - return x.AccountType != "" + case "cosmos.accounts.v1.AccountNumberResponse.number": + return x.Number != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse does not contain field %s", fd.FullName())) } } @@ -3095,15 +3935,15 @@ func (x *fastReflection_AccountTypeResponse) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_AccountNumberResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - x.AccountType = "" + case "cosmos.accounts.v1.AccountNumberResponse.number": + x.Number = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse does not contain field %s", fd.FullName())) } } @@ -3113,16 +3953,16 @@ func (x *fastReflection_AccountTypeResponse) Clear(fd protoreflect.FieldDescript // 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_AccountTypeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - value := x.AccountType - return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.AccountNumberResponse.number": + value := x.Number + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse does not contain field %s", descriptor.FullName())) } } @@ -3136,15 +3976,15 @@ func (x *fastReflection_AccountTypeResponse) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_AccountNumberResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - x.AccountType = value.Interface().(string) + case "cosmos.accounts.v1.AccountNumberResponse.number": + x.Number = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse does not contain field %s", fd.FullName())) } } @@ -3158,40 +3998,40 @@ func (x *fastReflection_AccountTypeResponse) Set(fd protoreflect.FieldDescriptor // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - panic(fmt.Errorf("field account_type of message cosmos.accounts.v1.AccountTypeResponse is not mutable")) + case "cosmos.accounts.v1.AccountNumberResponse.number": + panic(fmt.Errorf("field number of message cosmos.accounts.v1.AccountNumberResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse 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_AccountTypeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_AccountNumberResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.AccountTypeResponse.account_type": - return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.AccountNumberResponse.number": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountTypeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.AccountNumberResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.AccountTypeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.AccountNumberResponse 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_AccountTypeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_AccountNumberResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountTypeResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.AccountNumberResponse", d.FullName())) } panic("unreachable") } @@ -3199,7 +4039,7 @@ func (x *fastReflection_AccountTypeResponse) WhichOneof(d protoreflect.OneofDesc // 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_AccountTypeResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_AccountNumberResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3210,7 +4050,7 @@ func (x *fastReflection_AccountTypeResponse) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccountTypeResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_AccountNumberResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3222,7 +4062,7 @@ func (x *fastReflection_AccountTypeResponse) SetUnknown(fields protoreflect.RawF // 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_AccountTypeResponse) IsValid() bool { +func (x *fastReflection_AccountNumberResponse) IsValid() bool { return x != nil } @@ -3232,9 +4072,9 @@ func (x *fastReflection_AccountTypeResponse) 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_AccountTypeResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_AccountNumberResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*AccountTypeResponse) + x := input.Message.Interface().(*AccountNumberResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3246,9 +4086,8 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - l = len(x.AccountType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.Number != 0 { + n += 1 + runtime.Sov(uint64(x.Number)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -3260,7 +4099,7 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*AccountTypeResponse) + x := input.Message.Interface().(*AccountNumberResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3279,12 +4118,10 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.AccountType) > 0 { - i -= len(x.AccountType) - copy(dAtA[i:], x.AccountType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccountType))) + if x.Number != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -3297,7 +4134,7 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*AccountTypeResponse) + x := input.Message.Interface().(*AccountNumberResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3329,17 +4166,17 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountNumberResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountTypeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountNumberResponse: 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 AccountType", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) } - var stringLen uint64 + x.Number = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3349,24 +4186,11 @@ func (x *fastReflection_AccountTypeResponse) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.Number |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - 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 - } - x.AccountType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3424,7 +4248,7 @@ func (x *SimulateUserOperationRequest) ProtoReflect() protoreflect.Message { } func (x *SimulateUserOperationRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3921,7 +4745,7 @@ func (x *SimulateUserOperationResponse) ProtoReflect() protoreflect.Message { } func (x *SimulateUserOperationResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4598,6 +5422,81 @@ func (x *AccountTypeResponse) GetAccountType() string { return "" } +// AccountNumberRequest returns the account number given the address. +type AccountNumberRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the address of the account we want to know the number of. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *AccountNumberRequest) Reset() { + *x = AccountNumberRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountNumberRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountNumberRequest) ProtoMessage() {} + +// Deprecated: Use AccountNumberRequest.ProtoReflect.Descriptor instead. +func (*AccountNumberRequest) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *AccountNumberRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// AccountNumberResponse is the response returned when querying the +// account number by address. +type AccountNumberResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // number is the account number of the provided address. + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` +} + +func (x *AccountNumberResponse) Reset() { + *x = AccountNumberResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountNumberResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountNumberResponse) ProtoMessage() {} + +// Deprecated: Use AccountNumberResponse.ProtoReflect.Descriptor instead. +func (*AccountNumberResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *AccountNumberResponse) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + // SimulateUserOperationRequest is the query request used to simulate a // UserOperation. type SimulateUserOperationRequest struct { @@ -4615,7 +5514,7 @@ type SimulateUserOperationRequest struct { func (x *SimulateUserOperationRequest) Reset() { *x = SimulateUserOperationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4629,7 +5528,7 @@ func (*SimulateUserOperationRequest) ProtoMessage() {} // Deprecated: Use SimulateUserOperationRequest.ProtoReflect.Descriptor instead. func (*SimulateUserOperationRequest) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{6} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{8} } func (x *SimulateUserOperationRequest) GetBundler() string { @@ -4660,7 +5559,7 @@ type SimulateUserOperationResponse struct { func (x *SimulateUserOperationResponse) Reset() { *x = SimulateUserOperationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4674,7 +5573,7 @@ func (*SimulateUserOperationResponse) ProtoMessage() {} // Deprecated: Use SimulateUserOperationResponse.ProtoReflect.Descriptor instead. func (*SimulateUserOperationResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{7} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{9} } func (x *SimulateUserOperationResponse) GetUserOperationResponse() *UserOperationResponse { @@ -4701,7 +5600,7 @@ type SchemaResponse_Handler struct { func (x *SchemaResponse_Handler) Reset() { *x = SchemaResponse_Handler{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4784,62 +5683,75 @@ var file_cosmos_accounts_v1_query_proto_rawDesc = []byte{ 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x82, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x0e, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x17, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x15, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa1, 0x03, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x63, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0b, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, + 0x30, 0x0a, 0x14, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x2f, 0x0a, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x22, 0x82, 0x01, 0x0a, 0x1c, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x48, 0x0a, + 0x0e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x6d, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x17, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, - 0x15, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, + 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x15, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x89, 0x04, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x63, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, + 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x66, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x15, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, - 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbe, 0x01, - 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbe, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2e, 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, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -4854,7 +5766,7 @@ func file_cosmos_accounts_v1_query_proto_rawDescGZIP() []byte { return file_cosmos_accounts_v1_query_proto_rawDescData } -var file_cosmos_accounts_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_cosmos_accounts_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cosmos_accounts_v1_query_proto_goTypes = []interface{}{ (*AccountQueryRequest)(nil), // 0: cosmos.accounts.v1.AccountQueryRequest (*AccountQueryResponse)(nil), // 1: cosmos.accounts.v1.AccountQueryResponse @@ -4862,31 +5774,35 @@ var file_cosmos_accounts_v1_query_proto_goTypes = []interface{}{ (*SchemaResponse)(nil), // 3: cosmos.accounts.v1.SchemaResponse (*AccountTypeRequest)(nil), // 4: cosmos.accounts.v1.AccountTypeRequest (*AccountTypeResponse)(nil), // 5: cosmos.accounts.v1.AccountTypeResponse - (*SimulateUserOperationRequest)(nil), // 6: cosmos.accounts.v1.SimulateUserOperationRequest - (*SimulateUserOperationResponse)(nil), // 7: cosmos.accounts.v1.SimulateUserOperationResponse - (*SchemaResponse_Handler)(nil), // 8: cosmos.accounts.v1.SchemaResponse.Handler - (*anypb.Any)(nil), // 9: google.protobuf.Any - (*UserOperation)(nil), // 10: cosmos.accounts.v1.UserOperation - (*UserOperationResponse)(nil), // 11: cosmos.accounts.v1.UserOperationResponse + (*AccountNumberRequest)(nil), // 6: cosmos.accounts.v1.AccountNumberRequest + (*AccountNumberResponse)(nil), // 7: cosmos.accounts.v1.AccountNumberResponse + (*SimulateUserOperationRequest)(nil), // 8: cosmos.accounts.v1.SimulateUserOperationRequest + (*SimulateUserOperationResponse)(nil), // 9: cosmos.accounts.v1.SimulateUserOperationResponse + (*SchemaResponse_Handler)(nil), // 10: cosmos.accounts.v1.SchemaResponse.Handler + (*anypb.Any)(nil), // 11: google.protobuf.Any + (*UserOperation)(nil), // 12: cosmos.accounts.v1.UserOperation + (*UserOperationResponse)(nil), // 13: cosmos.accounts.v1.UserOperationResponse } var file_cosmos_accounts_v1_query_proto_depIdxs = []int32{ - 9, // 0: cosmos.accounts.v1.AccountQueryRequest.request:type_name -> google.protobuf.Any - 9, // 1: cosmos.accounts.v1.AccountQueryResponse.response:type_name -> google.protobuf.Any - 8, // 2: cosmos.accounts.v1.SchemaResponse.init_schema:type_name -> cosmos.accounts.v1.SchemaResponse.Handler - 8, // 3: cosmos.accounts.v1.SchemaResponse.execute_handlers:type_name -> cosmos.accounts.v1.SchemaResponse.Handler - 8, // 4: cosmos.accounts.v1.SchemaResponse.query_handlers:type_name -> cosmos.accounts.v1.SchemaResponse.Handler - 10, // 5: cosmos.accounts.v1.SimulateUserOperationRequest.user_operation:type_name -> cosmos.accounts.v1.UserOperation - 11, // 6: cosmos.accounts.v1.SimulateUserOperationResponse.user_operation_response:type_name -> cosmos.accounts.v1.UserOperationResponse + 11, // 0: cosmos.accounts.v1.AccountQueryRequest.request:type_name -> google.protobuf.Any + 11, // 1: cosmos.accounts.v1.AccountQueryResponse.response:type_name -> google.protobuf.Any + 10, // 2: cosmos.accounts.v1.SchemaResponse.init_schema:type_name -> cosmos.accounts.v1.SchemaResponse.Handler + 10, // 3: cosmos.accounts.v1.SchemaResponse.execute_handlers:type_name -> cosmos.accounts.v1.SchemaResponse.Handler + 10, // 4: cosmos.accounts.v1.SchemaResponse.query_handlers:type_name -> cosmos.accounts.v1.SchemaResponse.Handler + 12, // 5: cosmos.accounts.v1.SimulateUserOperationRequest.user_operation:type_name -> cosmos.accounts.v1.UserOperation + 13, // 6: cosmos.accounts.v1.SimulateUserOperationResponse.user_operation_response:type_name -> cosmos.accounts.v1.UserOperationResponse 0, // 7: cosmos.accounts.v1.Query.AccountQuery:input_type -> cosmos.accounts.v1.AccountQueryRequest 2, // 8: cosmos.accounts.v1.Query.Schema:input_type -> cosmos.accounts.v1.SchemaRequest 4, // 9: cosmos.accounts.v1.Query.AccountType:input_type -> cosmos.accounts.v1.AccountTypeRequest - 6, // 10: cosmos.accounts.v1.Query.SimulateUserOperation:input_type -> cosmos.accounts.v1.SimulateUserOperationRequest - 1, // 11: cosmos.accounts.v1.Query.AccountQuery:output_type -> cosmos.accounts.v1.AccountQueryResponse - 3, // 12: cosmos.accounts.v1.Query.Schema:output_type -> cosmos.accounts.v1.SchemaResponse - 5, // 13: cosmos.accounts.v1.Query.AccountType:output_type -> cosmos.accounts.v1.AccountTypeResponse - 7, // 14: cosmos.accounts.v1.Query.SimulateUserOperation:output_type -> cosmos.accounts.v1.SimulateUserOperationResponse - 11, // [11:15] is the sub-list for method output_type - 7, // [7:11] is the sub-list for method input_type + 6, // 10: cosmos.accounts.v1.Query.AccountNumber:input_type -> cosmos.accounts.v1.AccountNumberRequest + 8, // 11: cosmos.accounts.v1.Query.SimulateUserOperation:input_type -> cosmos.accounts.v1.SimulateUserOperationRequest + 1, // 12: cosmos.accounts.v1.Query.AccountQuery:output_type -> cosmos.accounts.v1.AccountQueryResponse + 3, // 13: cosmos.accounts.v1.Query.Schema:output_type -> cosmos.accounts.v1.SchemaResponse + 5, // 14: cosmos.accounts.v1.Query.AccountType:output_type -> cosmos.accounts.v1.AccountTypeResponse + 7, // 15: cosmos.accounts.v1.Query.AccountNumber:output_type -> cosmos.accounts.v1.AccountNumberResponse + 9, // 16: cosmos.accounts.v1.Query.SimulateUserOperation:output_type -> cosmos.accounts.v1.SimulateUserOperationResponse + 12, // [12:17] is the sub-list for method output_type + 7, // [7:12] 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 @@ -4972,7 +5888,7 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimulateUserOperationRequest); i { + switch v := v.(*AccountNumberRequest); i { case 0: return &v.state case 1: @@ -4984,7 +5900,7 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimulateUserOperationResponse); i { + switch v := v.(*AccountNumberResponse); i { case 0: return &v.state case 1: @@ -4996,6 +5912,30 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimulateUserOperationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimulateUserOperationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SchemaResponse_Handler); i { case 0: return &v.state @@ -5014,7 +5954,7 @@ func file_cosmos_accounts_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/accounts/v1/query_grpc.pb.go b/api/cosmos/accounts/v1/query_grpc.pb.go index 7e1b2d97e814..0f895be835dd 100644 --- a/api/cosmos/accounts/v1/query_grpc.pb.go +++ b/api/cosmos/accounts/v1/query_grpc.pb.go @@ -22,6 +22,7 @@ const ( Query_AccountQuery_FullMethodName = "/cosmos.accounts.v1.Query/AccountQuery" Query_Schema_FullMethodName = "/cosmos.accounts.v1.Query/Schema" Query_AccountType_FullMethodName = "/cosmos.accounts.v1.Query/AccountType" + Query_AccountNumber_FullMethodName = "/cosmos.accounts.v1.Query/AccountNumber" Query_SimulateUserOperation_FullMethodName = "/cosmos.accounts.v1.Query/SimulateUserOperation" ) @@ -35,6 +36,8 @@ type QueryClient interface { Schema(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) // AccountType returns the account type for an address. AccountType(ctx context.Context, in *AccountTypeRequest, opts ...grpc.CallOption) (*AccountTypeResponse, error) + // AccountNumber returns the account number given the account address. + AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error) // SimulateUserOperation simulates a user operation. SimulateUserOperation(ctx context.Context, in *SimulateUserOperationRequest, opts ...grpc.CallOption) (*SimulateUserOperationResponse, error) } @@ -74,6 +77,15 @@ func (c *queryClient) AccountType(ctx context.Context, in *AccountTypeRequest, o return out, nil } +func (c *queryClient) AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error) { + out := new(AccountNumberResponse) + err := c.cc.Invoke(ctx, Query_AccountNumber_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) SimulateUserOperation(ctx context.Context, in *SimulateUserOperationRequest, opts ...grpc.CallOption) (*SimulateUserOperationResponse, error) { out := new(SimulateUserOperationResponse) err := c.cc.Invoke(ctx, Query_SimulateUserOperation_FullMethodName, in, out, opts...) @@ -93,6 +105,8 @@ type QueryServer interface { Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) // AccountType returns the account type for an address. AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) + // AccountNumber returns the account number given the account address. + AccountNumber(context.Context, *AccountNumberRequest) (*AccountNumberResponse, error) // SimulateUserOperation simulates a user operation. SimulateUserOperation(context.Context, *SimulateUserOperationRequest) (*SimulateUserOperationResponse, error) mustEmbedUnimplementedQueryServer() @@ -111,6 +125,9 @@ func (UnimplementedQueryServer) Schema(context.Context, *SchemaRequest) (*Schema func (UnimplementedQueryServer) AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountType not implemented") } +func (UnimplementedQueryServer) AccountNumber(context.Context, *AccountNumberRequest) (*AccountNumberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountNumber not implemented") +} func (UnimplementedQueryServer) SimulateUserOperation(context.Context, *SimulateUserOperationRequest) (*SimulateUserOperationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SimulateUserOperation not implemented") } @@ -181,6 +198,24 @@ func _Query_AccountType_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_AccountNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountNumberRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountNumber(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AccountNumber_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountNumber(ctx, req.(*AccountNumberRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_SimulateUserOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SimulateUserOperationRequest) if err := dec(in); err != nil { @@ -218,6 +253,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "AccountType", Handler: _Query_AccountType_Handler, }, + { + MethodName: "AccountNumber", + Handler: _Query_AccountNumber_Handler, + }, { MethodName: "SimulateUserOperation", Handler: _Query_SimulateUserOperation_Handler, diff --git a/proto/cosmos/accounts/v1/query.proto b/proto/cosmos/accounts/v1/query.proto index 7e779d130870..297b3a95b60f 100644 --- a/proto/cosmos/accounts/v1/query.proto +++ b/proto/cosmos/accounts/v1/query.proto @@ -15,6 +15,8 @@ service Query { rpc Schema(SchemaRequest) returns (SchemaResponse) {}; // AccountType returns the account type for an address. rpc AccountType(AccountTypeRequest) returns (AccountTypeResponse) {}; + // AccountNumber returns the account number given the account address. + rpc AccountNumber(AccountNumberRequest) returns (AccountNumberResponse) {}; // SimulateUserOperation simulates a user operation. rpc SimulateUserOperation(SimulateUserOperationRequest) returns (SimulateUserOperationResponse) {}; } @@ -70,6 +72,19 @@ message AccountTypeResponse { string account_type = 1; } +// AccountNumberRequest returns the account number given the address. +message AccountNumberRequest { + // address is the address of the account we want to know the number of. + string address = 1; +} + +// AccountNumberResponse is the response returned when querying the +// account number by address. +message AccountNumberResponse { + // number is the account number of the provided address. + uint64 number = 1; +} + // SimulateUserOperationRequest is the query request used to simulate a // UserOperation. message SimulateUserOperationRequest { diff --git a/x/accounts/query_server.go b/x/accounts/query_server.go index 8f0ea2e79b2e..a5b25782016b 100644 --- a/x/accounts/query_server.go +++ b/x/accounts/query_server.go @@ -72,7 +72,20 @@ func (q queryServer) AccountType(ctx context.Context, request *v1.AccountTypeReq }, nil } +func (q queryServer) AccountNumber(ctx context.Context, request *v1.AccountNumberRequest) (*v1.AccountNumberResponse, error) { + addr, err := q.k.addressCodec.StringToBytes(request.Address) + if err != nil { + return nil, err + } + number, err := q.k.AccountByNumber.Get(ctx, addr) + if err != nil { + return nil, err + } + return &v1.AccountNumberResponse{Number: number}, nil +} + const ( + // TODO(tip): evaluate if the following numbers should be parametrised over state, or over the node. SimulateAuthenticateGasLimit = 1_000_000 SimulateBundlerPaymentGasLimit = SimulateAuthenticateGasLimit ExecuteGasLimit = SimulateAuthenticateGasLimit diff --git a/x/accounts/query_server_test.go b/x/accounts/query_server_test.go index 6ff2ee30bcc3..bc4913458a28 100644 --- a/x/accounts/query_server_test.go +++ b/x/accounts/query_server_test.go @@ -23,7 +23,7 @@ func TestQueryServer(t *testing.T) { ms := NewMsgServer(k) qs := NewQueryServer(k) - // create + // create account initMsg, err := implementation.PackAny(&emptypb.Empty{}) require.NoError(t, err) @@ -34,19 +34,32 @@ func TestQueryServer(t *testing.T) { }) require.NoError(t, err) - // query - req := &wrapperspb.UInt64Value{Value: 10} - anypbReq, err := implementation.PackAny(req) - require.NoError(t, err) + t.Run("account query", func(t *testing.T) { + // query + req := &wrapperspb.UInt64Value{Value: 10} + anypbReq, err := implementation.PackAny(req) + require.NoError(t, err) + + queryResp, err := qs.AccountQuery(ctx, &v1.AccountQueryRequest{ + Target: initResp.AccountAddress, + Request: anypbReq, + }) + require.NoError(t, err) - queryResp, err := qs.AccountQuery(ctx, &v1.AccountQueryRequest{ - Target: initResp.AccountAddress, - Request: anypbReq, + resp, err := implementation.UnpackAnyRaw(queryResp.Response) + require.NoError(t, err) + require.Equal(t, "10", resp.(*types.StringValue).Value) }) - require.NoError(t, err) - resp, err := implementation.UnpackAnyRaw(queryResp.Response) - require.NoError(t, err) + t.Run("account number", func(t *testing.T) { + numResp, err := qs.AccountNumber(ctx, &v1.AccountNumberRequest{Address: initResp.AccountAddress}) + require.NoError(t, err) + require.Equal(t, 0, int(numResp.Number)) + }) - require.Equal(t, "10", resp.(*types.StringValue).Value) + t.Run("account type", func(t *testing.T) { + typ, err := qs.AccountType(ctx, &v1.AccountTypeRequest{Address: initResp.AccountAddress}) + require.NoError(t, err) + require.Equal(t, "test", typ.AccountType) + }) } diff --git a/x/accounts/v1/query.pb.go b/x/accounts/v1/query.pb.go index 70aa10ff7a4f..9e96f6e6545a 100644 --- a/x/accounts/v1/query.pb.go +++ b/x/accounts/v1/query.pb.go @@ -388,6 +388,99 @@ func (m *AccountTypeResponse) GetAccountType() string { return "" } +// AccountNumberRequest returns the account number given the address. +type AccountNumberRequest struct { + // address is the address of the account we want to know the number of. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *AccountNumberRequest) Reset() { *m = AccountNumberRequest{} } +func (m *AccountNumberRequest) String() string { return proto.CompactTextString(m) } +func (*AccountNumberRequest) ProtoMessage() {} +func (*AccountNumberRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_16ad14c22e3080d2, []int{6} +} +func (m *AccountNumberRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountNumberRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountNumberRequest.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 *AccountNumberRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountNumberRequest.Merge(m, src) +} +func (m *AccountNumberRequest) XXX_Size() int { + return m.Size() +} +func (m *AccountNumberRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AccountNumberRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountNumberRequest proto.InternalMessageInfo + +func (m *AccountNumberRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// AccountNumberResponse is the response returned when querying the +// account number by address. +type AccountNumberResponse struct { + // number is the account number of the provided address. + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` +} + +func (m *AccountNumberResponse) Reset() { *m = AccountNumberResponse{} } +func (m *AccountNumberResponse) String() string { return proto.CompactTextString(m) } +func (*AccountNumberResponse) ProtoMessage() {} +func (*AccountNumberResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16ad14c22e3080d2, []int{7} +} +func (m *AccountNumberResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountNumberResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountNumberResponse.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 *AccountNumberResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountNumberResponse.Merge(m, src) +} +func (m *AccountNumberResponse) XXX_Size() int { + return m.Size() +} +func (m *AccountNumberResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AccountNumberResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountNumberResponse proto.InternalMessageInfo + +func (m *AccountNumberResponse) GetNumber() uint64 { + if m != nil { + return m.Number + } + return 0 +} + // SimulateUserOperationRequest is the query request used to simulate a // UserOperation. type SimulateUserOperationRequest struct { @@ -402,7 +495,7 @@ func (m *SimulateUserOperationRequest) Reset() { *m = SimulateUserOperat func (m *SimulateUserOperationRequest) String() string { return proto.CompactTextString(m) } func (*SimulateUserOperationRequest) ProtoMessage() {} func (*SimulateUserOperationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{6} + return fileDescriptor_16ad14c22e3080d2, []int{8} } func (m *SimulateUserOperationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +549,7 @@ func (m *SimulateUserOperationResponse) Reset() { *m = SimulateUserOpera func (m *SimulateUserOperationResponse) String() string { return proto.CompactTextString(m) } func (*SimulateUserOperationResponse) ProtoMessage() {} func (*SimulateUserOperationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{7} + return fileDescriptor_16ad14c22e3080d2, []int{9} } func (m *SimulateUserOperationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -500,6 +593,8 @@ func init() { proto.RegisterType((*SchemaResponse_Handler)(nil), "cosmos.accounts.v1.SchemaResponse.Handler") proto.RegisterType((*AccountTypeRequest)(nil), "cosmos.accounts.v1.AccountTypeRequest") proto.RegisterType((*AccountTypeResponse)(nil), "cosmos.accounts.v1.AccountTypeResponse") + proto.RegisterType((*AccountNumberRequest)(nil), "cosmos.accounts.v1.AccountNumberRequest") + proto.RegisterType((*AccountNumberResponse)(nil), "cosmos.accounts.v1.AccountNumberResponse") proto.RegisterType((*SimulateUserOperationRequest)(nil), "cosmos.accounts.v1.SimulateUserOperationRequest") proto.RegisterType((*SimulateUserOperationResponse)(nil), "cosmos.accounts.v1.SimulateUserOperationResponse") } @@ -507,43 +602,45 @@ func init() { func init() { proto.RegisterFile("cosmos/accounts/v1/query.proto", fileDescriptor_16ad14c22e3080d2) } var fileDescriptor_16ad14c22e3080d2 = []byte{ - // 563 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x8e, 0x12, 0x41, - 0x10, 0x66, 0xd8, 0x08, 0x5a, 0x2c, 0x68, 0xda, 0x5d, 0xc5, 0x89, 0x4e, 0x60, 0x0e, 0x2e, 0x1a, - 0xd3, 0xb3, 0xa0, 0x07, 0x6f, 0x06, 0x4f, 0x24, 0x1e, 0x0c, 0xac, 0x7b, 0x31, 0x31, 0xd8, 0x0c, - 0x2d, 0x4b, 0x84, 0x69, 0xb6, 0x7f, 0x36, 0xcb, 0xc5, 0x83, 0x4f, 0xe0, 0x2b, 0xf8, 0x36, 0x7b, - 0xdc, 0xa3, 0x47, 0x03, 0x2f, 0x62, 0x98, 0xee, 0x86, 0x41, 0x67, 0x41, 0x6e, 0x53, 0x5d, 0x5f, - 0x7d, 0x5f, 0x75, 0xd5, 0xd7, 0x03, 0x5e, 0xc8, 0xc4, 0x98, 0x89, 0x80, 0x84, 0x21, 0x53, 0x91, - 0x14, 0xc1, 0x45, 0x3d, 0x38, 0x57, 0x94, 0x4f, 0xf1, 0x84, 0x33, 0xc9, 0x10, 0xd2, 0x79, 0x6c, - 0xf3, 0xf8, 0xa2, 0xee, 0x3e, 0x1a, 0x30, 0x36, 0x18, 0xd1, 0x20, 0x46, 0xf4, 0xd4, 0x97, 0x80, - 0x44, 0x06, 0xee, 0xbe, 0x48, 0xa1, 0x33, 0xdf, 0x5d, 0xd2, 0x13, 0x92, 0x93, 0x50, 0x0e, 0x59, - 0xa4, 0xd1, 0xfe, 0x27, 0xb8, 0xdf, 0xd4, 0xc9, 0xf6, 0x42, 0xb2, 0x43, 0xcf, 0x15, 0x15, 0x12, - 0x3d, 0x80, 0x9c, 0x24, 0x7c, 0x40, 0x65, 0xd9, 0xa9, 0x38, 0xb5, 0x3b, 0x1d, 0x13, 0x21, 0x0c, - 0x79, 0xae, 0x21, 0xe5, 0x6c, 0xc5, 0xa9, 0x15, 0x1a, 0x07, 0x58, 0x77, 0x82, 0x6d, 0x27, 0xb8, - 0x19, 0x4d, 0x3b, 0x16, 0xe4, 0xb7, 0xe0, 0x60, 0x9d, 0x5e, 0x4c, 0x58, 0x24, 0x28, 0x3a, 0x86, - 0xdb, 0xdc, 0x7c, 0xc7, 0x0a, 0x37, 0x11, 0x2d, 0x51, 0x7e, 0x03, 0x8a, 0x27, 0xe1, 0x19, 0x1d, - 0x13, 0xdb, 0x62, 0x15, 0xf6, 0xed, 0xb5, 0xe4, 0x74, 0x42, 0x4d, 0xa3, 0x05, 0x73, 0xf6, 0x61, - 0x3a, 0xa1, 0xfe, 0x55, 0x16, 0x4a, 0xb6, 0xc8, 0x08, 0xbf, 0x83, 0xc2, 0x30, 0x1a, 0xca, 0xae, - 0x88, 0x8f, 0x8d, 0xf6, 0x73, 0xfc, 0xef, 0x88, 0xf1, 0x7a, 0x21, 0x6e, 0x91, 0xa8, 0x3f, 0xa2, - 0xbc, 0x03, 0x8b, 0x72, 0x9d, 0x43, 0xa7, 0x70, 0x8f, 0x5e, 0xd2, 0x50, 0x49, 0xda, 0x3d, 0xd3, - 0x69, 0x51, 0xce, 0x56, 0xf6, 0x76, 0x64, 0xbc, 0x6b, 0x38, 0x4c, 0x2c, 0x50, 0x1b, 0x4a, 0xf1, - 0xfe, 0x57, 0xa4, 0x7b, 0x3b, 0x93, 0x16, 0x63, 0x06, 0x4b, 0xe9, 0xbe, 0x81, 0xbc, 0xf9, 0x46, - 0xe5, 0xd5, 0x0a, 0xf5, 0xc8, 0x6c, 0x88, 0xdc, 0xc4, 0x52, 0xb2, 0x71, 0x6a, 0x35, 0x7e, 0x0c, - 0xa8, 0xb9, 0x9a, 0xac, 0xdd, 0x41, 0x19, 0xf2, 0xa4, 0xdf, 0xe7, 0x54, 0x08, 0xcb, 0x65, 0x42, - 0xff, 0xf5, 0xd2, 0x57, 0x1a, 0x6f, 0xc6, 0xff, 0x1f, 0x4b, 0xfb, 0xee, 0xc0, 0xe3, 0x93, 0xe1, - 0x58, 0x8d, 0x88, 0xa4, 0xa7, 0x82, 0xf2, 0xf7, 0x13, 0xca, 0xc9, 0xc2, 0xb1, 0x09, 0xd1, 0x9e, - 0x8a, 0xef, 0x62, 0x45, 0x4d, 0x88, 0x5a, 0x50, 0x52, 0x82, 0xf2, 0x2e, 0xb3, 0x25, 0xc6, 0xa4, - 0xd5, 0xb4, 0xc1, 0xad, 0x73, 0x17, 0x55, 0x32, 0x5c, 0x34, 0xf1, 0xe4, 0x86, 0x26, 0xcc, 0x4d, - 0x08, 0x3c, 0x5c, 0xd7, 0xea, 0xfe, 0x65, 0xe8, 0x67, 0xdb, 0x45, 0x4d, 0x41, 0xe7, 0x50, 0xa5, - 0x1d, 0x37, 0x7e, 0xee, 0xc1, 0xad, 0xf8, 0xd9, 0xa0, 0x10, 0xf6, 0x93, 0xcf, 0x08, 0x1d, 0xa5, - 0x71, 0xa7, 0xbc, 0x63, 0xb7, 0xb6, 0x1d, 0x68, 0x16, 0x9c, 0x41, 0x6d, 0xc8, 0x19, 0x5f, 0x57, - 0x37, 0x19, 0x4d, 0x13, 0xfb, 0xdb, 0xbd, 0xe8, 0x67, 0xd0, 0x67, 0x28, 0x24, 0x5c, 0x80, 0x9e, - 0x6e, 0xe8, 0x26, 0x61, 0x2b, 0xf7, 0x68, 0x2b, 0x6e, 0xa9, 0xf0, 0x0d, 0x0e, 0x53, 0xf7, 0x84, - 0x8e, 0x53, 0x1b, 0xdc, 0xe0, 0x2b, 0xb7, 0xbe, 0x43, 0x85, 0xd5, 0x7f, 0xfb, 0xea, 0x6a, 0xe6, - 0x39, 0xd7, 0x33, 0xcf, 0xf9, 0x3d, 0xf3, 0x9c, 0x1f, 0x73, 0x2f, 0x73, 0x3d, 0xf7, 0x32, 0xbf, - 0xe6, 0x5e, 0xe6, 0xa3, 0xab, 0xd9, 0x44, 0xff, 0x2b, 0x1e, 0xb2, 0xe0, 0x32, 0xf9, 0x3f, 0xee, - 0xe5, 0xe2, 0x9f, 0xdc, 0xcb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x77, 0xb6, 0x2c, 0xc3, 0xfb, - 0x05, 0x00, 0x00, + // 608 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0x12, 0x41, + 0x14, 0x66, 0x69, 0xa5, 0xfa, 0x28, 0xd5, 0x8c, 0xa5, 0xe2, 0x46, 0x37, 0xb0, 0x07, 0x4b, 0x8d, + 0x99, 0x05, 0xf4, 0xe0, 0xcd, 0xe0, 0x89, 0xc4, 0x44, 0xc3, 0xd6, 0x5e, 0x4c, 0x0c, 0x2e, 0xcb, + 0x94, 0x12, 0x61, 0x97, 0xce, 0xec, 0x34, 0xe5, 0xe2, 0xc1, 0x9b, 0x37, 0xff, 0xac, 0x1e, 0x7b, + 0xf4, 0x68, 0xe0, 0x1f, 0x31, 0xcc, 0x0f, 0xd8, 0xad, 0x5b, 0x28, 0xb7, 0x79, 0xf3, 0xde, 0xfb, + 0xbe, 0xb7, 0xef, 0x7d, 0x6f, 0x16, 0x2c, 0x3f, 0x64, 0xa3, 0x90, 0x39, 0x9e, 0xef, 0x87, 0x3c, + 0x88, 0x98, 0x73, 0x51, 0x77, 0xce, 0x39, 0xa1, 0x13, 0x3c, 0xa6, 0x61, 0x14, 0x22, 0x24, 0xfd, + 0x58, 0xfb, 0xf1, 0x45, 0xdd, 0x7c, 0xda, 0x0f, 0xc3, 0xfe, 0x90, 0x38, 0x22, 0xa2, 0xcb, 0x4f, + 0x1d, 0x2f, 0x50, 0xe1, 0xe6, 0xab, 0x14, 0x38, 0x75, 0xee, 0x78, 0x5d, 0x16, 0x51, 0xcf, 0x8f, + 0x06, 0x61, 0x20, 0xa3, 0xed, 0xaf, 0xf0, 0xb8, 0x29, 0x9d, 0xed, 0x39, 0xa5, 0x4b, 0xce, 0x39, + 0x61, 0x11, 0x3a, 0x80, 0x5c, 0xe4, 0xd1, 0x3e, 0x89, 0x4a, 0x46, 0xd9, 0xa8, 0x3e, 0x70, 0x95, + 0x85, 0x30, 0xec, 0x50, 0x19, 0x52, 0xca, 0x96, 0x8d, 0x6a, 0xbe, 0xb1, 0x8f, 0x65, 0x25, 0x58, + 0x57, 0x82, 0x9b, 0xc1, 0xc4, 0xd5, 0x41, 0x76, 0x0b, 0xf6, 0x93, 0xf0, 0x6c, 0x1c, 0x06, 0x8c, + 0xa0, 0x1a, 0xdc, 0xa7, 0xea, 0x2c, 0x18, 0x6e, 0x03, 0x5a, 0x44, 0xd9, 0x0d, 0x28, 0x1c, 0xfb, + 0x67, 0x64, 0xe4, 0xe9, 0x12, 0x2b, 0xb0, 0xab, 0x3f, 0x2b, 0x9a, 0x8c, 0x89, 0x2a, 0x34, 0xaf, + 0xee, 0x3e, 0x4f, 0xc6, 0xc4, 0xbe, 0xca, 0xc2, 0x9e, 0x4e, 0x52, 0xc4, 0x1f, 0x20, 0x3f, 0x08, + 0x06, 0x51, 0x87, 0x89, 0x6b, 0xc5, 0xfd, 0x12, 0xff, 0xdf, 0x62, 0x9c, 0x4c, 0xc4, 0x2d, 0x2f, + 0xe8, 0x0d, 0x09, 0x75, 0x61, 0x9e, 0x2e, 0x7d, 0xe8, 0x04, 0x1e, 0x91, 0x4b, 0xe2, 0xf3, 0x88, + 0x74, 0xce, 0xa4, 0x9b, 0x95, 0xb2, 0xe5, 0xad, 0x0d, 0x11, 0x1f, 0x2a, 0x0c, 0x65, 0x33, 0xd4, + 0x86, 0x3d, 0x31, 0xff, 0x25, 0xe8, 0xd6, 0xc6, 0xa0, 0x05, 0x81, 0xa0, 0x21, 0xcd, 0x77, 0xb0, + 0xa3, 0xce, 0xa8, 0xb4, 0x1c, 0xa1, 0x6c, 0x99, 0x36, 0x91, 0x19, 0x1b, 0x4a, 0x56, 0xb8, 0x96, + 0xed, 0xc7, 0x80, 0x9a, 0xcb, 0xce, 0xea, 0x19, 0x94, 0x60, 0xc7, 0xeb, 0xf5, 0x28, 0x61, 0x4c, + 0x63, 0x29, 0xd3, 0x7e, 0xbb, 0xd0, 0x95, 0x8c, 0x57, 0xed, 0xbf, 0xc3, 0xd0, 0x6a, 0x0b, 0xc9, + 0x7c, 0xe4, 0xa3, 0x2e, 0xa1, 0xeb, 0xb9, 0x1c, 0x28, 0xde, 0xc8, 0x50, 0x6c, 0x07, 0x90, 0x0b, + 0xc4, 0x8d, 0xc8, 0xd8, 0x76, 0x95, 0x65, 0xff, 0x34, 0xe0, 0xd9, 0xf1, 0x60, 0xc4, 0x87, 0x5e, + 0x44, 0x4e, 0x18, 0xa1, 0x9f, 0xc6, 0x84, 0x7a, 0xf3, 0xa5, 0x88, 0x71, 0x75, 0xb9, 0x68, 0x97, + 0xe6, 0x52, 0x26, 0x6a, 0xc1, 0x1e, 0x67, 0x84, 0x76, 0x42, 0x9d, 0xa2, 0xf6, 0xa0, 0x92, 0x36, + 0x9b, 0x24, 0x76, 0x81, 0xc7, 0xcd, 0x79, 0x11, 0xcf, 0x6f, 0x29, 0x42, 0x95, 0xef, 0xc1, 0x93, + 0x24, 0x57, 0xe7, 0xc6, 0xce, 0x1c, 0xad, 0x27, 0x55, 0x09, 0x6e, 0x91, 0xa7, 0x5d, 0x37, 0x7e, + 0x6d, 0xc3, 0x3d, 0xb1, 0x99, 0xc8, 0x87, 0xdd, 0xf8, 0xa6, 0xa2, 0xc3, 0x34, 0xec, 0x94, 0xa7, + 0xc2, 0xac, 0xae, 0x0f, 0x54, 0x1a, 0xca, 0xa0, 0x36, 0xe4, 0xd4, 0xea, 0x54, 0x56, 0x69, 0x59, + 0x02, 0xdb, 0xeb, 0xe5, 0x6e, 0x67, 0xd0, 0x37, 0xc8, 0xc7, 0x84, 0x86, 0x5e, 0xac, 0xa8, 0x26, + 0xa6, 0x5c, 0xf3, 0x70, 0x6d, 0xdc, 0x82, 0xe1, 0x14, 0x0a, 0x09, 0x79, 0xa1, 0x55, 0x5f, 0x9c, + 0xd0, 0xac, 0x79, 0x74, 0x87, 0xc8, 0x05, 0xcf, 0x0f, 0x28, 0xa6, 0xea, 0x01, 0xd5, 0x52, 0x1b, + 0xb1, 0x42, 0xbf, 0x66, 0x7d, 0x83, 0x0c, 0xcd, 0xff, 0xfe, 0xcd, 0xd5, 0xd4, 0x32, 0xae, 0xa7, + 0x96, 0xf1, 0x77, 0x6a, 0x19, 0xbf, 0x67, 0x56, 0xe6, 0x7a, 0x66, 0x65, 0xfe, 0xcc, 0xac, 0xcc, + 0x17, 0x53, 0xa2, 0xb1, 0xde, 0x77, 0x3c, 0x08, 0x9d, 0xcb, 0xf8, 0xaf, 0xa5, 0x9b, 0x13, 0xef, + 0xf5, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xc0, 0xe6, 0x63, 0xc6, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -564,6 +661,8 @@ type QueryClient interface { Schema(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) // AccountType returns the account type for an address. AccountType(ctx context.Context, in *AccountTypeRequest, opts ...grpc.CallOption) (*AccountTypeResponse, error) + // AccountNumber returns the account number given the account address. + AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error) // SimulateUserOperation simulates a user operation. SimulateUserOperation(ctx context.Context, in *SimulateUserOperationRequest, opts ...grpc.CallOption) (*SimulateUserOperationResponse, error) } @@ -603,6 +702,15 @@ func (c *queryClient) AccountType(ctx context.Context, in *AccountTypeRequest, o return out, nil } +func (c *queryClient) AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error) { + out := new(AccountNumberResponse) + err := c.cc.Invoke(ctx, "/cosmos.accounts.v1.Query/AccountNumber", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) SimulateUserOperation(ctx context.Context, in *SimulateUserOperationRequest, opts ...grpc.CallOption) (*SimulateUserOperationResponse, error) { out := new(SimulateUserOperationResponse) err := c.cc.Invoke(ctx, "/cosmos.accounts.v1.Query/SimulateUserOperation", in, out, opts...) @@ -620,6 +728,8 @@ type QueryServer interface { Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) // AccountType returns the account type for an address. AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) + // AccountNumber returns the account number given the account address. + AccountNumber(context.Context, *AccountNumberRequest) (*AccountNumberResponse, error) // SimulateUserOperation simulates a user operation. SimulateUserOperation(context.Context, *SimulateUserOperationRequest) (*SimulateUserOperationResponse, error) } @@ -637,6 +747,9 @@ func (*UnimplementedQueryServer) Schema(ctx context.Context, req *SchemaRequest) func (*UnimplementedQueryServer) AccountType(ctx context.Context, req *AccountTypeRequest) (*AccountTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountType not implemented") } +func (*UnimplementedQueryServer) AccountNumber(ctx context.Context, req *AccountNumberRequest) (*AccountNumberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountNumber not implemented") +} func (*UnimplementedQueryServer) SimulateUserOperation(ctx context.Context, req *SimulateUserOperationRequest) (*SimulateUserOperationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SimulateUserOperation not implemented") } @@ -699,6 +812,24 @@ func _Query_AccountType_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_AccountNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountNumberRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountNumber(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.accounts.v1.Query/AccountNumber", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountNumber(ctx, req.(*AccountNumberRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_SimulateUserOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SimulateUserOperationRequest) if err := dec(in); err != nil { @@ -733,6 +864,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AccountType", Handler: _Query_AccountType_Handler, }, + { + MethodName: "AccountNumber", + Handler: _Query_AccountNumber_Handler, + }, { MethodName: "SimulateUserOperation", Handler: _Query_SimulateUserOperation_Handler, @@ -1009,6 +1144,64 @@ func (m *AccountTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AccountNumberRequest) 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 *AccountNumberRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountNumberRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AccountNumberResponse) 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 *AccountNumberResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountNumberResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Number != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SimulateUserOperationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1208,6 +1401,31 @@ func (m *AccountTypeResponse) Size() (n int) { return n } +func (m *AccountNumberRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AccountNumberResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Number != 0 { + n += 1 + sovQuery(uint64(m.Number)) + } + return n +} + func (m *SimulateUserOperationRequest) Size() (n int) { if m == nil { return 0 @@ -1962,6 +2180,157 @@ func (m *AccountTypeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *AccountNumberRequest) 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: AccountNumberRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountNumberRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + 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 (m *AccountNumberResponse) 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: AccountNumberResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountNumberResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= 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 *SimulateUserOperationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0