From be5d26534ed9546667776b3e4c8fa4128125d8e0 Mon Sep 17 00:00:00 2001 From: testinginprod Date: Wed, 23 Oct 2024 15:19:35 +0200 Subject: [PATCH] checkpoint --- api/cosmos/accounts/v1/query.pulsar.go | 2425 ++++++++++++----- api/cosmos/accounts/v1/query_grpc.pb.go | 40 + x/accounts/cli/cli.go | 14 +- x/accounts/cli/cli_test.go | 2 +- .../internal/implementation/encoding.go | 8 - .../internal/implementation/implementation.go | 103 +- .../implementation/implementation_test.go | 13 +- x/accounts/keeper.go | 35 +- x/accounts/keeper_account_abstraction.go | 2 +- .../proto/cosmos/accounts/v1/query.proto | 37 +- x/accounts/query_server.go | 89 +- x/accounts/query_server_test.go | 34 +- x/accounts/v1/query.pb.go | 622 ++++- x/accounts/v1/schema.go | 38 - 14 files changed, 2457 insertions(+), 1005 deletions(-) diff --git a/api/cosmos/accounts/v1/query.pulsar.go b/api/cosmos/accounts/v1/query.pulsar.go index 7a1751ef4a57..8420ae1bfc7c 100644 --- a/api/cosmos/accounts/v1/query.pulsar.go +++ b/api/cosmos/accounts/v1/query.pulsar.go @@ -948,14 +948,14 @@ func (x *fastReflection_AccountQueryResponse) ProtoMethods() *protoiface.Methods } var ( - md_SchemaRequest protoreflect.MessageDescriptor - fd_SchemaRequest_account_type protoreflect.FieldDescriptor + md_SchemaRequest protoreflect.MessageDescriptor + fd_SchemaRequest_address protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_query_proto_init() md_SchemaRequest = File_cosmos_accounts_v1_query_proto.Messages().ByName("SchemaRequest") - fd_SchemaRequest_account_type = md_SchemaRequest.Fields().ByName("account_type") + fd_SchemaRequest_address = md_SchemaRequest.Fields().ByName("address") } var _ protoreflect.Message = (*fastReflection_SchemaRequest)(nil) @@ -1023,9 +1023,9 @@ func (x *fastReflection_SchemaRequest) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_SchemaRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.AccountType != "" { - value := protoreflect.ValueOfString(x.AccountType) - if !f(fd_SchemaRequest_account_type, value) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_SchemaRequest_address, value) { return } } @@ -1044,8 +1044,8 @@ func (x *fastReflection_SchemaRequest) Range(f func(protoreflect.FieldDescriptor // a repeated field is populated if it is non-empty. func (x *fastReflection_SchemaRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": - return x.AccountType != "" + case "cosmos.accounts.v1.SchemaRequest.address": + return x.Address != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaRequest")) @@ -1062,8 +1062,8 @@ func (x *fastReflection_SchemaRequest) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_SchemaRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": - x.AccountType = "" + case "cosmos.accounts.v1.SchemaRequest.address": + x.Address = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaRequest")) @@ -1080,8 +1080,8 @@ func (x *fastReflection_SchemaRequest) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_SchemaRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": - value := x.AccountType + case "cosmos.accounts.v1.SchemaRequest.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -1103,8 +1103,8 @@ func (x *fastReflection_SchemaRequest) Get(descriptor protoreflect.FieldDescript // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_SchemaRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": - x.AccountType = value.Interface().(string) + case "cosmos.accounts.v1.SchemaRequest.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaRequest")) @@ -1125,8 +1125,8 @@ func (x *fastReflection_SchemaRequest) Set(fd protoreflect.FieldDescriptor, valu // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_SchemaRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": - panic(fmt.Errorf("field account_type of message cosmos.accounts.v1.SchemaRequest is not mutable")) + case "cosmos.accounts.v1.SchemaRequest.address": + panic(fmt.Errorf("field address of message cosmos.accounts.v1.SchemaRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaRequest")) @@ -1140,7 +1140,7 @@ func (x *fastReflection_SchemaRequest) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_SchemaRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaRequest.account_type": + case "cosmos.accounts.v1.SchemaRequest.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1211,7 +1211,7 @@ func (x *fastReflection_SchemaRequest) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.AccountType) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1244,10 +1244,10 @@ func (x *fastReflection_SchemaRequest) 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 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 } @@ -1302,7 +1302,7 @@ func (x *fastReflection_SchemaRequest) ProtoMethods() *protoiface.Methods { 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) + 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 { @@ -1330,7 +1330,7 @@ func (x *fastReflection_SchemaRequest) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AccountType = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1367,132 +1367,28 @@ func (x *fastReflection_SchemaRequest) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_SchemaResponse_2_list)(nil) - -type _SchemaResponse_2_list struct { - list *[]*SchemaResponse_Handler -} - -func (x *_SchemaResponse_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_SchemaResponse_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_SchemaResponse_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SchemaResponse_Handler) - (*x.list)[i] = concreteValue -} - -func (x *_SchemaResponse_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SchemaResponse_Handler) - *x.list = append(*x.list, concreteValue) -} - -func (x *_SchemaResponse_2_list) AppendMutable() protoreflect.Value { - v := new(SchemaResponse_Handler) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_SchemaResponse_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_SchemaResponse_2_list) NewElement() protoreflect.Value { - v := new(SchemaResponse_Handler) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_SchemaResponse_2_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_SchemaResponse_3_list)(nil) - -type _SchemaResponse_3_list struct { - list *[]*SchemaResponse_Handler -} - -func (x *_SchemaResponse_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_SchemaResponse_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_SchemaResponse_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SchemaResponse_Handler) - (*x.list)[i] = concreteValue -} - -func (x *_SchemaResponse_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SchemaResponse_Handler) - *x.list = append(*x.list, concreteValue) -} - -func (x *_SchemaResponse_3_list) AppendMutable() protoreflect.Value { - v := new(SchemaResponse_Handler) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_SchemaResponse_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_SchemaResponse_3_list) NewElement() protoreflect.Value { - v := new(SchemaResponse_Handler) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_SchemaResponse_3_list) IsValid() bool { - return x.list != nil -} - var ( - md_SchemaResponse protoreflect.MessageDescriptor - fd_SchemaResponse_init_schema protoreflect.FieldDescriptor - fd_SchemaResponse_execute_handlers protoreflect.FieldDescriptor - fd_SchemaResponse_query_handlers protoreflect.FieldDescriptor + md_Handler protoreflect.MessageDescriptor + fd_Handler_request protoreflect.FieldDescriptor + fd_Handler_response protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_query_proto_init() - md_SchemaResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("SchemaResponse") - fd_SchemaResponse_init_schema = md_SchemaResponse.Fields().ByName("init_schema") - fd_SchemaResponse_execute_handlers = md_SchemaResponse.Fields().ByName("execute_handlers") - fd_SchemaResponse_query_handlers = md_SchemaResponse.Fields().ByName("query_handlers") + md_Handler = File_cosmos_accounts_v1_query_proto.Messages().ByName("Handler") + fd_Handler_request = md_Handler.Fields().ByName("request") + fd_Handler_response = md_Handler.Fields().ByName("response") } -var _ protoreflect.Message = (*fastReflection_SchemaResponse)(nil) +var _ protoreflect.Message = (*fastReflection_Handler)(nil) -type fastReflection_SchemaResponse SchemaResponse +type fastReflection_Handler Handler -func (x *SchemaResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_SchemaResponse)(x) +func (x *Handler) ProtoReflect() protoreflect.Message { + return (*fastReflection_Handler)(x) } -func (x *SchemaResponse) slowProtoReflect() protoreflect.Message { +func (x *Handler) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_accounts_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1504,43 +1400,43 @@ func (x *SchemaResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_SchemaResponse_messageType fastReflection_SchemaResponse_messageType -var _ protoreflect.MessageType = fastReflection_SchemaResponse_messageType{} +var _fastReflection_Handler_messageType fastReflection_Handler_messageType +var _ protoreflect.MessageType = fastReflection_Handler_messageType{} -type fastReflection_SchemaResponse_messageType struct{} +type fastReflection_Handler_messageType struct{} -func (x fastReflection_SchemaResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_SchemaResponse)(nil) +func (x fastReflection_Handler_messageType) Zero() protoreflect.Message { + return (*fastReflection_Handler)(nil) } -func (x fastReflection_SchemaResponse_messageType) New() protoreflect.Message { - return new(fastReflection_SchemaResponse) +func (x fastReflection_Handler_messageType) New() protoreflect.Message { + return new(fastReflection_Handler) } -func (x fastReflection_SchemaResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SchemaResponse +func (x fastReflection_Handler_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Handler } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_SchemaResponse) Descriptor() protoreflect.MessageDescriptor { - return md_SchemaResponse +func (x *fastReflection_Handler) Descriptor() protoreflect.MessageDescriptor { + return md_Handler } // 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_SchemaResponse) Type() protoreflect.MessageType { - return _fastReflection_SchemaResponse_messageType +func (x *fastReflection_Handler) Type() protoreflect.MessageType { + return _fastReflection_Handler_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_SchemaResponse) New() protoreflect.Message { - return new(fastReflection_SchemaResponse) +func (x *fastReflection_Handler) New() protoreflect.Message { + return new(fastReflection_Handler) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_SchemaResponse) Interface() protoreflect.ProtoMessage { - return (*SchemaResponse)(x) +func (x *fastReflection_Handler) Interface() protoreflect.ProtoMessage { + return (*Handler)(x) } // Range iterates over every populated field in an undefined order, @@ -1548,22 +1444,16 @@ func (x *fastReflection_SchemaResponse) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_SchemaResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.InitSchema != nil { - value := protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) - if !f(fd_SchemaResponse_init_schema, value) { - return - } - } - if len(x.ExecuteHandlers) != 0 { - value := protoreflect.ValueOfList(&_SchemaResponse_2_list{list: &x.ExecuteHandlers}) - if !f(fd_SchemaResponse_execute_handlers, value) { +func (x *fastReflection_Handler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != "" { + value := protoreflect.ValueOfString(x.Request) + if !f(fd_Handler_request, value) { return } } - if len(x.QueryHandlers) != 0 { - value := protoreflect.ValueOfList(&_SchemaResponse_3_list{list: &x.QueryHandlers}) - if !f(fd_SchemaResponse_query_handlers, value) { + if x.Response != "" { + value := protoreflect.ValueOfString(x.Response) + if !f(fd_Handler_response, value) { return } } @@ -1580,19 +1470,17 @@ func (x *fastReflection_SchemaResponse) Range(f func(protoreflect.FieldDescripto // 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_SchemaResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Handler) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - return x.InitSchema != nil - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - return len(x.ExecuteHandlers) != 0 - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - return len(x.QueryHandlers) != 0 + case "cosmos.accounts.v1.Handler.request": + return x.Request != "" + case "cosmos.accounts.v1.Handler.response": + return x.Response != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler does not contain field %s", fd.FullName())) } } @@ -1602,19 +1490,17 @@ func (x *fastReflection_SchemaResponse) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Handler) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - x.InitSchema = nil - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - x.ExecuteHandlers = nil - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - x.QueryHandlers = nil + case "cosmos.accounts.v1.Handler.request": + x.Request = "" + case "cosmos.accounts.v1.Handler.response": + x.Response = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler does not contain field %s", fd.FullName())) } } @@ -1624,28 +1510,19 @@ func (x *fastReflection_SchemaResponse) Clear(fd protoreflect.FieldDescriptor) { // 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_SchemaResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Handler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - value := x.InitSchema - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - if len(x.ExecuteHandlers) == 0 { - return protoreflect.ValueOfList(&_SchemaResponse_2_list{}) - } - listValue := &_SchemaResponse_2_list{list: &x.ExecuteHandlers} - return protoreflect.ValueOfList(listValue) - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - if len(x.QueryHandlers) == 0 { - return protoreflect.ValueOfList(&_SchemaResponse_3_list{}) - } - listValue := &_SchemaResponse_3_list{list: &x.QueryHandlers} - return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.Handler.request": + value := x.Request + return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.Handler.response": + value := x.Response + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler does not contain field %s", descriptor.FullName())) } } @@ -1659,23 +1536,17 @@ func (x *fastReflection_SchemaResponse) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Handler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - x.InitSchema = value.Message().Interface().(*SchemaResponse_Handler) - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - lv := value.List() - clv := lv.(*_SchemaResponse_2_list) - x.ExecuteHandlers = *clv.list - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - lv := value.List() - clv := lv.(*_SchemaResponse_3_list) - x.QueryHandlers = *clv.list + case "cosmos.accounts.v1.Handler.request": + x.Request = value.Interface().(string) + case "cosmos.accounts.v1.Handler.response": + x.Response = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler does not contain field %s", fd.FullName())) } } @@ -1689,62 +1560,44 @@ func (x *fastReflection_SchemaResponse) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Handler) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - if x.InitSchema == nil { - x.InitSchema = new(SchemaResponse_Handler) - } - return protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - if x.ExecuteHandlers == nil { - x.ExecuteHandlers = []*SchemaResponse_Handler{} - } - value := &_SchemaResponse_2_list{list: &x.ExecuteHandlers} - return protoreflect.ValueOfList(value) - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - if x.QueryHandlers == nil { - x.QueryHandlers = []*SchemaResponse_Handler{} - } - value := &_SchemaResponse_3_list{list: &x.QueryHandlers} - return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.Handler.request": + panic(fmt.Errorf("field request of message cosmos.accounts.v1.Handler is not mutable")) + case "cosmos.accounts.v1.Handler.response": + panic(fmt.Errorf("field response of message cosmos.accounts.v1.Handler is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler 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_SchemaResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Handler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.init_schema": - m := new(SchemaResponse_Handler) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.accounts.v1.SchemaResponse.execute_handlers": - list := []*SchemaResponse_Handler{} - return protoreflect.ValueOfList(&_SchemaResponse_2_list{list: &list}) - case "cosmos.accounts.v1.SchemaResponse.query_handlers": - list := []*SchemaResponse_Handler{} - return protoreflect.ValueOfList(&_SchemaResponse_3_list{list: &list}) + case "cosmos.accounts.v1.Handler.request": + return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.Handler.response": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.Handler")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.Handler 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_SchemaResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Handler) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.SchemaResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.Handler", d.FullName())) } panic("unreachable") } @@ -1752,7 +1605,7 @@ func (x *fastReflection_SchemaResponse) WhichOneof(d protoreflect.OneofDescripto // 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_SchemaResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Handler) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1763,7 +1616,7 @@ func (x *fastReflection_SchemaResponse) 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_SchemaResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Handler) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1775,7 +1628,638 @@ func (x *fastReflection_SchemaResponse) SetUnknown(fields protoreflect.RawFields // 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_SchemaResponse) IsValid() bool { +func (x *fastReflection_Handler) 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_Handler) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Handler) + 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.Request) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Response) + 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().(*Handler) + 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.Response) > 0 { + i -= len(x.Response) + copy(dAtA[i:], x.Response) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Response))) + i-- + dAtA[i] = 0x12 + } + if len(x.Request) > 0 { + i -= len(x.Request) + copy(dAtA[i:], x.Request) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Request))) + 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().(*Handler) + 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: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Handler: 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 Request", 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.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Response", 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.Response = 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 _ protoreflect.List = (*_SchemaResponse_2_list)(nil) + +type _SchemaResponse_2_list struct { + list *[]*Handler +} + +func (x *_SchemaResponse_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_SchemaResponse_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_SchemaResponse_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + (*x.list)[i] = concreteValue +} + +func (x *_SchemaResponse_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + *x.list = append(*x.list, concreteValue) +} + +func (x *_SchemaResponse_2_list) AppendMutable() protoreflect.Value { + v := new(Handler) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SchemaResponse_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_SchemaResponse_2_list) NewElement() protoreflect.Value { + v := new(Handler) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SchemaResponse_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_SchemaResponse_3_list)(nil) + +type _SchemaResponse_3_list struct { + list *[]*Handler +} + +func (x *_SchemaResponse_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_SchemaResponse_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_SchemaResponse_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + (*x.list)[i] = concreteValue +} + +func (x *_SchemaResponse_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + *x.list = append(*x.list, concreteValue) +} + +func (x *_SchemaResponse_3_list) AppendMutable() protoreflect.Value { + v := new(Handler) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SchemaResponse_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_SchemaResponse_3_list) NewElement() protoreflect.Value { + v := new(Handler) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SchemaResponse_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_SchemaResponse protoreflect.MessageDescriptor + fd_SchemaResponse_init_schema protoreflect.FieldDescriptor + fd_SchemaResponse_execute_handlers protoreflect.FieldDescriptor + fd_SchemaResponse_query_handlers protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_query_proto_init() + md_SchemaResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("SchemaResponse") + fd_SchemaResponse_init_schema = md_SchemaResponse.Fields().ByName("init_schema") + fd_SchemaResponse_execute_handlers = md_SchemaResponse.Fields().ByName("execute_handlers") + fd_SchemaResponse_query_handlers = md_SchemaResponse.Fields().ByName("query_handlers") +} + +var _ protoreflect.Message = (*fastReflection_SchemaResponse)(nil) + +type fastReflection_SchemaResponse SchemaResponse + +func (x *SchemaResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_SchemaResponse)(x) +} + +func (x *SchemaResponse) 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_SchemaResponse_messageType fastReflection_SchemaResponse_messageType +var _ protoreflect.MessageType = fastReflection_SchemaResponse_messageType{} + +type fastReflection_SchemaResponse_messageType struct{} + +func (x fastReflection_SchemaResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_SchemaResponse)(nil) +} +func (x fastReflection_SchemaResponse_messageType) New() protoreflect.Message { + return new(fastReflection_SchemaResponse) +} +func (x fastReflection_SchemaResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SchemaResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SchemaResponse) Descriptor() protoreflect.MessageDescriptor { + return md_SchemaResponse +} + +// 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_SchemaResponse) Type() protoreflect.MessageType { + return _fastReflection_SchemaResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SchemaResponse) New() protoreflect.Message { + return new(fastReflection_SchemaResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SchemaResponse) Interface() protoreflect.ProtoMessage { + return (*SchemaResponse)(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_SchemaResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InitSchema != nil { + value := protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) + if !f(fd_SchemaResponse_init_schema, value) { + return + } + } + if len(x.ExecuteHandlers) != 0 { + value := protoreflect.ValueOfList(&_SchemaResponse_2_list{list: &x.ExecuteHandlers}) + if !f(fd_SchemaResponse_execute_handlers, value) { + return + } + } + if len(x.QueryHandlers) != 0 { + value := protoreflect.ValueOfList(&_SchemaResponse_3_list{list: &x.QueryHandlers}) + if !f(fd_SchemaResponse_query_handlers, 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_SchemaResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + return x.InitSchema != nil + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + return len(x.ExecuteHandlers) != 0 + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + return len(x.QueryHandlers) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + x.InitSchema = nil + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + x.ExecuteHandlers = nil + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + x.QueryHandlers = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + value := x.InitSchema + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + if len(x.ExecuteHandlers) == 0 { + return protoreflect.ValueOfList(&_SchemaResponse_2_list{}) + } + listValue := &_SchemaResponse_2_list{list: &x.ExecuteHandlers} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + if len(x.QueryHandlers) == 0 { + return protoreflect.ValueOfList(&_SchemaResponse_3_list{}) + } + listValue := &_SchemaResponse_3_list{list: &x.QueryHandlers} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + x.InitSchema = value.Message().Interface().(*Handler) + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + lv := value.List() + clv := lv.(*_SchemaResponse_2_list) + x.ExecuteHandlers = *clv.list + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + lv := value.List() + clv := lv.(*_SchemaResponse_3_list) + x.QueryHandlers = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + if x.InitSchema == nil { + x.InitSchema = new(Handler) + } + return protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + if x.ExecuteHandlers == nil { + x.ExecuteHandlers = []*Handler{} + } + value := &_SchemaResponse_2_list{list: &x.ExecuteHandlers} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + if x.QueryHandlers == nil { + x.QueryHandlers = []*Handler{} + } + value := &_SchemaResponse_3_list{list: &x.QueryHandlers} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.SchemaResponse.init_schema": + m := new(Handler) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.accounts.v1.SchemaResponse.execute_handlers": + list := []*Handler{} + return protoreflect.ValueOfList(&_SchemaResponse_2_list{list: &list}) + case "cosmos.accounts.v1.SchemaResponse.query_handlers": + list := []*Handler{} + return protoreflect.ValueOfList(&_SchemaResponse_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse 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_SchemaResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.SchemaResponse", 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_SchemaResponse) 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_SchemaResponse) 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_SchemaResponse) IsValid() bool { return x != nil } @@ -1787,7 +2271,550 @@ func (x *fastReflection_SchemaResponse) IsValid() bool { // Consult the protoiface package documentation for details. func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SchemaResponse) + x := input.Message.Interface().(*SchemaResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.InitSchema != nil { + l = options.Size(x.InitSchema) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ExecuteHandlers) > 0 { + for _, e := range x.ExecuteHandlers { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.QueryHandlers) > 0 { + for _, e := range x.QueryHandlers { + l = options.Size(e) + 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().(*SchemaResponse) + 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.QueryHandlers) > 0 { + for iNdEx := len(x.QueryHandlers) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.QueryHandlers[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.ExecuteHandlers) > 0 { + for iNdEx := len(x.ExecuteHandlers) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExecuteHandlers[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.InitSchema != nil { + encoded, err := options.Marshal(x.InitSchema) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*SchemaResponse) + 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: SchemaResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SchemaResponse: 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 InitSchema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.InitSchema == nil { + x.InitSchema = &Handler{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitSchema); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecuteHandlers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ExecuteHandlers = append(x.ExecuteHandlers, &Handler{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecuteHandlers[len(x.ExecuteHandlers)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field QueryHandlers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.QueryHandlers = append(x.QueryHandlers, &Handler{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.QueryHandlers[len(x.QueryHandlers)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_InitSchemaRequest protoreflect.MessageDescriptor + fd_InitSchemaRequest_account_type protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_query_proto_init() + md_InitSchemaRequest = File_cosmos_accounts_v1_query_proto.Messages().ByName("InitSchemaRequest") + fd_InitSchemaRequest_account_type = md_InitSchemaRequest.Fields().ByName("account_type") +} + +var _ protoreflect.Message = (*fastReflection_InitSchemaRequest)(nil) + +type fastReflection_InitSchemaRequest InitSchemaRequest + +func (x *InitSchemaRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_InitSchemaRequest)(x) +} + +func (x *InitSchemaRequest) 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_InitSchemaRequest_messageType fastReflection_InitSchemaRequest_messageType +var _ protoreflect.MessageType = fastReflection_InitSchemaRequest_messageType{} + +type fastReflection_InitSchemaRequest_messageType struct{} + +func (x fastReflection_InitSchemaRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_InitSchemaRequest)(nil) +} +func (x fastReflection_InitSchemaRequest_messageType) New() protoreflect.Message { + return new(fastReflection_InitSchemaRequest) +} +func (x fastReflection_InitSchemaRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_InitSchemaRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_InitSchemaRequest) Descriptor() protoreflect.MessageDescriptor { + return md_InitSchemaRequest +} + +// 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_InitSchemaRequest) Type() protoreflect.MessageType { + return _fastReflection_InitSchemaRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_InitSchemaRequest) New() protoreflect.Message { + return new(fastReflection_InitSchemaRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_InitSchemaRequest) Interface() protoreflect.ProtoMessage { + return (*InitSchemaRequest)(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_InitSchemaRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AccountType != "" { + value := protoreflect.ValueOfString(x.AccountType) + if !f(fd_InitSchemaRequest_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_InitSchemaRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.account_type": + return x.AccountType != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.account_type": + x.AccountType = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.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.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.account_type": + x.AccountType = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.account_type": + panic(fmt.Errorf("field account_type of message cosmos.accounts.v1.InitSchemaRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.InitSchemaRequest.account_type": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaRequest 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_InitSchemaRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.InitSchemaRequest", 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_InitSchemaRequest) 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_InitSchemaRequest) 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_InitSchemaRequest) 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_InitSchemaRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*InitSchemaRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1799,22 +2826,10 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.InitSchema != nil { - l = options.Size(x.InitSchema) + l = len(x.AccountType) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.ExecuteHandlers) > 0 { - for _, e := range x.ExecuteHandlers { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.QueryHandlers) > 0 { - for _, e := range x.QueryHandlers { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1825,7 +2840,7 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*SchemaResponse) + x := input.Message.Interface().(*InitSchemaRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1844,49 +2859,10 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.QueryHandlers) > 0 { - for iNdEx := len(x.QueryHandlers) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.QueryHandlers[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.ExecuteHandlers) > 0 { - for iNdEx := len(x.ExecuteHandlers) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.ExecuteHandlers[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if x.InitSchema != nil { - encoded, err := options.Marshal(x.InitSchema) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.AccountType) > 0 { + i -= len(x.AccountType) + copy(dAtA[i:], x.AccountType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AccountType))) i-- dAtA[i] = 0xa } @@ -1901,7 +2877,7 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SchemaResponse) + x := input.Message.Interface().(*InitSchemaRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1933,87 +2909,17 @@ func (x *fastReflection_SchemaResponse) 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: SchemaResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitSchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitSchemaRequest: 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 InitSchema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.InitSchema == nil { - x.InitSchema = &SchemaResponse_Handler{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitSchema); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecuteHandlers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ExecuteHandlers = append(x.ExecuteHandlers, &SchemaResponse_Handler{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecuteHandlers[len(x.ExecuteHandlers)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field QueryHandlers", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountType", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2023,25 +2929,23 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.QueryHandlers = append(x.QueryHandlers, &SchemaResponse_Handler{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.QueryHandlers[len(x.QueryHandlers)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.AccountType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2079,28 +2983,26 @@ func (x *fastReflection_SchemaResponse) ProtoMethods() *protoiface.Methods { } var ( - md_SchemaResponse_Handler protoreflect.MessageDescriptor - fd_SchemaResponse_Handler_request protoreflect.FieldDescriptor - fd_SchemaResponse_Handler_response protoreflect.FieldDescriptor + md_InitSchemaResponse protoreflect.MessageDescriptor + fd_InitSchemaResponse_init_schema protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_v1_query_proto_init() - md_SchemaResponse_Handler = File_cosmos_accounts_v1_query_proto.Messages().ByName("SchemaResponse").Messages().ByName("Handler") - fd_SchemaResponse_Handler_request = md_SchemaResponse_Handler.Fields().ByName("request") - fd_SchemaResponse_Handler_response = md_SchemaResponse_Handler.Fields().ByName("response") + md_InitSchemaResponse = File_cosmos_accounts_v1_query_proto.Messages().ByName("InitSchemaResponse") + fd_InitSchemaResponse_init_schema = md_InitSchemaResponse.Fields().ByName("init_schema") } -var _ protoreflect.Message = (*fastReflection_SchemaResponse_Handler)(nil) +var _ protoreflect.Message = (*fastReflection_InitSchemaResponse)(nil) -type fastReflection_SchemaResponse_Handler SchemaResponse_Handler +type fastReflection_InitSchemaResponse InitSchemaResponse -func (x *SchemaResponse_Handler) ProtoReflect() protoreflect.Message { - return (*fastReflection_SchemaResponse_Handler)(x) +func (x *InitSchemaResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_InitSchemaResponse)(x) } -func (x *SchemaResponse_Handler) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] +func (x *InitSchemaResponse) 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 { @@ -2111,43 +3013,43 @@ func (x *SchemaResponse_Handler) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_SchemaResponse_Handler_messageType fastReflection_SchemaResponse_Handler_messageType -var _ protoreflect.MessageType = fastReflection_SchemaResponse_Handler_messageType{} +var _fastReflection_InitSchemaResponse_messageType fastReflection_InitSchemaResponse_messageType +var _ protoreflect.MessageType = fastReflection_InitSchemaResponse_messageType{} -type fastReflection_SchemaResponse_Handler_messageType struct{} +type fastReflection_InitSchemaResponse_messageType struct{} -func (x fastReflection_SchemaResponse_Handler_messageType) Zero() protoreflect.Message { - return (*fastReflection_SchemaResponse_Handler)(nil) +func (x fastReflection_InitSchemaResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_InitSchemaResponse)(nil) } -func (x fastReflection_SchemaResponse_Handler_messageType) New() protoreflect.Message { - return new(fastReflection_SchemaResponse_Handler) +func (x fastReflection_InitSchemaResponse_messageType) New() protoreflect.Message { + return new(fastReflection_InitSchemaResponse) } -func (x fastReflection_SchemaResponse_Handler_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SchemaResponse_Handler +func (x fastReflection_InitSchemaResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_InitSchemaResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_SchemaResponse_Handler) Descriptor() protoreflect.MessageDescriptor { - return md_SchemaResponse_Handler +func (x *fastReflection_InitSchemaResponse) Descriptor() protoreflect.MessageDescriptor { + return md_InitSchemaResponse } // 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_SchemaResponse_Handler) Type() protoreflect.MessageType { - return _fastReflection_SchemaResponse_Handler_messageType +func (x *fastReflection_InitSchemaResponse) Type() protoreflect.MessageType { + return _fastReflection_InitSchemaResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_SchemaResponse_Handler) New() protoreflect.Message { - return new(fastReflection_SchemaResponse_Handler) +func (x *fastReflection_InitSchemaResponse) New() protoreflect.Message { + return new(fastReflection_InitSchemaResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_SchemaResponse_Handler) Interface() protoreflect.ProtoMessage { - return (*SchemaResponse_Handler)(x) +func (x *fastReflection_InitSchemaResponse) Interface() protoreflect.ProtoMessage { + return (*InitSchemaResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2155,16 +3057,10 @@ func (x *fastReflection_SchemaResponse_Handler) Interface() protoreflect.ProtoMe // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_SchemaResponse_Handler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Request != "" { - value := protoreflect.ValueOfString(x.Request) - if !f(fd_SchemaResponse_Handler_request, value) { - return - } - } - if x.Response != "" { - value := protoreflect.ValueOfString(x.Response) - if !f(fd_SchemaResponse_Handler_response, value) { +func (x *fastReflection_InitSchemaResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InitSchema != nil { + value := protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) + if !f(fd_InitSchemaResponse_init_schema, value) { return } } @@ -2181,17 +3077,15 @@ func (x *fastReflection_SchemaResponse_Handler) Range(f func(protoreflect.FieldD // 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_SchemaResponse_Handler) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_InitSchemaResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - return x.Request != "" - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - return x.Response != "" + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + return x.InitSchema != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse does not contain field %s", fd.FullName())) } } @@ -2201,17 +3095,15 @@ func (x *fastReflection_SchemaResponse_Handler) Has(fd protoreflect.FieldDescrip // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse_Handler) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_InitSchemaResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - x.Request = "" - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - x.Response = "" + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + x.InitSchema = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse does not contain field %s", fd.FullName())) } } @@ -2221,19 +3113,16 @@ func (x *fastReflection_SchemaResponse_Handler) Clear(fd protoreflect.FieldDescr // 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_SchemaResponse_Handler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_InitSchemaResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - value := x.Request - return protoreflect.ValueOfString(value) - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - value := x.Response - return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + value := x.InitSchema + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse does not contain field %s", descriptor.FullName())) } } @@ -2247,17 +3136,15 @@ func (x *fastReflection_SchemaResponse_Handler) Get(descriptor protoreflect.Fiel // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse_Handler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_InitSchemaResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - x.Request = value.Interface().(string) - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - x.Response = value.Interface().(string) + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + x.InitSchema = value.Message().Interface().(*Handler) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse does not contain field %s", fd.FullName())) } } @@ -2271,44 +3158,44 @@ func (x *fastReflection_SchemaResponse_Handler) Set(fd protoreflect.FieldDescrip // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse_Handler) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_InitSchemaResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - panic(fmt.Errorf("field request of message cosmos.accounts.v1.SchemaResponse.Handler is not mutable")) - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - panic(fmt.Errorf("field response of message cosmos.accounts.v1.SchemaResponse.Handler is not mutable")) + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + if x.InitSchema == nil { + x.InitSchema = new(Handler) + } + return protoreflect.ValueOfMessage(x.InitSchema.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse 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_SchemaResponse_Handler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_InitSchemaResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.v1.SchemaResponse.Handler.request": - return protoreflect.ValueOfString("") - case "cosmos.accounts.v1.SchemaResponse.Handler.response": - return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.InitSchemaResponse.init_schema": + m := new(Handler) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.SchemaResponse.Handler")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.InitSchemaResponse")) } - panic(fmt.Errorf("message cosmos.accounts.v1.SchemaResponse.Handler does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.v1.InitSchemaResponse 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_SchemaResponse_Handler) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_InitSchemaResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.SchemaResponse.Handler", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.InitSchemaResponse", d.FullName())) } panic("unreachable") } @@ -2316,7 +3203,7 @@ func (x *fastReflection_SchemaResponse_Handler) WhichOneof(d protoreflect.OneofD // 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_SchemaResponse_Handler) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_InitSchemaResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2327,7 +3214,7 @@ func (x *fastReflection_SchemaResponse_Handler) GetUnknown() protoreflect.RawFie // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SchemaResponse_Handler) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_InitSchemaResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2339,7 +3226,7 @@ func (x *fastReflection_SchemaResponse_Handler) SetUnknown(fields protoreflect.R // 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_SchemaResponse_Handler) IsValid() bool { +func (x *fastReflection_InitSchemaResponse) IsValid() bool { return x != nil } @@ -2349,9 +3236,9 @@ func (x *fastReflection_SchemaResponse_Handler) 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_SchemaResponse_Handler) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_InitSchemaResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SchemaResponse_Handler) + x := input.Message.Interface().(*InitSchemaResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2363,12 +3250,8 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho var n int var l int _ = l - l = len(x.Request) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Response) - if l > 0 { + if x.InitSchema != nil { + l = options.Size(x.InitSchema) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -2381,7 +3264,7 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*SchemaResponse_Handler) + x := input.Message.Interface().(*InitSchemaResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2396,21 +3279,21 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho _ = i var l int _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Response) > 0 { - i -= len(x.Response) - copy(dAtA[i:], x.Response) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Response))) - i-- - dAtA[i] = 0x12 + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) } - if len(x.Request) > 0 { - i -= len(x.Request) - copy(dAtA[i:], x.Request) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Request))) + if x.InitSchema != nil { + encoded, err := options.Marshal(x.InitSchema) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -2425,7 +3308,7 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SchemaResponse_Handler) + x := input.Message.Interface().(*InitSchemaResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2457,17 +3340,17 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SchemaResponse_Handler: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitSchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SchemaResponse_Handler: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitSchemaResponse: 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 Request", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitSchema", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2477,55 +3360,27 @@ func (x *fastReflection_SchemaResponse_Handler) ProtoMethods() *protoiface.Metho } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Request = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Response", 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 x.InitSchema == nil { + x.InitSchema = &Handler{} } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitSchema); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Response = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2582,7 +3437,7 @@ func (x *AccountTypeRequest) ProtoReflect() protoreflect.Message { } func (x *AccountTypeRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[4] + 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 { @@ -3002,7 +3857,7 @@ func (x *AccountTypeResponse) ProtoReflect() protoreflect.Message { } func (x *AccountTypeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[5] + 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 { @@ -3422,7 +4277,7 @@ func (x *AccountNumberRequest) ProtoReflect() protoreflect.Message { } func (x *AccountNumberRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + 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 { @@ -3842,7 +4697,7 @@ func (x *AccountNumberResponse) ProtoReflect() protoreflect.Message { } func (x *AccountNumberResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] + 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 { @@ -4328,8 +5183,8 @@ type SchemaRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // account_type defines the account type to query the schema for. - AccountType string `protobuf:"bytes,1,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` + // address defines the account to query the schema for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (x *SchemaRequest) Reset() { @@ -4352,9 +5207,57 @@ func (*SchemaRequest) Descriptor() ([]byte, []int) { return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{2} } -func (x *SchemaRequest) GetAccountType() string { +func (x *SchemaRequest) GetAddress() string { if x != nil { - return x.AccountType + return x.Address + } + return "" +} + +// Handler defines a schema descriptor for a handler. +// Where request and response are names that can be used to lookup the +// reflection descriptor. +type Handler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // request is the request name + Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // response is the response name + Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *Handler) Reset() { + *x = Handler{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Handler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Handler) ProtoMessage() {} + +// Deprecated: Use Handler.ProtoReflect.Descriptor instead. +func (*Handler) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *Handler) GetRequest() string { + if x != nil { + return x.Request + } + return "" +} + +func (x *Handler) GetResponse() string { + if x != nil { + return x.Response } return "" } @@ -4366,17 +5269,17 @@ type SchemaResponse struct { unknownFields protoimpl.UnknownFields // init_schema defines the schema descriptor for the Init account method. - InitSchema *SchemaResponse_Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` + InitSchema *Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` // execute_handlers defines the schema descriptor for the Execute account method. - ExecuteHandlers []*SchemaResponse_Handler `protobuf:"bytes,2,rep,name=execute_handlers,json=executeHandlers,proto3" json:"execute_handlers,omitempty"` + ExecuteHandlers []*Handler `protobuf:"bytes,2,rep,name=execute_handlers,json=executeHandlers,proto3" json:"execute_handlers,omitempty"` // query_handlers defines the schema descriptor for the Query account method. - QueryHandlers []*SchemaResponse_Handler `protobuf:"bytes,3,rep,name=query_handlers,json=queryHandlers,proto3" json:"query_handlers,omitempty"` + QueryHandlers []*Handler `protobuf:"bytes,3,rep,name=query_handlers,json=queryHandlers,proto3" json:"query_handlers,omitempty"` } func (x *SchemaResponse) Reset() { *x = SchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[3] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4390,30 +5293,104 @@ func (*SchemaResponse) ProtoMessage() {} // Deprecated: Use SchemaResponse.ProtoReflect.Descriptor instead. func (*SchemaResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{3} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{4} } -func (x *SchemaResponse) GetInitSchema() *SchemaResponse_Handler { +func (x *SchemaResponse) GetInitSchema() *Handler { if x != nil { return x.InitSchema } return nil } -func (x *SchemaResponse) GetExecuteHandlers() []*SchemaResponse_Handler { +func (x *SchemaResponse) GetExecuteHandlers() []*Handler { if x != nil { return x.ExecuteHandlers } return nil } -func (x *SchemaResponse) GetQueryHandlers() []*SchemaResponse_Handler { +func (x *SchemaResponse) GetQueryHandlers() []*Handler { if x != nil { return x.QueryHandlers } return nil } +// InitSchemaRequest is the request type for the Query/InitSchema RPC method. +type InitSchemaRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // account_type defines the account type to query the init schema for. + AccountType string `protobuf:"bytes,1,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` +} + +func (x *InitSchemaRequest) Reset() { + *x = InitSchemaRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitSchemaRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitSchemaRequest) ProtoMessage() {} + +// Deprecated: Use InitSchemaRequest.ProtoReflect.Descriptor instead. +func (*InitSchemaRequest) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *InitSchemaRequest) GetAccountType() string { + if x != nil { + return x.AccountType + } + return "" +} + +// InitSchemaResponse is the response type for the Query/InitSchema RPC method. +type InitSchemaResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // init_schema defines the schema descriptor for the Init account method. + InitSchema *Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` +} + +func (x *InitSchemaResponse) Reset() { + *x = InitSchemaResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitSchemaResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitSchemaResponse) ProtoMessage() {} + +// Deprecated: Use InitSchemaResponse.ProtoReflect.Descriptor instead. +func (*InitSchemaResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *InitSchemaResponse) GetInitSchema() *Handler { + if x != nil { + return x.InitSchema + } + return nil +} + // AccountTypeRequest is the request type for the Query/AccountType RPC method. type AccountTypeRequest struct { state protoimpl.MessageState @@ -4427,7 +5404,7 @@ type AccountTypeRequest struct { func (x *AccountTypeRequest) Reset() { *x = AccountTypeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[4] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4441,7 +5418,7 @@ func (*AccountTypeRequest) ProtoMessage() {} // Deprecated: Use AccountTypeRequest.ProtoReflect.Descriptor instead. func (*AccountTypeRequest) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{4} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{7} } func (x *AccountTypeRequest) GetAddress() string { @@ -4464,7 +5441,7 @@ type AccountTypeResponse struct { func (x *AccountTypeResponse) Reset() { *x = AccountTypeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[5] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4478,7 +5455,7 @@ func (*AccountTypeResponse) ProtoMessage() {} // Deprecated: Use AccountTypeResponse.ProtoReflect.Descriptor instead. func (*AccountTypeResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{5} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{8} } func (x *AccountTypeResponse) GetAccountType() string { @@ -4501,7 +5478,7 @@ type AccountNumberRequest struct { func (x *AccountNumberRequest) Reset() { *x = AccountNumberRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[6] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4515,7 +5492,7 @@ func (*AccountNumberRequest) ProtoMessage() {} // Deprecated: Use AccountNumberRequest.ProtoReflect.Descriptor instead. func (*AccountNumberRequest) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{6} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{9} } func (x *AccountNumberRequest) GetAddress() string { @@ -4539,7 +5516,7 @@ type AccountNumberResponse struct { func (x *AccountNumberResponse) Reset() { *x = AccountNumberResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[7] + mi := &file_cosmos_accounts_v1_query_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4553,7 +5530,7 @@ func (*AccountNumberResponse) ProtoMessage() {} // Deprecated: Use AccountNumberResponse.ProtoReflect.Descriptor instead. func (*AccountNumberResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{7} + return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{10} } func (x *AccountNumberResponse) GetNumber() uint64 { @@ -4563,54 +5540,6 @@ func (x *AccountNumberResponse) GetNumber() uint64 { return 0 } -// Handler defines a schema descriptor for a handler. -// Where request and response are names that can be used to lookup the -// reflection descriptor. -type SchemaResponse_Handler struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // request is the request name - Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // response is the response name - Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` -} - -func (x *SchemaResponse_Handler) Reset() { - *x = SchemaResponse_Handler{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_query_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SchemaResponse_Handler) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemaResponse_Handler) ProtoMessage() {} - -// Deprecated: Use SchemaResponse_Handler.ProtoReflect.Descriptor instead. -func (*SchemaResponse_Handler) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_query_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *SchemaResponse_Handler) GetRequest() string { - if x != nil { - return x.Request - } - return "" -} - -func (x *SchemaResponse_Handler) GetResponse() string { - if x != nil { - return x.Response - } - return "" -} - var File_cosmos_accounts_v1_query_proto protoreflect.FileDescriptor var file_cosmos_accounts_v1_query_proto_rawDesc = []byte{ @@ -4629,81 +5558,92 @@ var file_cosmos_accounts_v1_query_proto_rawDesc = []byte{ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0xc8, 0x02, 0x0a, - 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4b, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 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, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x55, 0x0a, 0x10, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 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, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x52, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x73, 0x12, 0x51, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 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, 0x2e, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x1a, 0x3f, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 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, 0x38, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 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, 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, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 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, 0x32, 0x89, 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, + 0x65, 0x73, 0x73, 0x22, 0x3f, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x46, 0x0a, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x0f, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x42, 0x0a, + 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x52, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x73, 0x22, 0x36, 0x0a, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x52, 0x0a, 0x12, 0x49, 0x6e, 0x69, + 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x2e, 0x0a, + 0x12, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 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, 0x38, 0x0a, + 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, 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, 0x32, 0xe8, 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, 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, - 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, + 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, 0x5d, 0x0a, 0x0a, + 0x49, 0x6e, 0x69, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x69, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x69, 0x74, 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, 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 ( @@ -4718,38 +5658,43 @@ 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 - (*SchemaRequest)(nil), // 2: cosmos.accounts.v1.SchemaRequest - (*SchemaResponse)(nil), // 3: cosmos.accounts.v1.SchemaResponse - (*AccountTypeRequest)(nil), // 4: cosmos.accounts.v1.AccountTypeRequest - (*AccountTypeResponse)(nil), // 5: cosmos.accounts.v1.AccountTypeResponse - (*AccountNumberRequest)(nil), // 6: cosmos.accounts.v1.AccountNumberRequest - (*AccountNumberResponse)(nil), // 7: cosmos.accounts.v1.AccountNumberResponse - (*SchemaResponse_Handler)(nil), // 8: cosmos.accounts.v1.SchemaResponse.Handler - (*anypb.Any)(nil), // 9: google.protobuf.Any + (*AccountQueryRequest)(nil), // 0: cosmos.accounts.v1.AccountQueryRequest + (*AccountQueryResponse)(nil), // 1: cosmos.accounts.v1.AccountQueryResponse + (*SchemaRequest)(nil), // 2: cosmos.accounts.v1.SchemaRequest + (*Handler)(nil), // 3: cosmos.accounts.v1.Handler + (*SchemaResponse)(nil), // 4: cosmos.accounts.v1.SchemaResponse + (*InitSchemaRequest)(nil), // 5: cosmos.accounts.v1.InitSchemaRequest + (*InitSchemaResponse)(nil), // 6: cosmos.accounts.v1.InitSchemaResponse + (*AccountTypeRequest)(nil), // 7: cosmos.accounts.v1.AccountTypeRequest + (*AccountTypeResponse)(nil), // 8: cosmos.accounts.v1.AccountTypeResponse + (*AccountNumberRequest)(nil), // 9: cosmos.accounts.v1.AccountNumberRequest + (*AccountNumberResponse)(nil), // 10: cosmos.accounts.v1.AccountNumberResponse + (*anypb.Any)(nil), // 11: google.protobuf.Any } 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 - 0, // 5: cosmos.accounts.v1.Query.AccountQuery:input_type -> cosmos.accounts.v1.AccountQueryRequest - 2, // 6: cosmos.accounts.v1.Query.Schema:input_type -> cosmos.accounts.v1.SchemaRequest - 4, // 7: cosmos.accounts.v1.Query.AccountType:input_type -> cosmos.accounts.v1.AccountTypeRequest - 6, // 8: cosmos.accounts.v1.Query.AccountNumber:input_type -> cosmos.accounts.v1.AccountNumberRequest - 1, // 9: cosmos.accounts.v1.Query.AccountQuery:output_type -> cosmos.accounts.v1.AccountQueryResponse - 3, // 10: cosmos.accounts.v1.Query.Schema:output_type -> cosmos.accounts.v1.SchemaResponse - 5, // 11: cosmos.accounts.v1.Query.AccountType:output_type -> cosmos.accounts.v1.AccountTypeResponse - 7, // 12: cosmos.accounts.v1.Query.AccountNumber:output_type -> cosmos.accounts.v1.AccountNumberResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 11, // 0: cosmos.accounts.v1.AccountQueryRequest.request:type_name -> google.protobuf.Any + 11, // 1: cosmos.accounts.v1.AccountQueryResponse.response:type_name -> google.protobuf.Any + 3, // 2: cosmos.accounts.v1.SchemaResponse.init_schema:type_name -> cosmos.accounts.v1.Handler + 3, // 3: cosmos.accounts.v1.SchemaResponse.execute_handlers:type_name -> cosmos.accounts.v1.Handler + 3, // 4: cosmos.accounts.v1.SchemaResponse.query_handlers:type_name -> cosmos.accounts.v1.Handler + 3, // 5: cosmos.accounts.v1.InitSchemaResponse.init_schema:type_name -> cosmos.accounts.v1.Handler + 0, // 6: cosmos.accounts.v1.Query.AccountQuery:input_type -> cosmos.accounts.v1.AccountQueryRequest + 2, // 7: cosmos.accounts.v1.Query.Schema:input_type -> cosmos.accounts.v1.SchemaRequest + 5, // 8: cosmos.accounts.v1.Query.InitSchema:input_type -> cosmos.accounts.v1.InitSchemaRequest + 7, // 9: cosmos.accounts.v1.Query.AccountType:input_type -> cosmos.accounts.v1.AccountTypeRequest + 9, // 10: cosmos.accounts.v1.Query.AccountNumber:input_type -> cosmos.accounts.v1.AccountNumberRequest + 1, // 11: cosmos.accounts.v1.Query.AccountQuery:output_type -> cosmos.accounts.v1.AccountQueryResponse + 4, // 12: cosmos.accounts.v1.Query.Schema:output_type -> cosmos.accounts.v1.SchemaResponse + 6, // 13: cosmos.accounts.v1.Query.InitSchema:output_type -> cosmos.accounts.v1.InitSchemaResponse + 8, // 14: cosmos.accounts.v1.Query.AccountType:output_type -> cosmos.accounts.v1.AccountTypeResponse + 10, // 15: cosmos.accounts.v1.Query.AccountNumber:output_type -> cosmos.accounts.v1.AccountNumberResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_accounts_v1_query_proto_init() } @@ -4795,7 +5740,7 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaResponse); i { + switch v := v.(*Handler); i { case 0: return &v.state case 1: @@ -4807,7 +5752,7 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountTypeRequest); i { + switch v := v.(*SchemaResponse); i { case 0: return &v.state case 1: @@ -4819,7 +5764,7 @@ func file_cosmos_accounts_v1_query_proto_init() { } } file_cosmos_accounts_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountTypeResponse); i { + switch v := v.(*InitSchemaRequest); i { case 0: return &v.state case 1: @@ -4831,7 +5776,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.(*AccountNumberRequest); i { + switch v := v.(*InitSchemaResponse); i { case 0: return &v.state case 1: @@ -4843,7 +5788,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.(*AccountNumberResponse); i { + switch v := v.(*AccountTypeRequest); i { case 0: return &v.state case 1: @@ -4855,7 +5800,31 @@ 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.(*SchemaResponse_Handler); i { + switch v := v.(*AccountTypeResponse); 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.(*AccountNumberRequest); 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.(*AccountNumberResponse); i { case 0: return &v.state case 1: @@ -4873,7 +5842,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 25e014c88878..9e76b4b072d9 100644 --- a/api/cosmos/accounts/v1/query_grpc.pb.go +++ b/api/cosmos/accounts/v1/query_grpc.pb.go @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( Query_AccountQuery_FullMethodName = "/cosmos.accounts.v1.Query/AccountQuery" Query_Schema_FullMethodName = "/cosmos.accounts.v1.Query/Schema" + Query_InitSchema_FullMethodName = "/cosmos.accounts.v1.Query/InitSchema" Query_AccountType_FullMethodName = "/cosmos.accounts.v1.Query/AccountType" Query_AccountNumber_FullMethodName = "/cosmos.accounts.v1.Query/AccountNumber" ) @@ -35,6 +36,8 @@ type QueryClient interface { AccountQuery(ctx context.Context, in *AccountQueryRequest, opts ...grpc.CallOption) (*AccountQueryResponse, error) // Schema returns an x/account schema. Unstable. Schema(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) + // InitSchema returns an account's types init schema. Unstable. + InitSchema(ctx context.Context, in *InitSchemaRequest, opts ...grpc.CallOption) (*InitSchemaResponse, 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. @@ -69,6 +72,16 @@ func (c *queryClient) Schema(ctx context.Context, in *SchemaRequest, opts ...grp return out, nil } +func (c *queryClient) InitSchema(ctx context.Context, in *InitSchemaRequest, opts ...grpc.CallOption) (*InitSchemaResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InitSchemaResponse) + err := c.cc.Invoke(ctx, Query_InitSchema_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) AccountType(ctx context.Context, in *AccountTypeRequest, opts ...grpc.CallOption) (*AccountTypeResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AccountTypeResponse) @@ -99,6 +112,8 @@ type QueryServer interface { AccountQuery(context.Context, *AccountQueryRequest) (*AccountQueryResponse, error) // Schema returns an x/account schema. Unstable. Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) + // InitSchema returns an account's types init schema. Unstable. + InitSchema(context.Context, *InitSchemaRequest) (*InitSchemaResponse, error) // AccountType returns the account type for an address. AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) // AccountNumber returns the account number given the account address. @@ -119,6 +134,9 @@ func (UnimplementedQueryServer) AccountQuery(context.Context, *AccountQueryReque func (UnimplementedQueryServer) Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented") } +func (UnimplementedQueryServer) InitSchema(context.Context, *InitSchemaRequest) (*InitSchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitSchema not implemented") +} func (UnimplementedQueryServer) AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountType not implemented") } @@ -182,6 +200,24 @@ func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_InitSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitSchemaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).InitSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_InitSchema_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InitSchema(ctx, req.(*InitSchemaRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_AccountType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AccountTypeRequest) if err := dec(in); err != nil { @@ -233,6 +269,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Schema", Handler: _Query_Schema_Handler, }, + { + MethodName: "InitSchema", + Handler: _Query_InitSchema_Handler, + }, { MethodName: "AccountType", Handler: _Query_AccountType_Handler, diff --git a/x/accounts/cli/cli.go b/x/accounts/cli/cli.go index e1458acbb045..105912b40c65 100644 --- a/x/accounts/cli/cli.go +++ b/x/accounts/cli/cli.go @@ -58,7 +58,7 @@ func GetTxInitCmd() *cobra.Command { // to know which message to use, we need to know the account type // init message schema. accClient := v1.NewQueryClient(clientCtx) - schema, err := accClient.Schema(cmd.Context(), &v1.SchemaRequest{ + schema, err := accClient.InitSchema(cmd.Context(), &v1.InitSchemaRequest{ AccountType: args[0], }) if err != nil { @@ -166,19 +166,13 @@ func GetQueryAccountCmd() *cobra.Command { func getSchemaForAccount(clientCtx client.Context, addr string) (*v1.SchemaResponse, error) { queryClient := v1.NewQueryClient(clientCtx) - accType, err := queryClient.AccountType(clientCtx.CmdContext, &v1.AccountTypeRequest{ - Address: addr, - }) - if err != nil { - return nil, err - } return queryClient.Schema(clientCtx.CmdContext, &v1.SchemaRequest{ - AccountType: accType.AccountType, + Address: addr, }) } -func handlerMsgBytes(handlersSchema []*v1.SchemaResponse_Handler, msgTypeURL, msgString string) (*codectypes.Any, error) { - var msgSchema *v1.SchemaResponse_Handler +func handlerMsgBytes(handlersSchema []*v1.Handler, msgTypeURL, msgString string) (*codectypes.Any, error) { + var msgSchema *v1.Handler for _, handler := range handlersSchema { if handler.Request == msgTypeURL { msgSchema = handler diff --git a/x/accounts/cli/cli_test.go b/x/accounts/cli/cli_test.go index 5e9c188d1d68..bb80ee10df3a 100644 --- a/x/accounts/cli/cli_test.go +++ b/x/accounts/cli/cli_test.go @@ -78,7 +78,7 @@ func (s *CLITestSuite) TestTxInitCmd() { ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&v1.SchemaResponse{ - InitSchema: &v1.SchemaResponse_Handler{ + InitSchema: &v1.Handler{ Request: sdk.MsgTypeURL(&types.Empty{})[1:], Response: sdk.MsgTypeURL(&types.Empty{})[1:], }, diff --git a/x/accounts/internal/implementation/encoding.go b/x/accounts/internal/implementation/encoding.go index 9b08d00bf862..97fe3a51de20 100644 --- a/x/accounts/internal/implementation/encoding.go +++ b/x/accounts/internal/implementation/encoding.go @@ -20,14 +20,6 @@ type ProtoMsgG[T any] interface { type Any = codectypes.Any -func FindMessageByName(name string) (transaction.Msg, error) { - typ := proto.MessageType(name) - if typ == nil { - return nil, fmt.Errorf("no message type found for %s", name) - } - return reflect.New(typ.Elem()).Interface().(transaction.Msg), nil -} - func MessageName(msg transaction.Msg) string { return proto.MessageName(msg) } diff --git a/x/accounts/internal/implementation/implementation.go b/x/accounts/internal/implementation/implementation.go index 6ee1edc39927..48ed0397554a 100644 --- a/x/accounts/internal/implementation/implementation.go +++ b/x/accounts/internal/implementation/implementation.go @@ -94,50 +94,69 @@ func newImplementation(schemaBuilder *collections.SchemaBuilder, account Account return Implementation{}, err } return Implementation{ - Init: initHandler, - Execute: executeHandler, - Query: queryHandler, - CollectionsSchema: schema, - InitHandlerSchema: ir.schema, - QueryHandlersSchema: qr.er.handlersSchema, - ExecuteHandlersSchema: er.handlersSchema, + init: initHandler, + execute: executeHandler, + query: queryHandler, + collectionsSchema: schema, + initHandlerSchema: ir.schema, + queryHandlersSchema: qr.er.handlersSchema, + executeHandlersSchema: er.handlersSchema, }, nil } // Implementation wraps an Account implementer in order to provide a concrete // and non-generic implementation usable by the x/accounts module. type Implementation struct { - // Init defines the initialisation handler for the smart account. - Init func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + // init defines the initialisation handler for the smart account. + init func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) // Execute defines the execution handler for the smart account. - Execute func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + execute func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) // Query defines the query handler for the smart account. - Query func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) - // CollectionsSchema represents the state schema. - CollectionsSchema collections.Schema - // InitHandlerSchema represents the init handler schema. - InitHandlerSchema HandlerSchema - // QueryHandlersSchema is the schema of the query handlers. - QueryHandlersSchema map[string]HandlerSchema - // ExecuteHandlersSchema is the schema of the execute handlers. - ExecuteHandlersSchema map[string]HandlerSchema + query func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + // collectionsSchema represents the state schema. + collectionsSchema collections.Schema + // initHandlerSchema represents the init handler schema. + initHandlerSchema HandlerSchema + // queryHandlersSchema is the schema of the query handlers. + queryHandlersSchema map[string]HandlerSchema + // executeHandlersSchema is the schema of the execute handlers. + executeHandlersSchema map[string]HandlerSchema +} + +func (i Implementation) Init(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return i.init(ctx, msg) +} + +func (i Implementation) Execute(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return i.execute(ctx, msg) +} + +func (i Implementation) Query(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return i.query(ctx, msg) } // HasExec returns true if the account can execute the given msg. -func (i Implementation) HasExec(m transaction.Msg) bool { - _, ok := i.ExecuteHandlersSchema[MessageName(m)] +func (i Implementation) HasExec(_ context.Context, m transaction.Msg) bool { + _, ok := i.executeHandlersSchema[MessageName(m)] return ok } // HasQuery returns true if the account can execute the given request. -func (i Implementation) HasQuery(m transaction.Msg) bool { - _, ok := i.QueryHandlersSchema[MessageName(m)] +func (i Implementation) HasQuery(_ context.Context, m transaction.Msg) bool { + _, ok := i.queryHandlersSchema[MessageName(m)] return ok } -// HasInit returns true if the account uses the provided init message. -func (i Implementation) HasInit(m transaction.Msg) bool { - return i.InitHandlerSchema.RequestSchema.Name == MessageName(m) +func (i Implementation) GetInitHandlerSchema(_ context.Context) (HandlerSchema, error) { + return i.initHandlerSchema, nil +} + +func (i Implementation) GetQueryHandlersSchema(_ context.Context) (map[string]HandlerSchema, error) { + return i.queryHandlersSchema, nil +} + +func (i Implementation) GetExecuteHandlersSchema(_ context.Context) (map[string]HandlerSchema, error) { + return i.executeHandlersSchema, nil } // MessageSchema defines the schema of a message. @@ -156,3 +175,35 @@ type HandlerSchema struct { // ResponseSchema defines the schema of the response. ResponseSchema MessageSchema } + +const msgInterfaceName = "cosmos.accounts.v1.MsgInterface" + +// creates a new interface type which is an alias of the proto message interface to avoid conflicts with sdk.Msg +type msgInterface transaction.Msg + +var msgInterfaceType = (*msgInterface)(nil) + +// registerToInterfaceRegistry registers all the interfaces of the accounts to the +// global interface registry. This is required for the SDK to correctly decode +// the google.Protobuf.Any used in x/accounts. +func registerToInterfaceRegistry(ir InterfaceRegistry, accMap map[string]Implementation) { + ir.RegisterInterface(msgInterfaceName, msgInterfaceType) + + for _, acc := range accMap { + // register init + ir.RegisterImplementations(msgInterfaceType, acc.initHandlerSchema.RequestSchema.New(), acc.initHandlerSchema.ResponseSchema.New()) + // register exec + for _, exec := range acc.executeHandlersSchema { + ir.RegisterImplementations(msgInterfaceType, exec.RequestSchema.New(), exec.ResponseSchema.New()) + } + // register query + for _, query := range acc.queryHandlersSchema { + ir.RegisterImplementations(msgInterfaceType, query.RequestSchema.New(), query.ResponseSchema.New()) + } + } +} + +type InterfaceRegistry interface { + RegisterInterface(name string, iface any, impls ...gogoproto.Message) + RegisterImplementations(iface any, impls ...gogoproto.Message) +} diff --git a/x/accounts/internal/implementation/implementation_test.go b/x/accounts/internal/implementation/implementation_test.go index fc9842993454..dbb007c481fb 100644 --- a/x/accounts/internal/implementation/implementation_test.go +++ b/x/accounts/internal/implementation/implementation_test.go @@ -58,22 +58,17 @@ func TestImplementation(t *testing.T) { }) t.Run("Has* methods", func(t *testing.T) { - ok := impl.HasExec(&types.StringValue{}) - require.True(t, ok) - - ok = impl.HasExec(&types.Duration{}) - require.False(t, ok) - ok = impl.HasQuery(&types.StringValue{}) + ok := impl.HasExec(ctx, &types.StringValue{}) require.True(t, ok) - ok = impl.HasQuery(&types.Duration{}) + ok = impl.HasExec(ctx, &types.Duration{}) require.False(t, ok) - ok = impl.HasInit(&types.StringValue{}) + ok = impl.HasQuery(ctx, &types.StringValue{}) require.True(t, ok) - ok = impl.HasInit(&types.Duration{}) + ok = impl.HasQuery(ctx, &types.Duration{}) require.False(t, ok) }) } diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index fee356a7736f..be272cb1f439 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -8,8 +8,6 @@ import ( "errors" "fmt" - gogoproto "github.com/cosmos/gogoproto/proto" - "cosmossdk.io/collections" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" @@ -37,10 +35,7 @@ var ( AccountByNumber = collections.NewPrefix(2) ) -type InterfaceRegistry interface { - RegisterInterface(name string, iface any, impls ...gogoproto.Message) - RegisterImplementations(iface any, impls ...gogoproto.Message) -} +type InterfaceRegistry = implementation.InterfaceRegistry func NewKeeper( cdc codec.Codec, @@ -71,7 +66,6 @@ func NewKeeper( if err != nil { return Keeper{}, err } - registerToInterfaceRegistry(ir, keeper.accounts) return keeper, nil } @@ -428,30 +422,3 @@ func (k Keeper) maybeSendFunds(ctx context.Context, from, to []byte, amt sdk.Coi return nil } - -const msgInterfaceName = "cosmos.accounts.v1.MsgInterface" - -// creates a new interface type which is an alias of the proto message interface to avoid conflicts with sdk.Msg -type msgInterface transaction.Msg - -var msgInterfaceType = (*msgInterface)(nil) - -// registerToInterfaceRegistry registers all the interfaces of the accounts to the -// global interface registry. This is required for the SDK to correctly decode -// the google.Protobuf.Any used in x/accounts. -func registerToInterfaceRegistry(ir InterfaceRegistry, accMap map[string]implementation.Implementation) { - ir.RegisterInterface(msgInterfaceName, msgInterfaceType) - - for _, acc := range accMap { - // register init - ir.RegisterImplementations(msgInterfaceType, acc.InitHandlerSchema.RequestSchema.New(), acc.InitHandlerSchema.ResponseSchema.New()) - // register exec - for _, exec := range acc.ExecuteHandlersSchema { - ir.RegisterImplementations(msgInterfaceType, exec.RequestSchema.New(), exec.ResponseSchema.New()) - } - // register query - for _, query := range acc.QueryHandlersSchema { - ir.RegisterImplementations(msgInterfaceType, query.RequestSchema.New(), query.ResponseSchema.New()) - } - } -} diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 47acac990d43..3af82f3f3704 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -35,7 +35,7 @@ func (k Keeper) IsAbstractedAccount(ctx context.Context, addr []byte) (bool, err if !ok { return false, fmt.Errorf("%w: %s", errAccountTypeNotFound, accType) } - return impl.HasExec(&aa_interface_v1.MsgAuthenticate{}), nil + return impl.HasExec(ctx, &aa_interface_v1.MsgAuthenticate{}), nil } func (k Keeper) AuthenticateAccount(ctx context.Context, signer []byte, bundler string, rawTx *tx.TxRaw, protoTx *tx.Tx, signIndex uint32) error { diff --git a/x/accounts/proto/cosmos/accounts/v1/query.proto b/x/accounts/proto/cosmos/accounts/v1/query.proto index d59380f89c3b..fd93d21a089f 100644 --- a/x/accounts/proto/cosmos/accounts/v1/query.proto +++ b/x/accounts/proto/cosmos/accounts/v1/query.proto @@ -12,6 +12,8 @@ service Query { rpc AccountQuery(AccountQueryRequest) returns (AccountQueryResponse) {}; // Schema returns an x/account schema. Unstable. rpc Schema(SchemaRequest) returns (SchemaResponse) {}; + // InitSchema returns an account's types init schema. Unstable. + rpc InitSchema(InitSchemaRequest) returns (InitSchemaResponse) {}; // AccountType returns the account type for an address. rpc AccountType(AccountTypeRequest) returns (AccountTypeResponse) {}; // AccountNumber returns the account number given the account address. @@ -34,21 +36,22 @@ message AccountQueryResponse { // SchemaRequest is the request type for the Query/Schema RPC method. message SchemaRequest { - // account_type defines the account type to query the schema for. - string account_type = 1; + // address defines the account to query the schema for. + string address = 1; +} + +// Handler defines a schema descriptor for a handler. +// Where request and response are names that can be used to lookup the +// reflection descriptor. +message Handler { + // request is the request name + string request = 1; + // response is the response name + string response = 2; } // SchemaResponse is the response type for the Query/Schema RPC method. message SchemaResponse { - // Handler defines a schema descriptor for a handler. - // Where request and response are names that can be used to lookup the - // reflection descriptor. - message Handler { - // request is the request name - string request = 1; - // response is the response name - string response = 2; - } // init_schema defines the schema descriptor for the Init account method. Handler init_schema = 1; // execute_handlers defines the schema descriptor for the Execute account method. @@ -57,6 +60,18 @@ message SchemaResponse { repeated Handler query_handlers = 3; } +// InitSchemaRequest is the request type for the Query/InitSchema RPC method. +message InitSchemaRequest { + // account_type defines the account type to query the init schema for. + string account_type = 1; +} + +// InitSchemaResponse is the response type for the Query/InitSchema RPC method. +message InitSchemaResponse { + // init_schema defines the schema descriptor for the Init account method. + Handler init_schema = 1; +} + // AccountTypeRequest is the request type for the Query/AccountType RPC method. message AccountTypeRequest { // address defines the address to query the account type for. diff --git a/x/accounts/query_server.go b/x/accounts/query_server.go index 87d8e3deb38c..1aa4b4feda2e 100644 --- a/x/accounts/query_server.go +++ b/x/accounts/query_server.go @@ -3,6 +3,8 @@ package accounts import ( "context" "fmt" + "slices" + "strings" "cosmossdk.io/x/accounts/internal/implementation" v1 "cosmossdk.io/x/accounts/v1" @@ -13,17 +15,13 @@ var _ v1.QueryServer = &queryServer{} // NewQueryServer initializes a new instance of QueryServer. // It precalculates and stores schemas for efficient schema retrieval. func NewQueryServer(k Keeper) v1.QueryServer { - // Pre-calculate schemas for efficient retrieval. - schemas := v1.MakeAccountsSchemas(k.accounts) return &queryServer{ - k: k, - schemas: schemas, // Store precalculated schemas. + k: k, } } type queryServer struct { - k Keeper - schemas map[string]*v1.SchemaResponse // Stores precalculated schemas. + k Keeper } func (q *queryServer) AccountQuery(ctx context.Context, request *v1.AccountQueryRequest) (*v1.AccountQueryResponse, error) { @@ -55,16 +53,81 @@ func (q *queryServer) AccountQuery(ctx context.Context, request *v1.AccountQuery }, nil } -// Schema retrieves the schema for a given account type. +// Schema retrieves the schema for a given account. // It checks the precalculated schemas and returns an error if the schema is not found. -func (q *queryServer) Schema(_ context.Context, request *v1.SchemaRequest) (*v1.SchemaResponse, error) { - // Fetch schema from precalculated schemas. - schema, ok := q.schemas[request.AccountType] - if !ok { - return nil, fmt.Errorf("%w: %s", errAccountTypeNotFound, request.AccountType) +func (q *queryServer) Schema(ctx context.Context, request *v1.SchemaRequest) (*v1.SchemaResponse, error) { + // get account + addr, err := q.k.addressCodec.StringToBytes(request.Address) + if err != nil { + return nil, err + } + + impl, err := q.k.getImplementation(ctx, addr) + if err != nil { + return nil, err + } + return makeAccountSchema(ctx, impl) +} + +func (q *queryServer) InitSchema(ctx context.Context, request *v1.InitSchemaRequest) (*v1.InitSchemaResponse, error) { + accTypes, exists := q.k.accounts[request.AccountType] + if !exists { + return nil, fmt.Errorf("account type %s not found", request.AccountType) + } + + initSchema, err := accTypes.GetInitHandlerSchema(ctx) + if err != nil { + return nil, err + } + + return &v1.InitSchemaResponse{ + InitSchema: &v1.Handler{ + Request: initSchema.RequestSchema.Name, + Response: initSchema.ResponseSchema.Name, + }, + }, nil +} + +func makeAccountSchema( + ctx context.Context, + impl implementation.Implementation, +) (*v1.SchemaResponse, error) { + initSchema, err := impl.GetInitHandlerSchema(ctx) + if err != nil { + return nil, err + } + executeHandlers, err := impl.GetExecuteHandlersSchema(ctx) + if err != nil { + return nil, err } - return schema, nil + queryHandlers, err := impl.GetQueryHandlersSchema(ctx) + if err != nil { + return nil, err + } + + return &v1.SchemaResponse{ + InitSchema: &v1.Handler{ + Request: initSchema.RequestSchema.Name, + Response: initSchema.ResponseSchema.Name, + }, + ExecuteHandlers: makeHandlersSchema(executeHandlers), + QueryHandlers: makeHandlersSchema(queryHandlers), + }, nil +} + +func makeHandlersSchema(handlers map[string]implementation.HandlerSchema) []*v1.Handler { + schemas := make([]*v1.Handler, 0, len(handlers)) + for name, handler := range handlers { + schemas = append(schemas, &v1.Handler{ + Request: name, + Response: handler.ResponseSchema.Name, + }) + } + slices.SortFunc(schemas, func(a, b *v1.Handler) int { + return strings.Compare(a.Request, b.Request) + }) + return schemas } func (q *queryServer) AccountType(ctx context.Context, request *v1.AccountTypeRequest) (*v1.AccountTypeResponse, error) { diff --git a/x/accounts/query_server_test.go b/x/accounts/query_server_test.go index 9afa7e424b9d..fa1c1756acbe 100644 --- a/x/accounts/query_server_test.go +++ b/x/accounts/query_server_test.go @@ -59,19 +59,31 @@ func TestQueryServer(t *testing.T) { require.Equal(t, "test", typ.AccountType) }) - t.Run("schema caching", func(t *testing.T) { - // Request schema once - schemaReq := &v1.SchemaRequest{AccountType: "test"} - schemaResp1, err := qs.Schema(ctx, schemaReq) + emptyMsgName := implementation.MessageName(&types.Empty{}) + t.Run("schema", func(t *testing.T) { + schemaReq := &v1.SchemaRequest{Address: initResp.AccountAddress} + schemaResp, err := qs.Schema(ctx, schemaReq) require.NoError(t, err) - require.NotNil(t, schemaResp1) + require.NotNil(t, schemaResp) - // Request schema again - schemaResp2, err := qs.Schema(ctx, schemaReq) - require.NoError(t, err) - require.NotNil(t, schemaResp2) + require.Equal(t, schemaResp.InitSchema.Request, emptyMsgName) + require.Equal(t, schemaResp.InitSchema.Response, emptyMsgName) + + // check handlers + require.Len(t, schemaResp.ExecuteHandlers, 4) + require.Equal(t, schemaResp.ExecuteHandlers[0].Request, emptyMsgName) + require.Equal(t, schemaResp.ExecuteHandlers[0].Response, emptyMsgName) - // Check if both responses are the same (cached) - require.Equal(t, schemaResp1, schemaResp2) + require.Len(t, schemaResp.QueryHandlers, 4) + require.Equal(t, schemaResp.QueryHandlers[1].Request, emptyMsgName) + require.Equal(t, schemaResp.QueryHandlers[1].Response, emptyMsgName) + }) + + t.Run("init schema", func(t *testing.T) { + r, err := qs.InitSchema(ctx, &v1.InitSchemaRequest{AccountType: "test"}) + require.NoError(t, err) + require.NotNil(t, r.InitSchema) + require.Equal(t, r.InitSchema.Request, emptyMsgName) + require.Equal(t, r.InitSchema.Response, emptyMsgName) }) } diff --git a/x/accounts/v1/query.pb.go b/x/accounts/v1/query.pb.go index 8630d7937095..55998a0b42da 100644 --- a/x/accounts/v1/query.pb.go +++ b/x/accounts/v1/query.pb.go @@ -131,8 +131,8 @@ func (m *AccountQueryResponse) GetResponse() *any.Any { // SchemaRequest is the request type for the Query/Schema RPC method. type SchemaRequest struct { - // account_type defines the account type to query the schema for. - AccountType string `protobuf:"bytes,1,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` + // address defines the account to query the schema for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (m *SchemaRequest) Reset() { *m = SchemaRequest{} } @@ -168,9 +168,66 @@ func (m *SchemaRequest) XXX_DiscardUnknown() { var xxx_messageInfo_SchemaRequest proto.InternalMessageInfo -func (m *SchemaRequest) GetAccountType() string { +func (m *SchemaRequest) GetAddress() string { if m != nil { - return m.AccountType + return m.Address + } + return "" +} + +// Handler defines a schema descriptor for a handler. +// Where request and response are names that can be used to lookup the +// reflection descriptor. +type Handler struct { + // request is the request name + Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // response is the response name + Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +} + +func (m *Handler) Reset() { *m = Handler{} } +func (m *Handler) String() string { return proto.CompactTextString(m) } +func (*Handler) ProtoMessage() {} +func (*Handler) Descriptor() ([]byte, []int) { + return fileDescriptor_16ad14c22e3080d2, []int{3} +} +func (m *Handler) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Handler.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 *Handler) XXX_Merge(src proto.Message) { + xxx_messageInfo_Handler.Merge(m, src) +} +func (m *Handler) XXX_Size() int { + return m.Size() +} +func (m *Handler) XXX_DiscardUnknown() { + xxx_messageInfo_Handler.DiscardUnknown(m) +} + +var xxx_messageInfo_Handler proto.InternalMessageInfo + +func (m *Handler) GetRequest() string { + if m != nil { + return m.Request + } + return "" +} + +func (m *Handler) GetResponse() string { + if m != nil { + return m.Response } return "" } @@ -178,18 +235,18 @@ func (m *SchemaRequest) GetAccountType() string { // SchemaResponse is the response type for the Query/Schema RPC method. type SchemaResponse struct { // init_schema defines the schema descriptor for the Init account method. - InitSchema *SchemaResponse_Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` + InitSchema *Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` // execute_handlers defines the schema descriptor for the Execute account method. - ExecuteHandlers []*SchemaResponse_Handler `protobuf:"bytes,2,rep,name=execute_handlers,json=executeHandlers,proto3" json:"execute_handlers,omitempty"` + ExecuteHandlers []*Handler `protobuf:"bytes,2,rep,name=execute_handlers,json=executeHandlers,proto3" json:"execute_handlers,omitempty"` // query_handlers defines the schema descriptor for the Query account method. - QueryHandlers []*SchemaResponse_Handler `protobuf:"bytes,3,rep,name=query_handlers,json=queryHandlers,proto3" json:"query_handlers,omitempty"` + QueryHandlers []*Handler `protobuf:"bytes,3,rep,name=query_handlers,json=queryHandlers,proto3" json:"query_handlers,omitempty"` } func (m *SchemaResponse) Reset() { *m = SchemaResponse{} } func (m *SchemaResponse) String() string { return proto.CompactTextString(m) } func (*SchemaResponse) ProtoMessage() {} func (*SchemaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{3} + return fileDescriptor_16ad14c22e3080d2, []int{4} } func (m *SchemaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,49 +275,45 @@ func (m *SchemaResponse) XXX_DiscardUnknown() { var xxx_messageInfo_SchemaResponse proto.InternalMessageInfo -func (m *SchemaResponse) GetInitSchema() *SchemaResponse_Handler { +func (m *SchemaResponse) GetInitSchema() *Handler { if m != nil { return m.InitSchema } return nil } -func (m *SchemaResponse) GetExecuteHandlers() []*SchemaResponse_Handler { +func (m *SchemaResponse) GetExecuteHandlers() []*Handler { if m != nil { return m.ExecuteHandlers } return nil } -func (m *SchemaResponse) GetQueryHandlers() []*SchemaResponse_Handler { +func (m *SchemaResponse) GetQueryHandlers() []*Handler { if m != nil { return m.QueryHandlers } return nil } -// Handler defines a schema descriptor for a handler. -// Where request and response are names that can be used to lookup the -// reflection descriptor. -type SchemaResponse_Handler struct { - // request is the request name - Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // response is the response name - Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +// InitSchemaRequest is the request type for the Query/InitSchema RPC method. +type InitSchemaRequest struct { + // account_type defines the account type to query the init schema for. + AccountType string `protobuf:"bytes,1,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` } -func (m *SchemaResponse_Handler) Reset() { *m = SchemaResponse_Handler{} } -func (m *SchemaResponse_Handler) String() string { return proto.CompactTextString(m) } -func (*SchemaResponse_Handler) ProtoMessage() {} -func (*SchemaResponse_Handler) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{3, 0} +func (m *InitSchemaRequest) Reset() { *m = InitSchemaRequest{} } +func (m *InitSchemaRequest) String() string { return proto.CompactTextString(m) } +func (*InitSchemaRequest) ProtoMessage() {} +func (*InitSchemaRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_16ad14c22e3080d2, []int{5} } -func (m *SchemaResponse_Handler) XXX_Unmarshal(b []byte) error { +func (m *InitSchemaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SchemaResponse_Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InitSchemaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SchemaResponse_Handler.Marshal(b, m, deterministic) + return xxx_messageInfo_InitSchemaRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -270,30 +323,69 @@ func (m *SchemaResponse_Handler) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *SchemaResponse_Handler) XXX_Merge(src proto.Message) { - xxx_messageInfo_SchemaResponse_Handler.Merge(m, src) +func (m *InitSchemaRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitSchemaRequest.Merge(m, src) } -func (m *SchemaResponse_Handler) XXX_Size() int { +func (m *InitSchemaRequest) XXX_Size() int { return m.Size() } -func (m *SchemaResponse_Handler) XXX_DiscardUnknown() { - xxx_messageInfo_SchemaResponse_Handler.DiscardUnknown(m) +func (m *InitSchemaRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InitSchemaRequest.DiscardUnknown(m) } -var xxx_messageInfo_SchemaResponse_Handler proto.InternalMessageInfo +var xxx_messageInfo_InitSchemaRequest proto.InternalMessageInfo -func (m *SchemaResponse_Handler) GetRequest() string { +func (m *InitSchemaRequest) GetAccountType() string { if m != nil { - return m.Request + return m.AccountType } return "" } -func (m *SchemaResponse_Handler) GetResponse() string { +// InitSchemaResponse is the response type for the Query/InitSchema RPC method. +type InitSchemaResponse struct { + // init_schema defines the schema descriptor for the Init account method. + InitSchema *Handler `protobuf:"bytes,1,opt,name=init_schema,json=initSchema,proto3" json:"init_schema,omitempty"` +} + +func (m *InitSchemaResponse) Reset() { *m = InitSchemaResponse{} } +func (m *InitSchemaResponse) String() string { return proto.CompactTextString(m) } +func (*InitSchemaResponse) ProtoMessage() {} +func (*InitSchemaResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16ad14c22e3080d2, []int{6} +} +func (m *InitSchemaResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InitSchemaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InitSchemaResponse.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 *InitSchemaResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitSchemaResponse.Merge(m, src) +} +func (m *InitSchemaResponse) XXX_Size() int { + return m.Size() +} +func (m *InitSchemaResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InitSchemaResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_InitSchemaResponse proto.InternalMessageInfo + +func (m *InitSchemaResponse) GetInitSchema() *Handler { if m != nil { - return m.Response + return m.InitSchema } - return "" + return nil } // AccountTypeRequest is the request type for the Query/AccountType RPC method. @@ -306,7 +398,7 @@ func (m *AccountTypeRequest) Reset() { *m = AccountTypeRequest{} } func (m *AccountTypeRequest) String() string { return proto.CompactTextString(m) } func (*AccountTypeRequest) ProtoMessage() {} func (*AccountTypeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{4} + return fileDescriptor_16ad14c22e3080d2, []int{7} } func (m *AccountTypeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -352,7 +444,7 @@ func (m *AccountTypeResponse) Reset() { *m = AccountTypeResponse{} } func (m *AccountTypeResponse) String() string { return proto.CompactTextString(m) } func (*AccountTypeResponse) ProtoMessage() {} func (*AccountTypeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16ad14c22e3080d2, []int{5} + return fileDescriptor_16ad14c22e3080d2, []int{8} } func (m *AccountTypeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -398,7 +490,7 @@ 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} + return fileDescriptor_16ad14c22e3080d2, []int{9} } func (m *AccountNumberRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -445,7 +537,7 @@ 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} + return fileDescriptor_16ad14c22e3080d2, []int{10} } func (m *AccountNumberResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -485,8 +577,10 @@ func init() { proto.RegisterType((*AccountQueryRequest)(nil), "cosmos.accounts.v1.AccountQueryRequest") proto.RegisterType((*AccountQueryResponse)(nil), "cosmos.accounts.v1.AccountQueryResponse") proto.RegisterType((*SchemaRequest)(nil), "cosmos.accounts.v1.SchemaRequest") + proto.RegisterType((*Handler)(nil), "cosmos.accounts.v1.Handler") proto.RegisterType((*SchemaResponse)(nil), "cosmos.accounts.v1.SchemaResponse") - proto.RegisterType((*SchemaResponse_Handler)(nil), "cosmos.accounts.v1.SchemaResponse.Handler") + proto.RegisterType((*InitSchemaRequest)(nil), "cosmos.accounts.v1.InitSchemaRequest") + proto.RegisterType((*InitSchemaResponse)(nil), "cosmos.accounts.v1.InitSchemaResponse") proto.RegisterType((*AccountTypeRequest)(nil), "cosmos.accounts.v1.AccountTypeRequest") proto.RegisterType((*AccountTypeResponse)(nil), "cosmos.accounts.v1.AccountTypeResponse") proto.RegisterType((*AccountNumberRequest)(nil), "cosmos.accounts.v1.AccountNumberRequest") @@ -496,39 +590,40 @@ func init() { func init() { proto.RegisterFile("cosmos/accounts/v1/query.proto", fileDescriptor_16ad14c22e3080d2) } var fileDescriptor_16ad14c22e3080d2 = []byte{ - // 497 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0x13, 0x48, 0x60, 0xd2, 0x14, 0x34, 0x94, 0xca, 0xf8, 0x60, 0xa5, 0x3e, 0xd0, 0xc0, - 0x61, 0xdd, 0x06, 0x0e, 0xdc, 0x50, 0x38, 0x55, 0x42, 0x42, 0x8a, 0x81, 0x0b, 0x12, 0x0a, 0x8e, - 0xb3, 0x4d, 0x23, 0x1a, 0x6f, 0xea, 0xb5, 0xab, 0xe6, 0x13, 0xb8, 0xf1, 0x59, 0x3d, 0xf6, 0xc8, - 0x11, 0x25, 0x3f, 0x82, 0xba, 0x3b, 0x9b, 0x38, 0x50, 0xe2, 0xf6, 0xe6, 0xd9, 0x79, 0xf3, 0xde, - 0xfa, 0xbd, 0xb1, 0xc1, 0x8b, 0x85, 0x9c, 0x08, 0x19, 0x44, 0x71, 0x2c, 0xf2, 0x24, 0x93, 0xc1, - 0xf9, 0x61, 0x70, 0x96, 0xf3, 0x74, 0xc6, 0xa6, 0xa9, 0xc8, 0x04, 0xa2, 0xee, 0x33, 0xd3, 0x67, - 0xe7, 0x87, 0xee, 0xb3, 0x91, 0x10, 0xa3, 0x53, 0x1e, 0x28, 0xc4, 0x20, 0x3f, 0x0e, 0xa2, 0x84, - 0xe0, 0xfe, 0x57, 0x78, 0xd2, 0xd5, 0xc8, 0xde, 0x35, 0x49, 0xc8, 0xcf, 0x72, 0x2e, 0x33, 0xdc, - 0x85, 0x5a, 0x16, 0xa5, 0x23, 0x9e, 0x39, 0x76, 0xcb, 0x6e, 0x3f, 0x0c, 0xa9, 0x42, 0x06, 0xf5, - 0x54, 0x43, 0x9c, 0x4a, 0xcb, 0x6e, 0x37, 0x3a, 0x3b, 0x4c, 0x73, 0x33, 0xc3, 0xcd, 0xba, 0xc9, - 0x2c, 0x34, 0x20, 0xff, 0x08, 0x76, 0xd6, 0xe9, 0xe5, 0x54, 0x24, 0x92, 0xe3, 0x01, 0x3c, 0x48, - 0xe9, 0x59, 0x29, 0xfc, 0x8f, 0x68, 0x89, 0xf2, 0x3b, 0xd0, 0xfc, 0x18, 0x9f, 0xf0, 0x49, 0x64, - 0xae, 0xb8, 0x07, 0x5b, 0xf4, 0x8e, 0xfd, 0x6c, 0x36, 0xe5, 0x74, 0xd1, 0x06, 0x9d, 0x7d, 0x9a, - 0x4d, 0xb9, 0x7f, 0x59, 0x81, 0x6d, 0x33, 0x44, 0xc2, 0xef, 0xa1, 0x31, 0x4e, 0xc6, 0x59, 0x5f, - 0xaa, 0x63, 0xd2, 0x7e, 0xc9, 0xfe, 0x35, 0x8d, 0xad, 0x0f, 0xb2, 0xa3, 0x28, 0x19, 0x9e, 0xf2, - 0x34, 0x84, 0xeb, 0x71, 0xdd, 0xc3, 0xcf, 0xf0, 0x98, 0x5f, 0xf0, 0x38, 0xcf, 0x78, 0xff, 0x44, - 0xb7, 0xa5, 0x53, 0x69, 0x55, 0xef, 0xc8, 0xf8, 0x88, 0x38, 0xa8, 0x96, 0xd8, 0x83, 0x6d, 0x95, - 0xe8, 0x8a, 0xb4, 0x7a, 0x67, 0xd2, 0xa6, 0x62, 0x30, 0x94, 0xee, 0x5b, 0xa8, 0xd3, 0x33, 0x3a, - 0xab, 0x08, 0xb5, 0x65, 0xa6, 0x44, 0xb7, 0x10, 0x4a, 0x45, 0xb5, 0x56, 0xf6, 0x33, 0xc0, 0xee, - 0xca, 0x59, 0x93, 0x81, 0x03, 0xf5, 0x68, 0x38, 0x4c, 0xb9, 0x94, 0x86, 0x8b, 0x4a, 0xff, 0xcd, - 0x72, 0xaf, 0x34, 0x9e, 0xec, 0xbf, 0x45, 0x68, 0x07, 0xcb, 0x95, 0xf9, 0x90, 0x4f, 0x06, 0x3c, - 0x2d, 0xd7, 0x0a, 0xe0, 0xe9, 0x5f, 0x13, 0xa4, 0xb6, 0x0b, 0xb5, 0x44, 0x9d, 0xa8, 0x89, 0x7b, - 0x21, 0x55, 0x9d, 0x1f, 0x55, 0xb8, 0xaf, 0xf6, 0x11, 0x63, 0xd8, 0x2a, 0xee, 0x27, 0xee, 0xdf, - 0x64, 0xf1, 0x0d, 0x1f, 0x88, 0xdb, 0x2e, 0x07, 0x92, 0x73, 0x16, 0xf6, 0xa0, 0x46, 0x0b, 0xb3, - 0xb7, 0x29, 0x41, 0x4d, 0xec, 0x97, 0x87, 0xec, 0x5b, 0xf8, 0x0d, 0x1a, 0x05, 0x7b, 0xf1, 0xf9, - 0x86, 0xdb, 0x14, 0xf2, 0x72, 0xf7, 0x4b, 0x71, 0x4b, 0x85, 0x63, 0x68, 0xae, 0x99, 0x8a, 0x9b, - 0xde, 0x78, 0x2d, 0x29, 0xf7, 0xc5, 0x2d, 0x90, 0x46, 0xe7, 0xdd, 0xeb, 0xcb, 0xb9, 0x67, 0x5f, - 0xcd, 0x3d, 0xfb, 0xf7, 0xdc, 0xb3, 0x7f, 0x2e, 0x3c, 0xeb, 0x6a, 0xe1, 0x59, 0xbf, 0x16, 0x9e, - 0xf5, 0xc5, 0xd5, 0x2c, 0x72, 0xf8, 0x9d, 0x8d, 0x45, 0x70, 0x51, 0xfc, 0xe3, 0x0d, 0x6a, 0xea, - 0x2f, 0xf1, 0xea, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0x75, 0x93, 0xfa, 0x0e, 0x05, 0x00, - 0x00, + // 528 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x13, 0x48, 0x60, 0xd2, 0x14, 0x18, 0x4a, 0x15, 0x8c, 0x64, 0xa5, 0x96, 0x68, 0xd3, + 0xcb, 0xba, 0x2d, 0x08, 0x71, 0x40, 0x42, 0xe9, 0x01, 0x95, 0x0b, 0x52, 0x0d, 0x27, 0xa4, 0x2a, + 0x38, 0xce, 0x36, 0x8d, 0x68, 0xbc, 0xa9, 0xd7, 0xae, 0x9a, 0xbf, 0xe0, 0xb3, 0x38, 0xf6, 0x88, + 0x38, 0xa1, 0xe4, 0xc2, 0x67, 0xa0, 0xac, 0x67, 0x1d, 0x87, 0x9a, 0xb8, 0x07, 0x6e, 0x99, 0xdd, + 0x37, 0xef, 0xbd, 0xcc, 0x3c, 0x2f, 0x58, 0xbe, 0x90, 0x23, 0x21, 0x1d, 0xcf, 0xf7, 0x45, 0x1c, + 0x44, 0xd2, 0xb9, 0xdc, 0x77, 0x2e, 0x62, 0x1e, 0x4e, 0xd8, 0x38, 0x14, 0x91, 0x40, 0x4c, 0xee, + 0x99, 0xbe, 0x67, 0x97, 0xfb, 0xe6, 0xd3, 0x81, 0x10, 0x83, 0x73, 0xee, 0x28, 0x44, 0x2f, 0x3e, + 0x75, 0xbc, 0x80, 0xe0, 0xf6, 0x09, 0x3c, 0xee, 0x24, 0xc8, 0xe3, 0x39, 0x89, 0xcb, 0x2f, 0x62, + 0x2e, 0x23, 0xdc, 0x84, 0x6a, 0xe4, 0x85, 0x03, 0x1e, 0x35, 0x8d, 0x96, 0xd1, 0xbe, 0xef, 0x52, + 0x85, 0x0c, 0x6a, 0x61, 0x02, 0x69, 0x96, 0x5b, 0x46, 0xbb, 0x7e, 0xb0, 0xc1, 0x12, 0x6e, 0xa6, + 0xb9, 0x59, 0x27, 0x98, 0xb8, 0x1a, 0x64, 0x1f, 0xc1, 0xc6, 0x32, 0xbd, 0x1c, 0x8b, 0x40, 0x72, + 0xdc, 0x83, 0x7b, 0x21, 0xfd, 0x56, 0x0a, 0xff, 0x22, 0x4a, 0x51, 0xf6, 0x2e, 0x34, 0x3e, 0xfa, + 0x67, 0x7c, 0xe4, 0x69, 0x8b, 0x4d, 0xa8, 0x79, 0xfd, 0x7e, 0xc8, 0xa5, 0x24, 0x8f, 0xba, 0xb4, + 0xdf, 0x42, 0xed, 0xc8, 0x0b, 0xfa, 0xe7, 0x3c, 0x9c, 0x83, 0xb4, 0x5f, 0x02, 0x51, 0x89, 0x66, + 0xc6, 0x41, 0x59, 0x5d, 0x2d, 0xb4, 0x7e, 0x1a, 0xb0, 0xae, 0xc5, 0xc8, 0xf0, 0x1b, 0xa8, 0x0f, + 0x83, 0x61, 0xd4, 0x95, 0xea, 0x98, 0x3c, 0x3f, 0x63, 0x37, 0x87, 0xcd, 0x48, 0xda, 0x85, 0x39, + 0x3e, 0x61, 0xc1, 0x77, 0xf0, 0x90, 0x5f, 0x71, 0x3f, 0x8e, 0x78, 0xf7, 0x2c, 0xb9, 0x96, 0xcd, + 0x72, 0xab, 0x52, 0x44, 0xf1, 0x80, 0x9a, 0xa8, 0x96, 0x78, 0x08, 0xeb, 0x6a, 0xd7, 0x0b, 0x96, + 0x4a, 0x31, 0x4b, 0x43, 0xb5, 0x68, 0x0e, 0xfb, 0x15, 0x3c, 0x7a, 0x9f, 0x3a, 0xd3, 0xc3, 0xdc, + 0x82, 0x35, 0x6a, 0xed, 0x46, 0x93, 0x31, 0xa7, 0x61, 0xd5, 0xe9, 0xec, 0xd3, 0x64, 0xcc, 0x6d, + 0x17, 0x30, 0xdb, 0xf7, 0x3f, 0xe6, 0x62, 0x33, 0xc0, 0xce, 0x42, 0xa2, 0x78, 0xb3, 0xaf, 0xd3, + 0xb4, 0x26, 0x78, 0x32, 0x71, 0x0b, 0xf7, 0x7b, 0x69, 0x10, 0x3f, 0xc4, 0xa3, 0x1e, 0x0f, 0x8b, + 0xb5, 0x1c, 0x78, 0xf2, 0x57, 0x07, 0xa9, 0x6d, 0x42, 0x35, 0x50, 0x27, 0xaa, 0xe3, 0x8e, 0x4b, + 0xd5, 0xc1, 0xef, 0x0a, 0xdc, 0x55, 0x29, 0x47, 0x1f, 0xd6, 0xb2, 0xa9, 0xc7, 0x9d, 0xbc, 0x79, + 0xe4, 0x7c, 0x76, 0x66, 0xbb, 0x18, 0x48, 0x11, 0x2d, 0xe1, 0x31, 0x54, 0x29, 0x5d, 0x5b, 0x79, + 0x5d, 0x4b, 0xfb, 0x35, 0xed, 0x55, 0x90, 0x94, 0xf2, 0x04, 0x60, 0xb1, 0x62, 0x7c, 0x9e, 0xd7, + 0x73, 0x23, 0x3a, 0xe6, 0x76, 0x11, 0x2c, 0xa5, 0xff, 0x02, 0xf5, 0xcc, 0xf6, 0x70, 0x7b, 0xc5, + 0x9f, 0xcd, 0xc4, 0xc1, 0xdc, 0x29, 0xc4, 0xa5, 0x0a, 0xa7, 0xd0, 0x58, 0xda, 0x19, 0xae, 0x1a, + 0xe8, 0x52, 0x10, 0xcc, 0xdd, 0x5b, 0x20, 0xb5, 0xce, 0xe1, 0xcb, 0xef, 0x53, 0xcb, 0xb8, 0x9e, + 0x5a, 0xc6, 0xaf, 0xa9, 0x65, 0x7c, 0x9b, 0x59, 0xa5, 0xeb, 0x99, 0x55, 0xfa, 0x31, 0xb3, 0x4a, + 0x9f, 0xcd, 0x84, 0x45, 0xf6, 0xbf, 0xb2, 0xa1, 0x70, 0xae, 0xb2, 0xcf, 0x74, 0xaf, 0xaa, 0x9e, + 0xb6, 0x17, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd6, 0xa0, 0x05, 0xca, 0xc3, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -547,6 +642,8 @@ type QueryClient interface { AccountQuery(ctx context.Context, in *AccountQueryRequest, opts ...grpc.CallOption) (*AccountQueryResponse, error) // Schema returns an x/account schema. Unstable. Schema(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) + // InitSchema returns an account's types init schema. Unstable. + InitSchema(ctx context.Context, in *InitSchemaRequest, opts ...grpc.CallOption) (*InitSchemaResponse, 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. @@ -579,6 +676,15 @@ func (c *queryClient) Schema(ctx context.Context, in *SchemaRequest, opts ...grp return out, nil } +func (c *queryClient) InitSchema(ctx context.Context, in *InitSchemaRequest, opts ...grpc.CallOption) (*InitSchemaResponse, error) { + out := new(InitSchemaResponse) + err := c.cc.Invoke(ctx, "/cosmos.accounts.v1.Query/InitSchema", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) AccountType(ctx context.Context, in *AccountTypeRequest, opts ...grpc.CallOption) (*AccountTypeResponse, error) { out := new(AccountTypeResponse) err := c.cc.Invoke(ctx, "/cosmos.accounts.v1.Query/AccountType", in, out, opts...) @@ -603,6 +709,8 @@ type QueryServer interface { AccountQuery(context.Context, *AccountQueryRequest) (*AccountQueryResponse, error) // Schema returns an x/account schema. Unstable. Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) + // InitSchema returns an account's types init schema. Unstable. + InitSchema(context.Context, *InitSchemaRequest) (*InitSchemaResponse, error) // AccountType returns the account type for an address. AccountType(context.Context, *AccountTypeRequest) (*AccountTypeResponse, error) // AccountNumber returns the account number given the account address. @@ -619,6 +727,9 @@ func (*UnimplementedQueryServer) AccountQuery(ctx context.Context, req *AccountQ func (*UnimplementedQueryServer) Schema(ctx context.Context, req *SchemaRequest) (*SchemaResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented") } +func (*UnimplementedQueryServer) InitSchema(ctx context.Context, req *InitSchemaRequest) (*InitSchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitSchema not implemented") +} func (*UnimplementedQueryServer) AccountType(ctx context.Context, req *AccountTypeRequest) (*AccountTypeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountType not implemented") } @@ -666,6 +777,24 @@ func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_InitSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitSchemaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).InitSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.accounts.v1.Query/InitSchema", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InitSchema(ctx, req.(*InitSchemaRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_AccountType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AccountTypeRequest) if err := dec(in); err != nil { @@ -715,6 +844,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Schema", Handler: _Query_Schema_Handler, }, + { + MethodName: "InitSchema", + Handler: _Query_InitSchema_Handler, + }, { MethodName: "AccountType", Handler: _Query_AccountType_Handler, @@ -825,10 +958,47 @@ func (m *SchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.AccountType) > 0 { - i -= len(m.AccountType) - copy(dAtA[i:], m.AccountType) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountType))) + 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 *Handler) 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 *Handler) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Handler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Response) > 0 { + i -= len(m.Response) + copy(dAtA[i:], m.Response) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Response))) + i-- + dAtA[i] = 0x12 + } + if len(m.Request) > 0 { + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Request))) i-- dAtA[i] = 0xa } @@ -898,7 +1068,7 @@ func (m *SchemaResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SchemaResponse_Handler) Marshal() (dAtA []byte, err error) { +func (m *InitSchemaRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -908,27 +1078,55 @@ func (m *SchemaResponse_Handler) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SchemaResponse_Handler) MarshalTo(dAtA []byte) (int, error) { +func (m *InitSchemaRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SchemaResponse_Handler) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitSchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Response) > 0 { - i -= len(m.Response) - copy(dAtA[i:], m.Response) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Response))) + if len(m.AccountType) > 0 { + i -= len(m.AccountType) + copy(dAtA[i:], m.AccountType) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountType))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } - if len(m.Request) > 0 { - i -= len(m.Request) - copy(dAtA[i:], m.Request) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Request))) + return len(dAtA) - i, nil +} + +func (m *InitSchemaResponse) 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 *InitSchemaResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InitSchemaResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.InitSchema != nil { + { + size, err := m.InitSchema.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -1100,7 +1298,24 @@ func (m *SchemaRequest) Size() (n int) { } var l int _ = l - l = len(m.AccountType) + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *Handler) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Request) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Response) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1132,18 +1347,27 @@ func (m *SchemaResponse) Size() (n int) { return n } -func (m *SchemaResponse_Handler) Size() (n int) { +func (m *InitSchemaRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Request) + l = len(m.AccountType) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.Response) - if l > 0 { + return n +} + +func (m *InitSchemaResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InitSchema != nil { + l = m.InitSchema.Size() n += 1 + l + sovQuery(uint64(l)) } return n @@ -1441,7 +1665,7 @@ func (m *SchemaRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1469,7 +1693,121 @@ func (m *SchemaRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AccountType = string(dAtA[iNdEx:postIndex]) + 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 *Handler) 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: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Handler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", 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.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", 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.Response = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1551,7 +1889,7 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.InitSchema == nil { - m.InitSchema = &SchemaResponse_Handler{} + m.InitSchema = &Handler{} } if err := m.InitSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1586,7 +1924,7 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExecuteHandlers = append(m.ExecuteHandlers, &SchemaResponse_Handler{}) + m.ExecuteHandlers = append(m.ExecuteHandlers, &Handler{}) if err := m.ExecuteHandlers[len(m.ExecuteHandlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1620,7 +1958,7 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.QueryHandlers = append(m.QueryHandlers, &SchemaResponse_Handler{}) + m.QueryHandlers = append(m.QueryHandlers, &Handler{}) if err := m.QueryHandlers[len(m.QueryHandlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1646,7 +1984,7 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SchemaResponse_Handler) Unmarshal(dAtA []byte) error { +func (m *InitSchemaRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1669,15 +2007,15 @@ func (m *SchemaResponse_Handler) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Handler: wiretype end group for non-group") + return fmt.Errorf("proto: InitSchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Handler: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AccountType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1705,13 +2043,63 @@ func (m *SchemaResponse_Handler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Request = string(dAtA[iNdEx:postIndex]) + m.AccountType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + 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 *InitSchemaResponse) 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: InitSchemaResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InitSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitSchema", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1721,23 +2109,27 @@ func (m *SchemaResponse_Handler) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Response = string(dAtA[iNdEx:postIndex]) + if m.InitSchema == nil { + m.InitSchema = &Handler{} + } + if err := m.InitSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/accounts/v1/schema.go b/x/accounts/v1/schema.go index 6cebadb306f1..20a1b90b63fa 100644 --- a/x/accounts/v1/schema.go +++ b/x/accounts/v1/schema.go @@ -1,47 +1,9 @@ package v1 import ( - "slices" - "strings" - "google.golang.org/grpc" - - "cosmossdk.io/x/accounts/internal/implementation" ) -func MakeAccountsSchemas(impls map[string]implementation.Implementation) map[string]*SchemaResponse { - m := make(map[string]*SchemaResponse, len(impls)) - for name, impl := range impls { - m[name] = makeAccountSchema(impl) - } - return m -} - -func makeAccountSchema(impl implementation.Implementation) *SchemaResponse { - return &SchemaResponse{ - InitSchema: &SchemaResponse_Handler{ - Request: impl.InitHandlerSchema.RequestSchema.Name, - Response: impl.InitHandlerSchema.ResponseSchema.Name, - }, - ExecuteHandlers: makeHandlersSchema(impl.ExecuteHandlersSchema), - QueryHandlers: makeHandlersSchema(impl.QueryHandlersSchema), - } -} - -func makeHandlersSchema(handlers map[string]implementation.HandlerSchema) []*SchemaResponse_Handler { - schemas := make([]*SchemaResponse_Handler, 0, len(handlers)) - for name, handler := range handlers { - schemas = append(schemas, &SchemaResponse_Handler{ - Request: name, - Response: handler.ResponseSchema.Name, - }) - } - slices.SortFunc(schemas, func(a, b *SchemaResponse_Handler) int { - return strings.Compare(a.Request, b.Request) - }) - return schemas -} - func MsgServiceDesc() *grpc.ServiceDesc { return &_Msg_serviceDesc }