From 6819e26ae06b0f2c36e86db3dee8b8ef35737f3e Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 7 Nov 2023 17:16:16 +0100 Subject: [PATCH 01/19] add interfaces and mock impls --- api/cosmos/accounts/v1/tx.pulsar.go | 1314 ++++++++++++++++- api/cosmos/accounts/v1/tx_grpc.pb.go | 45 +- .../account_abstraction/v1/interface.proto | 66 + .../testing/rotation/v1/partial.proto | 22 + .../accounts/v1/account_abstraction.proto | 63 + proto/cosmos/accounts/v1/tx.proto | 22 + x/accounts/msg_server.go | 7 + .../account_abstraction/partial_account.go | 68 + x/accounts/v1/tx.pb.go | 512 ++++++- 9 files changed, 2033 insertions(+), 86 deletions(-) create mode 100644 proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto create mode 100644 proto/cosmos/accounts/testing/rotation/v1/partial.proto create mode 100644 proto/cosmos/accounts/v1/account_abstraction.proto create mode 100644 x/accounts/testing/account_abstraction/partial_account.go diff --git a/api/cosmos/accounts/v1/tx.pulsar.go b/api/cosmos/accounts/v1/tx.pulsar.go index 0c7d9d098bfb..67cb97c66f85 100644 --- a/api/cosmos/accounts/v1/tx.pulsar.go +++ b/api/cosmos/accounts/v1/tx.pulsar.go @@ -2021,6 +2021,1058 @@ func (x *fastReflection_MsgExecuteResponse) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_MsgExecuteBundle_2_list)(nil) + +type _MsgExecuteBundle_2_list struct { + list *[]*UserOperation +} + +func (x *_MsgExecuteBundle_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgExecuteBundle_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgExecuteBundle_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UserOperation) + (*x.list)[i] = concreteValue +} + +func (x *_MsgExecuteBundle_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UserOperation) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgExecuteBundle_2_list) AppendMutable() protoreflect.Value { + v := new(UserOperation) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteBundle_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgExecuteBundle_2_list) NewElement() protoreflect.Value { + v := new(UserOperation) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteBundle_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgExecuteBundle protoreflect.MessageDescriptor + fd_MsgExecuteBundle_bundler protoreflect.FieldDescriptor + fd_MsgExecuteBundle_operations protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_tx_proto_init() + md_MsgExecuteBundle = File_cosmos_accounts_v1_tx_proto.Messages().ByName("MsgExecuteBundle") + fd_MsgExecuteBundle_bundler = md_MsgExecuteBundle.Fields().ByName("bundler") + fd_MsgExecuteBundle_operations = md_MsgExecuteBundle.Fields().ByName("operations") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecuteBundle)(nil) + +type fastReflection_MsgExecuteBundle MsgExecuteBundle + +func (x *MsgExecuteBundle) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecuteBundle)(x) +} + +func (x *MsgExecuteBundle) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_tx_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_MsgExecuteBundle_messageType fastReflection_MsgExecuteBundle_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecuteBundle_messageType{} + +type fastReflection_MsgExecuteBundle_messageType struct{} + +func (x fastReflection_MsgExecuteBundle_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecuteBundle)(nil) +} +func (x fastReflection_MsgExecuteBundle_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecuteBundle) +} +func (x fastReflection_MsgExecuteBundle_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteBundle +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecuteBundle) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteBundle +} + +// 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_MsgExecuteBundle) Type() protoreflect.MessageType { + return _fastReflection_MsgExecuteBundle_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecuteBundle) New() protoreflect.Message { + return new(fastReflection_MsgExecuteBundle) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecuteBundle) Interface() protoreflect.ProtoMessage { + return (*MsgExecuteBundle)(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_MsgExecuteBundle) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bundler != "" { + value := protoreflect.ValueOfString(x.Bundler) + if !f(fd_MsgExecuteBundle_bundler, value) { + return + } + } + if len(x.Operations) != 0 { + value := protoreflect.ValueOfList(&_MsgExecuteBundle_2_list{list: &x.Operations}) + if !f(fd_MsgExecuteBundle_operations, 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_MsgExecuteBundle) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + return x.Bundler != "" + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + return len(x.Operations) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + x.Bundler = "" + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + x.Operations = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + value := x.Bundler + return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + if len(x.Operations) == 0 { + return protoreflect.ValueOfList(&_MsgExecuteBundle_2_list{}) + } + listValue := &_MsgExecuteBundle_2_list{list: &x.Operations} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + x.Bundler = value.Interface().(string) + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + lv := value.List() + clv := lv.(*_MsgExecuteBundle_2_list) + x.Operations = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + if x.Operations == nil { + x.Operations = []*UserOperation{} + } + value := &_MsgExecuteBundle_2_list{list: &x.Operations} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + panic(fmt.Errorf("field bundler of message cosmos.accounts.v1.MsgExecuteBundle is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundle.bundler": + return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.MsgExecuteBundle.operations": + list := []*UserOperation{} + return protoreflect.ValueOfList(&_MsgExecuteBundle_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundle")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundle 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_MsgExecuteBundle) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.MsgExecuteBundle", 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_MsgExecuteBundle) 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_MsgExecuteBundle) 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_MsgExecuteBundle) 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_MsgExecuteBundle) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecuteBundle) + 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.Bundler) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Operations) > 0 { + for _, e := range x.Operations { + 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().(*MsgExecuteBundle) + 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.Operations) > 0 { + for iNdEx := len(x.Operations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Operations[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 len(x.Bundler) > 0 { + i -= len(x.Bundler) + copy(dAtA[i:], x.Bundler) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bundler))) + 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().(*MsgExecuteBundle) + 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: MsgExecuteBundle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteBundle: 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 Bundler", 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.Bundler = 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 Operations", 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.Operations = append(x.Operations, &UserOperation{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Operations[len(x.Operations)-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 _ protoreflect.List = (*_MsgExecuteBundleResponse_1_list)(nil) + +type _MsgExecuteBundleResponse_1_list struct { + list *[]*UserOperationResponse +} + +func (x *_MsgExecuteBundleResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgExecuteBundleResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgExecuteBundleResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UserOperationResponse) + (*x.list)[i] = concreteValue +} + +func (x *_MsgExecuteBundleResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UserOperationResponse) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgExecuteBundleResponse_1_list) AppendMutable() protoreflect.Value { + v := new(UserOperationResponse) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteBundleResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgExecuteBundleResponse_1_list) NewElement() protoreflect.Value { + v := new(UserOperationResponse) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteBundleResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgExecuteBundleResponse protoreflect.MessageDescriptor + fd_MsgExecuteBundleResponse_responses protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_tx_proto_init() + md_MsgExecuteBundleResponse = File_cosmos_accounts_v1_tx_proto.Messages().ByName("MsgExecuteBundleResponse") + fd_MsgExecuteBundleResponse_responses = md_MsgExecuteBundleResponse.Fields().ByName("responses") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecuteBundleResponse)(nil) + +type fastReflection_MsgExecuteBundleResponse MsgExecuteBundleResponse + +func (x *MsgExecuteBundleResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecuteBundleResponse)(x) +} + +func (x *MsgExecuteBundleResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_tx_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_MsgExecuteBundleResponse_messageType fastReflection_MsgExecuteBundleResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecuteBundleResponse_messageType{} + +type fastReflection_MsgExecuteBundleResponse_messageType struct{} + +func (x fastReflection_MsgExecuteBundleResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecuteBundleResponse)(nil) +} +func (x fastReflection_MsgExecuteBundleResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecuteBundleResponse) +} +func (x fastReflection_MsgExecuteBundleResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteBundleResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecuteBundleResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteBundleResponse +} + +// 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_MsgExecuteBundleResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgExecuteBundleResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecuteBundleResponse) New() protoreflect.Message { + return new(fastReflection_MsgExecuteBundleResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecuteBundleResponse) Interface() protoreflect.ProtoMessage { + return (*MsgExecuteBundleResponse)(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_MsgExecuteBundleResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Responses) != 0 { + value := protoreflect.ValueOfList(&_MsgExecuteBundleResponse_1_list{list: &x.Responses}) + if !f(fd_MsgExecuteBundleResponse_responses, 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_MsgExecuteBundleResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + return len(x.Responses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + x.Responses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + if len(x.Responses) == 0 { + return protoreflect.ValueOfList(&_MsgExecuteBundleResponse_1_list{}) + } + listValue := &_MsgExecuteBundleResponse_1_list{list: &x.Responses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + lv := value.List() + clv := lv.(*_MsgExecuteBundleResponse_1_list) + x.Responses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + if x.Responses == nil { + x.Responses = []*UserOperationResponse{} + } + value := &_MsgExecuteBundleResponse_1_list{list: &x.Responses} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.MsgExecuteBundleResponse.responses": + list := []*UserOperationResponse{} + return protoreflect.ValueOfList(&_MsgExecuteBundleResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.MsgExecuteBundleResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.MsgExecuteBundleResponse 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_MsgExecuteBundleResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.MsgExecuteBundleResponse", 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_MsgExecuteBundleResponse) 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_MsgExecuteBundleResponse) 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_MsgExecuteBundleResponse) 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_MsgExecuteBundleResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecuteBundleResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Responses) > 0 { + for _, e := range x.Responses { + 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().(*MsgExecuteBundleResponse) + 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.Responses) > 0 { + for iNdEx := len(x.Responses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Responses[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] = 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().(*MsgExecuteBundleResponse) + 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: MsgExecuteBundleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteBundleResponse: 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 Responses", 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.Responses = append(x.Responses, &UserOperationResponse{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Responses[len(x.Responses)-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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2229,6 +3281,90 @@ func (x *MsgExecuteResponse) GetResponse() []byte { return nil } +// MsgExecuteBundle defines the ExecuteBundle request type for the Msg/ExecuteBundle RPC method. +type MsgExecuteBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bundler defines the entity going through the standard TX flow + // to execute one or multiple UserOperations on behalf of others. + Bundler string `protobuf:"bytes,1,opt,name=bundler,proto3" json:"bundler,omitempty"` + // operations is the list of operations to be executed. + Operations []*UserOperation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` +} + +func (x *MsgExecuteBundle) Reset() { + *x = MsgExecuteBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecuteBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecuteBundle) ProtoMessage() {} + +// Deprecated: Use MsgExecuteBundle.ProtoReflect.Descriptor instead. +func (*MsgExecuteBundle) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgExecuteBundle) GetBundler() string { + if x != nil { + return x.Bundler + } + return "" +} + +func (x *MsgExecuteBundle) GetOperations() []*UserOperation { + if x != nil { + return x.Operations + } + return nil +} + +// MsgExecuteBundleResponse defines the ExecuteBundle response type for the Msg/ExecuteBundle RPC method. +type MsgExecuteBundleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // responses is the list of responses returned by the account implementations. + Responses []*UserOperationResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *MsgExecuteBundleResponse) Reset() { + *x = MsgExecuteBundleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecuteBundleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecuteBundleResponse) ProtoMessage() {} + +// Deprecated: Use MsgExecuteBundleResponse.ProtoReflect.Descriptor instead. +func (*MsgExecuteBundleResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgExecuteBundleResponse) GetResponses() []*UserOperationResponse { + if x != nil { + return x.Responses + } + return nil +} + var File_cosmos_accounts_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_accounts_v1_tx_proto_rawDesc = []byte{ @@ -2236,52 +3372,75 @@ var file_cosmos_accounts_v1_tx_proto_rawDesc = []byte{ 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x07, 0x4d, 0x73, - 0x67, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, - 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x56, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x49, 0x6e, - 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x63, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa9, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x48, - 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, - 0x6e, 0x69, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, - 0x2a, 0x01, 0x42, 0xbb, 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, 0x07, 0x54, - 0x78, 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, + 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x49, + 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x56, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x0a, + 0x0a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x22, 0x30, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x32, 0x8e, 0x02, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x48, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x63, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbb, 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, 0x07, 0x54, 0x78, 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 ( @@ -2296,23 +3455,31 @@ func file_cosmos_accounts_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_accounts_v1_tx_proto_rawDescData } -var file_cosmos_accounts_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_accounts_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_cosmos_accounts_v1_tx_proto_goTypes = []interface{}{ - (*MsgInit)(nil), // 0: cosmos.accounts.v1.MsgInit - (*MsgInitResponse)(nil), // 1: cosmos.accounts.v1.MsgInitResponse - (*MsgExecute)(nil), // 2: cosmos.accounts.v1.MsgExecute - (*MsgExecuteResponse)(nil), // 3: cosmos.accounts.v1.MsgExecuteResponse + (*MsgInit)(nil), // 0: cosmos.accounts.v1.MsgInit + (*MsgInitResponse)(nil), // 1: cosmos.accounts.v1.MsgInitResponse + (*MsgExecute)(nil), // 2: cosmos.accounts.v1.MsgExecute + (*MsgExecuteResponse)(nil), // 3: cosmos.accounts.v1.MsgExecuteResponse + (*MsgExecuteBundle)(nil), // 4: cosmos.accounts.v1.MsgExecuteBundle + (*MsgExecuteBundleResponse)(nil), // 5: cosmos.accounts.v1.MsgExecuteBundleResponse + (*UserOperation)(nil), // 6: cosmos.accounts.v1.UserOperation + (*UserOperationResponse)(nil), // 7: cosmos.accounts.v1.UserOperationResponse } var file_cosmos_accounts_v1_tx_proto_depIdxs = []int32{ - 0, // 0: cosmos.accounts.v1.Msg.Init:input_type -> cosmos.accounts.v1.MsgInit - 2, // 1: cosmos.accounts.v1.Msg.Execute:input_type -> cosmos.accounts.v1.MsgExecute - 1, // 2: cosmos.accounts.v1.Msg.Init:output_type -> cosmos.accounts.v1.MsgInitResponse - 3, // 3: cosmos.accounts.v1.Msg.Execute:output_type -> cosmos.accounts.v1.MsgExecuteResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 6, // 0: cosmos.accounts.v1.MsgExecuteBundle.operations:type_name -> cosmos.accounts.v1.UserOperation + 7, // 1: cosmos.accounts.v1.MsgExecuteBundleResponse.responses:type_name -> cosmos.accounts.v1.UserOperationResponse + 0, // 2: cosmos.accounts.v1.Msg.Init:input_type -> cosmos.accounts.v1.MsgInit + 2, // 3: cosmos.accounts.v1.Msg.Execute:input_type -> cosmos.accounts.v1.MsgExecute + 4, // 4: cosmos.accounts.v1.Msg.ExecuteBundle:input_type -> cosmos.accounts.v1.MsgExecuteBundle + 1, // 5: cosmos.accounts.v1.Msg.Init:output_type -> cosmos.accounts.v1.MsgInitResponse + 3, // 6: cosmos.accounts.v1.Msg.Execute:output_type -> cosmos.accounts.v1.MsgExecuteResponse + 5, // 7: cosmos.accounts.v1.Msg.ExecuteBundle:output_type -> cosmos.accounts.v1.MsgExecuteBundleResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_cosmos_accounts_v1_tx_proto_init() } @@ -2320,6 +3487,7 @@ func file_cosmos_accounts_v1_tx_proto_init() { if File_cosmos_accounts_v1_tx_proto != nil { return } + file_cosmos_accounts_v1_account_abstraction_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_accounts_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgInit); i { @@ -2369,6 +3537,30 @@ func file_cosmos_accounts_v1_tx_proto_init() { return nil } } + file_cosmos_accounts_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecuteBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecuteBundleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2376,7 +3568,7 @@ func file_cosmos_accounts_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/accounts/v1/tx_grpc.pb.go b/api/cosmos/accounts/v1/tx_grpc.pb.go index 553510dfa123..24d01e340e18 100644 --- a/api/cosmos/accounts/v1/tx_grpc.pb.go +++ b/api/cosmos/accounts/v1/tx_grpc.pb.go @@ -19,8 +19,9 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_Init_FullMethodName = "/cosmos.accounts.v1.Msg/Init" - Msg_Execute_FullMethodName = "/cosmos.accounts.v1.Msg/Execute" + Msg_Init_FullMethodName = "/cosmos.accounts.v1.Msg/Init" + Msg_Execute_FullMethodName = "/cosmos.accounts.v1.Msg/Execute" + Msg_ExecuteBundle_FullMethodName = "/cosmos.accounts.v1.Msg/ExecuteBundle" ) // MsgClient is the client API for Msg service. @@ -31,6 +32,9 @@ type MsgClient interface { Init(ctx context.Context, in *MsgInit, opts ...grpc.CallOption) (*MsgInitResponse, error) // Execute executes a message to the target account. Execute(ctx context.Context, in *MsgExecute, opts ...grpc.CallOption) (*MsgExecuteResponse, error) + // ExecuteBundle pertains account abstraction, it is used by the bundler + // to execute multiple UserOperations in a single transaction message. + ExecuteBundle(ctx context.Context, in *MsgExecuteBundle, opts ...grpc.CallOption) (*MsgExecuteBundleResponse, error) } type msgClient struct { @@ -59,6 +63,15 @@ func (c *msgClient) Execute(ctx context.Context, in *MsgExecute, opts ...grpc.Ca return out, nil } +func (c *msgClient) ExecuteBundle(ctx context.Context, in *MsgExecuteBundle, opts ...grpc.CallOption) (*MsgExecuteBundleResponse, error) { + out := new(MsgExecuteBundleResponse) + err := c.cc.Invoke(ctx, Msg_ExecuteBundle_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -67,6 +80,9 @@ type MsgServer interface { Init(context.Context, *MsgInit) (*MsgInitResponse, error) // Execute executes a message to the target account. Execute(context.Context, *MsgExecute) (*MsgExecuteResponse, error) + // ExecuteBundle pertains account abstraction, it is used by the bundler + // to execute multiple UserOperations in a single transaction message. + ExecuteBundle(context.Context, *MsgExecuteBundle) (*MsgExecuteBundleResponse, error) mustEmbedUnimplementedMsgServer() } @@ -80,6 +96,9 @@ func (UnimplementedMsgServer) Init(context.Context, *MsgInit) (*MsgInitResponse, func (UnimplementedMsgServer) Execute(context.Context, *MsgExecute) (*MsgExecuteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented") } +func (UnimplementedMsgServer) ExecuteBundle(context.Context, *MsgExecuteBundle) (*MsgExecuteBundleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteBundle not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -129,6 +148,24 @@ func _Msg_Execute_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_ExecuteBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecuteBundle) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecuteBundle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ExecuteBundle_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecuteBundle(ctx, req.(*MsgExecuteBundle)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -144,6 +181,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "Execute", Handler: _Msg_Execute_Handler, }, + { + MethodName: "ExecuteBundle", + Handler: _Msg_ExecuteBundle_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/accounts/v1/tx.proto", diff --git a/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto new file mode 100644 index 000000000000..0f09e60c688b --- /dev/null +++ b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package cosmos.accounts.interfaces.account_abstraction.v1; + +import "google/protobuf/any.proto"; +import "cosmos/accounts/v1/account_abstraction.proto"; + +// MsgAuthenticate is a message that an x/account account abstraction implementer +// must handle to authenticate a state transition. +message MsgAuthenticate { + // user_operation is the operation that the user is trying to perform. + // it also contains authentication information. + cosmos.accounts.v1.UserOperation user_operation = 1; + // chain_id defines the network identifier. + string chain_id = 2; + // account_number is the account number of the user_operation. + uint64 account_number = 3; +} + +// MsgAuthenticateResponse is the response to MsgAuthenticate. +// The authentication either fails or succeeds, this is why +// there are no auxiliary fields to the response. +message MsgAuthenticateResponse {} + +// MsgPayBundler is a message that an x/account account abstraction implementer +// can optionally implement in case it wants to further refine control over +// the bundler payment messages. +// The account must ensure the caller of this message is the x/accounts module itself. +message MsgPayBundler { + // bundler_payment_messages are the messages that the operation sender will execute. + // The account can modify the messages as it sees fit. + repeated google.protobuf.Any bundler_payment_messages = 1; +} + +// MsgPayBundlerResponse is the response to MsgPayBundler. +message MsgPayBundlerResponse { + // bundler_payment_messages_response are the messages that the bundler will pay for. + repeated google.protobuf.Any bundler_payment_messages_response = 1; +} + +// MsgExecute is a message that an x/account account abstraction implementer +// can optionally implement in case it wants to further refine control over +// the execution messages. It can be used to extend the execution flow, possibly +// block certain messages, or modify them. +// The account must ensure the caller of this message is the x/accounts module itself. +message MsgExecute { + // execution_messages are the messages that the operation sender will execute. + // The account can modify the messages as it sees fit. + repeated google.protobuf.Any execution_messages = 1; +} + +// MsgExecuteResponse is the response to MsgExecute. +message MsgExecuteResponse { + // execution_messages_response are the messages that the operation sender will execute. + repeated google.protobuf.Any execution_messages_response = 1; +} + +// QueryAuthenticationMethods is a query that an x/account account abstraction implementer +// must handle to return the authentication methods that the account supports. +message QueryAuthenticationMethods {} + +// QueryAuthenticationMethodsResponse is the response to QueryAuthenticationMethods. +message QueryAuthenticationMethodsResponse { + // authentication_methods are the authentication methods that the account supports. + repeated string authentication_methods = 1; +} \ No newline at end of file diff --git a/proto/cosmos/accounts/testing/rotation/v1/partial.proto b/proto/cosmos/accounts/testing/rotation/v1/partial.proto new file mode 100644 index 000000000000..9e41d94a06a4 --- /dev/null +++ b/proto/cosmos/accounts/testing/rotation/v1/partial.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.accounts.testing.rotation.v1; + +// MsgInit is the init message used to create a new account +// abstraction implementation that we use for testing, this account +// also allows for rotating the public key. +message MsgInit { + bytes pub_key_bytes = 1; +} + +// MsgInitResponse is the init message response. +message MsgInitResponse {} + +// MsgRotatePubKey is the message used to swap the public key +// of the account. +message MsgRotatePubKey { + bytes new_pub_key_bytes = 1; +} + +// MsgRotatePubKeyResponse is the MsgRotatePubKey response. +message MsgRotatePubKeyResponse {} \ No newline at end of file diff --git a/proto/cosmos/accounts/v1/account_abstraction.proto b/proto/cosmos/accounts/v1/account_abstraction.proto new file mode 100644 index 000000000000..a77eda5cea97 --- /dev/null +++ b/proto/cosmos/accounts/v1/account_abstraction.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; + +package cosmos.accounts.v1; + +option go_package = "cosmossdk.io/x/accounts/v1"; + +import "google/protobuf/any.proto"; + +// UserOperation defines the type used to define a state transition that +// an account wants to make. +message UserOperation { + // sender defines the account that is sending the UserOperation. + string sender = 1; + // authentication_method defines the authentication strategy the account wants to use. + // since accounts can have multiple authentication methods, this field is used to + // instruct the account on what auth method to use. + string authentication_method = 2; + // authentication_data defines the authentication data associated with the authentication method. + // It is the account implementer duty to assess that the UserOperation is properly signed. + bytes authentication_data = 3; + // sequence defines the sequence number of the account, the authentication method might require this + // to ensure non-replayability. + uint64 sequence = 4; + // authentication_gas_limit expresses the gas limit to be used for the authentication part of the + // UserOperation. + uint64 authentication_gas_limit = 5; + // bundler_payment_messages expresses a list of messages that the account + // executes to pay the bundler for submitting the UserOperation. + // It can be empty if the bundler does not need any form of payment, + // the handshake for submitting the UserOperation might have happened off-chain. + // Bundlers and accounts are free to use any form of payment, in fact the payment can + // either be empty or be expressed as: + // - NFT payment + // - IBC Token payment. + // - Payment through delegations. + repeated google.protobuf.Any bundler_payment_messages = 6; + // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. + // This ensures that, since the bundler executes a list of UserOperations and there needs to + // be minimal trust between bundler and UserOperation sender, the sender cannot consume + // the whole bundle gas. + uint64 bundler_payment_gas_limit = 7; + // execution_messages expresses a list of messages that the account wants to execute. + // This concretely is the intent of the transaction expressed as a UserOperation. + repeated google.protobuf.Any execution_messages = 8; + // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's + // execution messages. + uint64 execution_gas_limit = 9; +} + +// UserOperationResponse defines the response of a UserOperation. +message UserOperationResponse { + // authentication_gas_used defines the gas used for the authentication part of the UserOperation. + uint64 authentication_gas_used = 1; + // bundler_payment_gas_used defines the gas used for the bundler payment part of the UserOperation. + uint64 bundler_payment_gas_used = 2; + // bundler_payment_responses defines the responses of the bundler payment messages. + // It can be empty if the bundler does not need any form of payment. + repeated google.protobuf.Any bundler_payment_responses = 3; + // execution_gas_used defines the gas used for the execution part of the UserOperation. + uint64 execution_gas_used = 4; + // execution_responses defines the responses of the execution messages. + repeated google.protobuf.Any execution_responses = 5; +} \ No newline at end of file diff --git a/proto/cosmos/accounts/v1/tx.proto b/proto/cosmos/accounts/v1/tx.proto index 583b540d50e2..6fc084523c3f 100644 --- a/proto/cosmos/accounts/v1/tx.proto +++ b/proto/cosmos/accounts/v1/tx.proto @@ -5,6 +5,7 @@ package cosmos.accounts.v1; option go_package = "cosmossdk.io/x/accounts/v1"; import "cosmos/msg/v1/msg.proto"; +import "cosmos/accounts/v1/account_abstraction.proto"; // Msg defines the Msg service for the x/accounts module. service Msg { @@ -15,6 +16,10 @@ service Msg { // Execute executes a message to the target account. rpc Execute(MsgExecute) returns (MsgExecuteResponse); + + // ExecuteBundle pertains account abstraction, it is used by the bundler + // to execute multiple UserOperations in a single transaction message. + rpc ExecuteBundle(MsgExecuteBundle) returns (MsgExecuteBundleResponse); } // MsgInit defines the Create request type for the Msg/Create RPC method. @@ -55,3 +60,20 @@ message MsgExecuteResponse { // response is the response returned by the account implementation. bytes response = 1; } + +// -------- Account Abstraction --------- + +// MsgExecuteBundle defines the ExecuteBundle request type for the Msg/ExecuteBundle RPC method. +message MsgExecuteBundle { + // bundler defines the entity going through the standard TX flow + // to execute one or multiple UserOperations on behalf of others. + string bundler = 1; + // operations is the list of operations to be executed. + repeated UserOperation operations = 2; +} + +// MsgExecuteBundleResponse defines the ExecuteBundle response type for the Msg/ExecuteBundle RPC method. +message MsgExecuteBundleResponse { + // responses is the list of responses returned by the account implementations. + repeated UserOperationResponse responses = 1; +} diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 9781da1c71bb..5b5408790406 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -3,6 +3,9 @@ package accounts import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "cosmossdk.io/core/event" v1 "cosmossdk.io/x/accounts/v1" ) @@ -116,3 +119,7 @@ func (m msgServer) Execute(ctx context.Context, execute *v1.MsgExecute) (*v1.Msg Response: respBytes, }, nil } + +func (m msgServer) ExecuteBundle(ctx context.Context, req *v1.MsgExecuteBundle) (*v1.MsgExecuteBundleResponse, error) { + return nil, status.New(codes.Unimplemented, "not implemented").Err() +} diff --git a/x/accounts/testing/account_abstraction/partial_account.go b/x/accounts/testing/account_abstraction/partial_account.go new file mode 100644 index 000000000000..43acef23e053 --- /dev/null +++ b/x/accounts/testing/account_abstraction/partial_account.go @@ -0,0 +1,68 @@ +package account_abstraction + +import ( + "context" + "fmt" + + account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" + rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + "cosmossdk.io/collections" + "cosmossdk.io/x/accounts/accountstd" + + "github.com/cosmos/cosmos-sdk/codec" +) + +var ( + PubKeyPrefix = collections.NewPrefix(0) + SequencePrefix = collections.NewPrefix(1) +) + +var _ accountstd.Interface = (*PartialAccount)(nil) + +func NewPartialAccount(d accountstd.Dependencies) (PartialAccount, error) { + return PartialAccount{ + PubKey: collections.NewItem(d.SchemaBuilder, PubKeyPrefix, "pubkey", codec.CollValueV2[secp256k1.PubKey]()), + Sequence: collections.NewItem(d.SchemaBuilder, SequencePrefix, "sequence", collections.Uint64Value), + }, nil +} + +// PartialAccount implements the Account interface. It also +// implements the account_abstraction interface, it only implements +// the minimum methods required to be a valid account_abstraction +// implementer. +type PartialAccount struct { + PubKey collections.Item[*secp256k1.PubKey] + Sequence collections.Item[uint64] +} + +func (a PartialAccount) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +func (a PartialAccount) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +// Authenticate authenticates the account. +func (a PartialAccount) Authenticate(ctx context.Context, msg *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +// QueryAuthenticateMethods queries the authentication methods of the account. +func (a PartialAccount) QueryAuthenticateMethods(ctx context.Context, req *account_abstractionv1.QueryAuthenticationMethods) (*account_abstractionv1.QueryAuthenticationMethodsResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +func (a PartialAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { + accountstd.RegisterInitHandler(builder, a.Init) +} + +func (a PartialAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { + accountstd.RegisterExecuteHandler(builder, a.RotatePubKey) + accountstd.RegisterExecuteHandler(builder, a.Authenticate) // implements account_abstraction +} + +func (a PartialAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { + accountstd.RegisterQueryHandler(builder, a.QueryAuthenticateMethods) // implements account_abstraction +} diff --git a/x/accounts/v1/tx.pb.go b/x/accounts/v1/tx.pb.go index 1be15a31050c..9083942bbfcc 100644 --- a/x/accounts/v1/tx.pb.go +++ b/x/accounts/v1/tx.pb.go @@ -259,39 +259,150 @@ func (m *MsgExecuteResponse) GetResponse() []byte { return nil } +// MsgExecuteBundle defines the ExecuteBundle request type for the Msg/ExecuteBundle RPC method. +type MsgExecuteBundle struct { + // bundler defines the entity going through the standard TX flow + // to execute one or multiple UserOperations on behalf of others. + Bundler string `protobuf:"bytes,1,opt,name=bundler,proto3" json:"bundler,omitempty"` + // operations is the list of operations to be executed. + Operations []*UserOperation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` +} + +func (m *MsgExecuteBundle) Reset() { *m = MsgExecuteBundle{} } +func (m *MsgExecuteBundle) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteBundle) ProtoMessage() {} +func (*MsgExecuteBundle) Descriptor() ([]byte, []int) { + return fileDescriptor_29c2b6d8a13d4189, []int{4} +} +func (m *MsgExecuteBundle) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteBundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteBundle.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 *MsgExecuteBundle) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteBundle.Merge(m, src) +} +func (m *MsgExecuteBundle) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteBundle) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteBundle.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteBundle proto.InternalMessageInfo + +func (m *MsgExecuteBundle) GetBundler() string { + if m != nil { + return m.Bundler + } + return "" +} + +func (m *MsgExecuteBundle) GetOperations() []*UserOperation { + if m != nil { + return m.Operations + } + return nil +} + +// MsgExecuteBundleResponse defines the ExecuteBundle response type for the Msg/ExecuteBundle RPC method. +type MsgExecuteBundleResponse struct { + // responses is the list of responses returned by the account implementations. + Responses []*UserOperationResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (m *MsgExecuteBundleResponse) Reset() { *m = MsgExecuteBundleResponse{} } +func (m *MsgExecuteBundleResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteBundleResponse) ProtoMessage() {} +func (*MsgExecuteBundleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_29c2b6d8a13d4189, []int{5} +} +func (m *MsgExecuteBundleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteBundleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteBundleResponse.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 *MsgExecuteBundleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteBundleResponse.Merge(m, src) +} +func (m *MsgExecuteBundleResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteBundleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteBundleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteBundleResponse proto.InternalMessageInfo + +func (m *MsgExecuteBundleResponse) GetResponses() []*UserOperationResponse { + if m != nil { + return m.Responses + } + return nil +} + func init() { proto.RegisterType((*MsgInit)(nil), "cosmos.accounts.v1.MsgInit") proto.RegisterType((*MsgInitResponse)(nil), "cosmos.accounts.v1.MsgInitResponse") proto.RegisterType((*MsgExecute)(nil), "cosmos.accounts.v1.MsgExecute") proto.RegisterType((*MsgExecuteResponse)(nil), "cosmos.accounts.v1.MsgExecuteResponse") + proto.RegisterType((*MsgExecuteBundle)(nil), "cosmos.accounts.v1.MsgExecuteBundle") + proto.RegisterType((*MsgExecuteBundleResponse)(nil), "cosmos.accounts.v1.MsgExecuteBundleResponse") } func init() { proto.RegisterFile("cosmos/accounts/v1/tx.proto", fileDescriptor_29c2b6d8a13d4189) } var fileDescriptor_29c2b6d8a13d4189 = []byte{ - // 349 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xb1, 0x4e, 0x02, 0x41, - 0x10, 0x65, 0x45, 0x41, 0x07, 0x22, 0xc9, 0x16, 0x78, 0x39, 0x92, 0x0d, 0x62, 0xa2, 0x84, 0xe2, - 0x4e, 0xd4, 0xca, 0x4e, 0x13, 0x13, 0x2d, 0x28, 0xbc, 0x18, 0x0b, 0x1b, 0x73, 0xde, 0x6d, 0x36, - 0x84, 0xdc, 0xed, 0xe5, 0x66, 0x21, 0xd0, 0x19, 0xbf, 0xc0, 0xdf, 0xb0, 0xe3, 0x33, 0x2c, 0x29, - 0x2d, 0x0d, 0x14, 0xfc, 0x86, 0xf1, 0x6e, 0x0f, 0x31, 0x06, 0x62, 0xf9, 0xe6, 0xcd, 0xbe, 0xf7, - 0x66, 0x76, 0xa0, 0xe6, 0x49, 0x0c, 0x24, 0xda, 0xae, 0xe7, 0xc9, 0x7e, 0xa8, 0xd0, 0x1e, 0xb4, - 0x6d, 0x35, 0xb4, 0xa2, 0x58, 0x2a, 0x49, 0x69, 0x4a, 0x5a, 0x19, 0x69, 0x0d, 0xda, 0xe6, 0x9e, - 0x7e, 0x10, 0xa0, 0xf8, 0xee, 0x0d, 0x50, 0xa4, 0xcd, 0x8d, 0x1e, 0x14, 0x3b, 0x28, 0x6e, 0xc2, - 0xae, 0xa2, 0x55, 0x28, 0x20, 0x0f, 0x7d, 0x1e, 0x1b, 0xa4, 0x4e, 0x9a, 0x3b, 0x8e, 0x46, 0x74, - 0x1f, 0xca, 0x5a, 0xea, 0x51, 0x8d, 0x22, 0x6e, 0x6c, 0x24, 0x6c, 0x49, 0xd7, 0xee, 0x46, 0x11, - 0xa7, 0x06, 0x14, 0x03, 0x8e, 0xe8, 0x0a, 0x6e, 0xe4, 0xeb, 0xa4, 0x59, 0x76, 0x32, 0x78, 0x5e, - 0x7a, 0x99, 0x8f, 0x5b, 0x5a, 0xa9, 0x71, 0x0f, 0x15, 0x6d, 0xe6, 0x70, 0x8c, 0x64, 0x88, 0x9c, - 0x1e, 0x41, 0x25, 0x13, 0x77, 0x7d, 0x3f, 0xe6, 0x88, 0xda, 0x7d, 0x57, 0x97, 0x2f, 0xd2, 0x2a, - 0x35, 0x61, 0x3b, 0xd6, 0x8f, 0x92, 0x04, 0x65, 0x67, 0x81, 0x1b, 0x1e, 0x40, 0x07, 0xc5, 0xd5, - 0x90, 0x7b, 0x7d, 0xc5, 0x57, 0xce, 0x51, 0x85, 0x82, 0x72, 0x63, 0xc1, 0x95, 0x9e, 0x40, 0xa3, - 0xff, 0x86, 0x3f, 0x06, 0xfa, 0x63, 0xb2, 0xc8, 0xbf, 0x1c, 0x8b, 0xfc, 0x8e, 0x75, 0xf2, 0x46, - 0x20, 0xdf, 0x41, 0x41, 0xaf, 0x61, 0x33, 0x59, 0x70, 0xcd, 0xfa, 0xfb, 0x33, 0x96, 0x5e, 0x88, - 0x79, 0xb0, 0x86, 0x5c, 0xb8, 0xdd, 0x42, 0x31, 0x9b, 0x92, 0xad, 0xe8, 0xd7, 0xbc, 0x79, 0xb8, - 0x9e, 0xcf, 0x24, 0xcd, 0xad, 0xe7, 0xf9, 0xb8, 0x45, 0x2e, 0xcf, 0xde, 0xa7, 0x8c, 0x4c, 0xa6, - 0x8c, 0x7c, 0x4e, 0x19, 0x79, 0x9d, 0xb1, 0xdc, 0x64, 0xc6, 0x72, 0x1f, 0x33, 0x96, 0x7b, 0x30, - 0x53, 0x1d, 0xf4, 0x7b, 0x56, 0x57, 0xda, 0xc3, 0xe5, 0x9b, 0x7b, 0x2a, 0x24, 0x47, 0x74, 0xfa, - 0x15, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x2e, 0x5d, 0x73, 0x90, 0x02, 0x00, 0x00, + // 454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0xaf, 0x5b, 0x68, 0xd9, 0x6b, 0x61, 0xc8, 0x87, 0x11, 0x79, 0x52, 0xd4, 0x05, 0x04, 0x65, + 0x9a, 0x12, 0x36, 0x38, 0x71, 0xdb, 0x24, 0x04, 0x1c, 0x2a, 0x44, 0x04, 0x1c, 0xb8, 0xa0, 0xd4, + 0xb1, 0xa2, 0x6a, 0x24, 0x8e, 0xfc, 0xdc, 0xa9, 0xbb, 0x21, 0x3e, 0x00, 0xe2, 0xa3, 0xec, 0x63, + 0x70, 0xdc, 0x91, 0x23, 0x6a, 0x0f, 0xfb, 0x1a, 0x28, 0x89, 0x9d, 0x96, 0xb1, 0x75, 0xbd, 0xe5, + 0xf9, 0xf7, 0xe7, 0xfd, 0xfc, 0x5e, 0x0c, 0xdb, 0x5c, 0x62, 0x2a, 0x31, 0x88, 0x38, 0x97, 0x93, + 0x4c, 0x63, 0x70, 0xb2, 0x1f, 0xe8, 0xa9, 0x9f, 0x2b, 0xa9, 0x25, 0xa5, 0x15, 0xe8, 0x5b, 0xd0, + 0x3f, 0xd9, 0x67, 0x0f, 0x8c, 0x20, 0xc5, 0xa4, 0xe0, 0xa6, 0x98, 0x54, 0x64, 0xb6, 0x77, 0x85, + 0x93, 0xf9, 0xfe, 0x12, 0x8d, 0x50, 0xab, 0x88, 0xeb, 0xb1, 0xcc, 0x2a, 0xb6, 0x77, 0x0c, 0x9d, + 0x21, 0x26, 0x6f, 0xb3, 0xb1, 0xa6, 0x5b, 0xd0, 0x46, 0x91, 0xc5, 0x42, 0x39, 0xa4, 0x4f, 0x06, + 0x1b, 0xa1, 0xa9, 0xe8, 0x0e, 0xf4, 0xac, 0x5e, 0x9f, 0xe6, 0xc2, 0x69, 0x96, 0x68, 0xd7, 0x9c, + 0x7d, 0x38, 0xcd, 0x05, 0x75, 0xa0, 0x93, 0x0a, 0xc4, 0x28, 0x11, 0x4e, 0xab, 0x4f, 0x06, 0xbd, + 0xd0, 0x96, 0x2f, 0xbb, 0xdf, 0x2f, 0xce, 0x76, 0x8d, 0x93, 0xf7, 0x09, 0x36, 0x4d, 0xb3, 0x50, + 0x60, 0x2e, 0x33, 0x14, 0xf4, 0x09, 0x6c, 0xd6, 0xe1, 0xe2, 0x58, 0x09, 0x44, 0xd3, 0xfd, 0x9e, + 0x39, 0x3e, 0xac, 0x4e, 0x29, 0x83, 0x3b, 0xca, 0x88, 0xca, 0x04, 0xbd, 0xb0, 0xae, 0x3d, 0x0e, + 0x30, 0xc4, 0xe4, 0xd5, 0x54, 0xf0, 0x89, 0x16, 0xd7, 0xde, 0x63, 0x0b, 0xda, 0x3a, 0x52, 0x89, + 0xd0, 0xe6, 0x06, 0xa6, 0x5a, 0x37, 0xfc, 0x33, 0xa0, 0x8b, 0x26, 0x75, 0xfe, 0xe5, 0x58, 0xe4, + 0x52, 0x2c, 0x09, 0xf7, 0x17, 0x8a, 0xa3, 0x49, 0x16, 0x7f, 0x2d, 0x27, 0x35, 0x2a, 0xbf, 0x6c, + 0x3a, 0x5b, 0xd2, 0x43, 0x00, 0x99, 0x0b, 0x15, 0x15, 0xcb, 0x41, 0xa7, 0xd9, 0x6f, 0x0d, 0xba, + 0x07, 0x3b, 0xfe, 0xff, 0x9b, 0xf7, 0x3f, 0xa2, 0x50, 0xef, 0x2c, 0x33, 0x5c, 0x12, 0x79, 0x1c, + 0x9c, 0xcb, 0x0d, 0xeb, 0xa0, 0xaf, 0x61, 0xc3, 0x06, 0x2b, 0x46, 0x5c, 0xb8, 0x3f, 0xbd, 0xd9, + 0xdd, 0x28, 0xc2, 0x85, 0xf6, 0xe0, 0x47, 0x13, 0x5a, 0x43, 0x4c, 0xe8, 0x1b, 0xb8, 0x55, 0xfe, + 0x36, 0xdb, 0x57, 0xb9, 0x98, 0x35, 0xb3, 0x87, 0x2b, 0xc0, 0x3a, 0xda, 0x7b, 0xe8, 0xd8, 0xdd, + 0xb9, 0xd7, 0xf0, 0x0d, 0xce, 0x1e, 0xaf, 0xc6, 0x6b, 0x4b, 0x0e, 0x77, 0xff, 0x9d, 0xfb, 0xa3, + 0xd5, 0xc2, 0x8a, 0xc5, 0xf6, 0xd6, 0x61, 0xd9, 0x26, 0xec, 0xf6, 0xb7, 0x8b, 0xb3, 0x5d, 0x72, + 0xf4, 0xe2, 0xd7, 0xcc, 0x25, 0xe7, 0x33, 0x97, 0xfc, 0x99, 0xb9, 0xe4, 0xe7, 0xdc, 0x6d, 0x9c, + 0xcf, 0xdd, 0xc6, 0xef, 0xb9, 0xdb, 0xf8, 0xcc, 0x2a, 0x37, 0x8c, 0x8f, 0xfd, 0xb1, 0x0c, 0xa6, + 0xcb, 0x4f, 0x72, 0xd4, 0x2e, 0xdf, 0xdf, 0xf3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x16, 0x8f, + 0xcc, 0x32, 0xf9, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -310,6 +421,9 @@ type MsgClient interface { Init(ctx context.Context, in *MsgInit, opts ...grpc.CallOption) (*MsgInitResponse, error) // Execute executes a message to the target account. Execute(ctx context.Context, in *MsgExecute, opts ...grpc.CallOption) (*MsgExecuteResponse, error) + // ExecuteBundle pertains account abstraction, it is used by the bundler + // to execute multiple UserOperations in a single transaction message. + ExecuteBundle(ctx context.Context, in *MsgExecuteBundle, opts ...grpc.CallOption) (*MsgExecuteBundleResponse, error) } type msgClient struct { @@ -338,12 +452,24 @@ func (c *msgClient) Execute(ctx context.Context, in *MsgExecute, opts ...grpc.Ca return out, nil } +func (c *msgClient) ExecuteBundle(ctx context.Context, in *MsgExecuteBundle, opts ...grpc.CallOption) (*MsgExecuteBundleResponse, error) { + out := new(MsgExecuteBundleResponse) + err := c.cc.Invoke(ctx, "/cosmos.accounts.v1.Msg/ExecuteBundle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Init creates a new account in the chain. Init(context.Context, *MsgInit) (*MsgInitResponse, error) // Execute executes a message to the target account. Execute(context.Context, *MsgExecute) (*MsgExecuteResponse, error) + // ExecuteBundle pertains account abstraction, it is used by the bundler + // to execute multiple UserOperations in a single transaction message. + ExecuteBundle(context.Context, *MsgExecuteBundle) (*MsgExecuteBundleResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -356,6 +482,9 @@ func (*UnimplementedMsgServer) Init(ctx context.Context, req *MsgInit) (*MsgInit func (*UnimplementedMsgServer) Execute(ctx context.Context, req *MsgExecute) (*MsgExecuteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented") } +func (*UnimplementedMsgServer) ExecuteBundle(ctx context.Context, req *MsgExecuteBundle) (*MsgExecuteBundleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteBundle not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -397,6 +526,24 @@ func _Msg_Execute_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_ExecuteBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecuteBundle) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecuteBundle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.accounts.v1.Msg/ExecuteBundle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecuteBundle(ctx, req.(*MsgExecuteBundle)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.accounts.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -409,6 +556,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Execute", Handler: _Msg_Execute_Handler, }, + { + MethodName: "ExecuteBundle", + Handler: _Msg_ExecuteBundle_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/accounts/v1/tx.proto", @@ -569,6 +720,87 @@ func (m *MsgExecuteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgExecuteBundle) 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 *MsgExecuteBundle) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteBundle) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Operations) > 0 { + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bundler) > 0 { + i -= len(m.Bundler) + copy(dAtA[i:], m.Bundler) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bundler))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecuteBundleResponse) 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 *MsgExecuteBundleResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteBundleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Responses) > 0 { + for iNdEx := len(m.Responses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Responses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -652,6 +884,40 @@ func (m *MsgExecuteResponse) Size() (n int) { return n } +func (m *MsgExecuteBundle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bundler) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Operations) > 0 { + for _, e := range m.Operations { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgExecuteBundleResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Responses) > 0 { + for _, e := range m.Responses { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1154,6 +1420,206 @@ func (m *MsgExecuteResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExecuteBundle) 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 ErrIntOverflowTx + } + 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: MsgExecuteBundle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteBundle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bundler", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bundler = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operations = append(m.Operations, &UserOperation{}) + if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteBundleResponse) 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 ErrIntOverflowTx + } + 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: MsgExecuteBundleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteBundleResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Responses = append(m.Responses, &UserOperationResponse{}) + if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 2bbbe3e6192a0f14fd58ae1139aeb54f46679bfc Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 7 Nov 2023 17:23:05 +0100 Subject: [PATCH 02/19] add msg sender annotations --- api/cosmos/accounts/v1/tx.pulsar.go | 76 ++++++++++++++--------------- proto/cosmos/accounts/v1/tx.proto | 1 + x/accounts/v1/tx.pb.go | 56 ++++++++++----------- 3 files changed, 67 insertions(+), 66 deletions(-) diff --git a/api/cosmos/accounts/v1/tx.pulsar.go b/api/cosmos/accounts/v1/tx.pulsar.go index 67cb97c66f85..d9f80bfe3d5e 100644 --- a/api/cosmos/accounts/v1/tx.pulsar.go +++ b/api/cosmos/accounts/v1/tx.pulsar.go @@ -3397,50 +3397,50 @@ var file_cosmos_accounts_v1_tx_proto_rawDesc = []byte{ 0x65, 0x72, 0x22, 0x30, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7d, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x32, 0x8e, 0x02, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 0x12, 0x48, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x63, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbb, 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, 0x07, 0x54, 0x78, 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, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x32, 0x8e, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x48, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x49, 0x6e, 0x69, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, + 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x24, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbb, 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, 0x07, 0x54, 0x78, 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 ( diff --git a/proto/cosmos/accounts/v1/tx.proto b/proto/cosmos/accounts/v1/tx.proto index 6fc084523c3f..2ab9000871d8 100644 --- a/proto/cosmos/accounts/v1/tx.proto +++ b/proto/cosmos/accounts/v1/tx.proto @@ -65,6 +65,7 @@ message MsgExecuteResponse { // MsgExecuteBundle defines the ExecuteBundle request type for the Msg/ExecuteBundle RPC method. message MsgExecuteBundle { + option (cosmos.msg.v1.signer) = "bundler"; // bundler defines the entity going through the standard TX flow // to execute one or multiple UserOperations on behalf of others. string bundler = 1; diff --git a/x/accounts/v1/tx.pb.go b/x/accounts/v1/tx.pb.go index 9083942bbfcc..44b955a2d593 100644 --- a/x/accounts/v1/tx.pb.go +++ b/x/accounts/v1/tx.pb.go @@ -373,36 +373,36 @@ func init() { func init() { proto.RegisterFile("cosmos/accounts/v1/tx.proto", fileDescriptor_29c2b6d8a13d4189) } var fileDescriptor_29c2b6d8a13d4189 = []byte{ - // 454 bytes of a gzipped FileDescriptorProto + // 460 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, 0x14, 0xaf, 0x5b, 0x68, 0xd9, 0x6b, 0x61, 0xc8, 0x87, 0x11, 0x79, 0x52, 0xd4, 0x05, 0x04, 0x65, - 0x9a, 0x12, 0x36, 0x38, 0x71, 0xdb, 0x24, 0x04, 0x1c, 0x2a, 0x44, 0x04, 0x1c, 0xb8, 0xa0, 0xd4, - 0xb1, 0xa2, 0x6a, 0x24, 0x8e, 0xfc, 0xdc, 0xa9, 0xbb, 0x21, 0x3e, 0x00, 0xe2, 0xa3, 0xec, 0x63, - 0x70, 0xdc, 0x91, 0x23, 0x6a, 0x0f, 0xfb, 0x1a, 0x28, 0x89, 0x9d, 0x96, 0xb1, 0x75, 0xbd, 0xe5, - 0xf9, 0xf7, 0xe7, 0xfd, 0xfc, 0x5e, 0x0c, 0xdb, 0x5c, 0x62, 0x2a, 0x31, 0x88, 0x38, 0x97, 0x93, - 0x4c, 0x63, 0x70, 0xb2, 0x1f, 0xe8, 0xa9, 0x9f, 0x2b, 0xa9, 0x25, 0xa5, 0x15, 0xe8, 0x5b, 0xd0, - 0x3f, 0xd9, 0x67, 0x0f, 0x8c, 0x20, 0xc5, 0xa4, 0xe0, 0xa6, 0x98, 0x54, 0x64, 0xb6, 0x77, 0x85, - 0x93, 0xf9, 0xfe, 0x12, 0x8d, 0x50, 0xab, 0x88, 0xeb, 0xb1, 0xcc, 0x2a, 0xb6, 0x77, 0x0c, 0x9d, - 0x21, 0x26, 0x6f, 0xb3, 0xb1, 0xa6, 0x5b, 0xd0, 0x46, 0x91, 0xc5, 0x42, 0x39, 0xa4, 0x4f, 0x06, - 0x1b, 0xa1, 0xa9, 0xe8, 0x0e, 0xf4, 0xac, 0x5e, 0x9f, 0xe6, 0xc2, 0x69, 0x96, 0x68, 0xd7, 0x9c, - 0x7d, 0x38, 0xcd, 0x05, 0x75, 0xa0, 0x93, 0x0a, 0xc4, 0x28, 0x11, 0x4e, 0xab, 0x4f, 0x06, 0xbd, - 0xd0, 0x96, 0x2f, 0xbb, 0xdf, 0x2f, 0xce, 0x76, 0x8d, 0x93, 0xf7, 0x09, 0x36, 0x4d, 0xb3, 0x50, - 0x60, 0x2e, 0x33, 0x14, 0xf4, 0x09, 0x6c, 0xd6, 0xe1, 0xe2, 0x58, 0x09, 0x44, 0xd3, 0xfd, 0x9e, - 0x39, 0x3e, 0xac, 0x4e, 0x29, 0x83, 0x3b, 0xca, 0x88, 0xca, 0x04, 0xbd, 0xb0, 0xae, 0x3d, 0x0e, - 0x30, 0xc4, 0xe4, 0xd5, 0x54, 0xf0, 0x89, 0x16, 0xd7, 0xde, 0x63, 0x0b, 0xda, 0x3a, 0x52, 0x89, - 0xd0, 0xe6, 0x06, 0xa6, 0x5a, 0x37, 0xfc, 0x33, 0xa0, 0x8b, 0x26, 0x75, 0xfe, 0xe5, 0x58, 0xe4, - 0x52, 0x2c, 0x09, 0xf7, 0x17, 0x8a, 0xa3, 0x49, 0x16, 0x7f, 0x2d, 0x27, 0x35, 0x2a, 0xbf, 0x6c, - 0x3a, 0x5b, 0xd2, 0x43, 0x00, 0x99, 0x0b, 0x15, 0x15, 0xcb, 0x41, 0xa7, 0xd9, 0x6f, 0x0d, 0xba, - 0x07, 0x3b, 0xfe, 0xff, 0x9b, 0xf7, 0x3f, 0xa2, 0x50, 0xef, 0x2c, 0x33, 0x5c, 0x12, 0x79, 0x1c, - 0x9c, 0xcb, 0x0d, 0xeb, 0xa0, 0xaf, 0x61, 0xc3, 0x06, 0x2b, 0x46, 0x5c, 0xb8, 0x3f, 0xbd, 0xd9, - 0xdd, 0x28, 0xc2, 0x85, 0xf6, 0xe0, 0x47, 0x13, 0x5a, 0x43, 0x4c, 0xe8, 0x1b, 0xb8, 0x55, 0xfe, - 0x36, 0xdb, 0x57, 0xb9, 0x98, 0x35, 0xb3, 0x87, 0x2b, 0xc0, 0x3a, 0xda, 0x7b, 0xe8, 0xd8, 0xdd, - 0xb9, 0xd7, 0xf0, 0x0d, 0xce, 0x1e, 0xaf, 0xc6, 0x6b, 0x4b, 0x0e, 0x77, 0xff, 0x9d, 0xfb, 0xa3, - 0xd5, 0xc2, 0x8a, 0xc5, 0xf6, 0xd6, 0x61, 0xd9, 0x26, 0xec, 0xf6, 0xb7, 0x8b, 0xb3, 0x5d, 0x72, - 0xf4, 0xe2, 0xd7, 0xcc, 0x25, 0xe7, 0x33, 0x97, 0xfc, 0x99, 0xb9, 0xe4, 0xe7, 0xdc, 0x6d, 0x9c, - 0xcf, 0xdd, 0xc6, 0xef, 0xb9, 0xdb, 0xf8, 0xcc, 0x2a, 0x37, 0x8c, 0x8f, 0xfd, 0xb1, 0x0c, 0xa6, - 0xcb, 0x4f, 0x72, 0xd4, 0x2e, 0xdf, 0xdf, 0xf3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x16, 0x8f, - 0xcc, 0x32, 0xf9, 0x03, 0x00, 0x00, + 0x9a, 0x12, 0x36, 0x38, 0xed, 0xb6, 0x49, 0x08, 0x38, 0x54, 0x88, 0x08, 0x38, 0x70, 0x41, 0xa9, + 0x63, 0x45, 0xd5, 0x48, 0x1c, 0xf9, 0xb9, 0x53, 0x77, 0x40, 0x42, 0x7c, 0x00, 0xc4, 0x47, 0xd9, + 0xc7, 0xe0, 0xb8, 0x23, 0x47, 0xd4, 0x1e, 0xf6, 0x35, 0x50, 0x12, 0x3b, 0x2d, 0x63, 0xeb, 0x76, + 0xcb, 0x7b, 0xef, 0xf7, 0xcf, 0x7e, 0x31, 0x6c, 0x72, 0x89, 0xa9, 0xc4, 0x20, 0xe2, 0x5c, 0x4e, + 0x32, 0x8d, 0xc1, 0xf1, 0x6e, 0xa0, 0xa7, 0x7e, 0xae, 0xa4, 0x96, 0x94, 0x56, 0x43, 0xdf, 0x0e, + 0xfd, 0xe3, 0x5d, 0xf6, 0xc0, 0x10, 0x52, 0x4c, 0x0a, 0x6c, 0x8a, 0x49, 0x05, 0x66, 0x3b, 0x97, + 0x28, 0x99, 0xef, 0xcf, 0xd1, 0x08, 0xb5, 0x8a, 0xb8, 0x1e, 0xcb, 0xac, 0x42, 0x7b, 0x47, 0xd0, + 0x19, 0x62, 0xf2, 0x26, 0x1b, 0x6b, 0xba, 0x01, 0x6d, 0x14, 0x59, 0x2c, 0x94, 0x43, 0xfa, 0x64, + 0xb0, 0x16, 0x9a, 0x8a, 0x6e, 0x41, 0xcf, 0xf2, 0xf5, 0x49, 0x2e, 0x9c, 0x66, 0x39, 0xed, 0x9a, + 0xde, 0xfb, 0x93, 0x5c, 0x50, 0x07, 0x3a, 0xa9, 0x40, 0x8c, 0x12, 0xe1, 0xb4, 0xfa, 0x64, 0xd0, + 0x0b, 0x6d, 0xb9, 0xdf, 0xfd, 0x7e, 0x7e, 0xba, 0x6d, 0x94, 0xbc, 0x8f, 0xb0, 0x6e, 0xcc, 0x42, + 0x81, 0xb9, 0xcc, 0x50, 0xd0, 0x27, 0xb0, 0x5e, 0x87, 0x8b, 0x63, 0x25, 0x10, 0x8d, 0xfb, 0x3d, + 0xd3, 0x3e, 0xa8, 0xba, 0x94, 0xc1, 0x1d, 0x65, 0x48, 0x65, 0x82, 0x5e, 0x58, 0xd7, 0x1e, 0x07, + 0x18, 0x62, 0xf2, 0x72, 0x2a, 0xf8, 0x44, 0x8b, 0x2b, 0xcf, 0xb1, 0x01, 0x6d, 0x1d, 0xa9, 0x44, + 0x68, 0x73, 0x02, 0x53, 0xdd, 0x34, 0xfc, 0x33, 0xa0, 0x0b, 0x93, 0x3a, 0xff, 0x72, 0x2c, 0x72, + 0x21, 0xd6, 0x57, 0xb8, 0xbf, 0x60, 0x1c, 0x4e, 0xb2, 0xf8, 0x4b, 0x79, 0x53, 0xa3, 0xf2, 0xcb, + 0xa6, 0xb3, 0x25, 0x3d, 0x00, 0x90, 0xb9, 0x50, 0x51, 0xb1, 0x1c, 0x74, 0x9a, 0xfd, 0xd6, 0xa0, + 0xbb, 0xb7, 0xe5, 0xff, 0xbf, 0x79, 0xff, 0x03, 0x0a, 0xf5, 0xd6, 0x22, 0xc3, 0x25, 0xd2, 0x7e, + 0xaf, 0xc8, 0x6b, 0x05, 0x3d, 0x0e, 0xce, 0x45, 0xfb, 0x3a, 0xf6, 0x2b, 0x58, 0xb3, 0x31, 0x8b, + 0x0b, 0x2f, 0xbc, 0x9e, 0x5e, 0xef, 0x65, 0x18, 0xe1, 0x82, 0xbb, 0xf7, 0xa3, 0x09, 0xad, 0x21, + 0x26, 0xf4, 0x35, 0xdc, 0x2a, 0x7f, 0xa2, 0xcd, 0xcb, 0x54, 0xcc, 0xd2, 0xd9, 0xc3, 0x15, 0xc3, + 0x3a, 0xda, 0x3b, 0xe8, 0xd8, 0x4d, 0xba, 0x57, 0xe0, 0xcd, 0x9c, 0x3d, 0x5e, 0x3d, 0xaf, 0x25, + 0x39, 0xdc, 0xfd, 0x77, 0x0b, 0x8f, 0x56, 0x13, 0x2b, 0x14, 0xdb, 0xb9, 0x09, 0xca, 0x9a, 0xb0, + 0xdb, 0xdf, 0xce, 0x4f, 0xb7, 0xc9, 0xe1, 0x8b, 0x5f, 0x33, 0x97, 0x9c, 0xcd, 0x5c, 0xf2, 0x67, + 0xe6, 0x92, 0x9f, 0x73, 0xb7, 0x71, 0x36, 0x77, 0x1b, 0xbf, 0xe7, 0x6e, 0xe3, 0x13, 0xab, 0xd4, + 0x30, 0x3e, 0xf2, 0xc7, 0x32, 0x98, 0x2e, 0x3f, 0xd0, 0x51, 0xbb, 0x7c, 0x8d, 0xcf, 0xff, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x02, 0x12, 0x2a, 0x01, 0x07, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 3331dc1dc2d78238317dded1cbdfe691a0c5aa2e Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 7 Nov 2023 17:30:07 +0100 Subject: [PATCH 03/19] add generated code --- .../v1/interface.pulsar.go | 4299 +++++++++++++++++ .../testing/rotation/v1/partial.pulsar.go | 1853 +++++++ .../accounts/v1/account_abstraction.pulsar.go | 2180 +++++++++ x/accounts/v1/account_abstraction.pb.go | 1088 +++++ 4 files changed, 9420 insertions(+) create mode 100644 api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go create mode 100644 api/cosmos/accounts/testing/rotation/v1/partial.pulsar.go create mode 100644 api/cosmos/accounts/v1/account_abstraction.pulsar.go create mode 100644 x/accounts/v1/account_abstraction.pb.go diff --git a/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go new file mode 100644 index 000000000000..9b3c46e0a297 --- /dev/null +++ b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go @@ -0,0 +1,4299 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package account_abstractionv1 + +import ( + v1 "cosmossdk.io/api/cosmos/accounts/v1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgAuthenticate protoreflect.MessageDescriptor + fd_MsgAuthenticate_user_operation protoreflect.FieldDescriptor + fd_MsgAuthenticate_chain_id protoreflect.FieldDescriptor + fd_MsgAuthenticate_account_number protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgAuthenticate = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgAuthenticate") + fd_MsgAuthenticate_user_operation = md_MsgAuthenticate.Fields().ByName("user_operation") + fd_MsgAuthenticate_chain_id = md_MsgAuthenticate.Fields().ByName("chain_id") + fd_MsgAuthenticate_account_number = md_MsgAuthenticate.Fields().ByName("account_number") +} + +var _ protoreflect.Message = (*fastReflection_MsgAuthenticate)(nil) + +type fastReflection_MsgAuthenticate MsgAuthenticate + +func (x *MsgAuthenticate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAuthenticate)(x) +} + +func (x *MsgAuthenticate) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[0] + 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_MsgAuthenticate_messageType fastReflection_MsgAuthenticate_messageType +var _ protoreflect.MessageType = fastReflection_MsgAuthenticate_messageType{} + +type fastReflection_MsgAuthenticate_messageType struct{} + +func (x fastReflection_MsgAuthenticate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAuthenticate)(nil) +} +func (x fastReflection_MsgAuthenticate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAuthenticate) +} +func (x fastReflection_MsgAuthenticate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthenticate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAuthenticate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthenticate +} + +// 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_MsgAuthenticate) Type() protoreflect.MessageType { + return _fastReflection_MsgAuthenticate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAuthenticate) New() protoreflect.Message { + return new(fastReflection_MsgAuthenticate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAuthenticate) Interface() protoreflect.ProtoMessage { + return (*MsgAuthenticate)(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_MsgAuthenticate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.UserOperation != nil { + value := protoreflect.ValueOfMessage(x.UserOperation.ProtoReflect()) + if !f(fd_MsgAuthenticate_user_operation, value) { + return + } + } + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_MsgAuthenticate_chain_id, value) { + return + } + } + if x.AccountNumber != uint64(0) { + value := protoreflect.ValueOfUint64(x.AccountNumber) + if !f(fd_MsgAuthenticate_account_number, 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_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + return x.UserOperation != nil + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + return x.ChainId != "" + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + return x.AccountNumber != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + x.UserOperation = nil + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + x.ChainId = "" + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + x.AccountNumber = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + value := x.UserOperation + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + value := x.AccountNumber + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + x.UserOperation = value.Message().Interface().(*v1.UserOperation) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + x.ChainId = value.Interface().(string) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + x.AccountNumber = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + if x.UserOperation == nil { + x.UserOperation = new(v1.UserOperation) + } + return protoreflect.ValueOfMessage(x.UserOperation.ProtoReflect()) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + panic(fmt.Errorf("field chain_id of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + panic(fmt.Errorf("field account_number of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": + m := new(v1.UserOperation) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": + return protoreflect.ValueOfString("") + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate 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_MsgAuthenticate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate", 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_MsgAuthenticate) 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_MsgAuthenticate) 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_MsgAuthenticate) 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_MsgAuthenticate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAuthenticate) + 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.UserOperation != nil { + l = options.Size(x.UserOperation) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AccountNumber != 0 { + n += 1 + runtime.Sov(uint64(x.AccountNumber)) + } + 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().(*MsgAuthenticate) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AccountNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + i-- + dAtA[i] = 0x12 + } + if x.UserOperation != nil { + encoded, err := options.Marshal(x.UserOperation) + 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().(*MsgAuthenticate) + 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: MsgAuthenticate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthenticate: 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 UserOperation", 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.UserOperation == nil { + x.UserOperation = &v1.UserOperation{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UserOperation); 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 ChainId", 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.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + x.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgAuthenticateResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgAuthenticateResponse = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgAuthenticateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgAuthenticateResponse)(nil) + +type fastReflection_MsgAuthenticateResponse MsgAuthenticateResponse + +func (x *MsgAuthenticateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAuthenticateResponse)(x) +} + +func (x *MsgAuthenticateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[1] + 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_MsgAuthenticateResponse_messageType fastReflection_MsgAuthenticateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgAuthenticateResponse_messageType{} + +type fastReflection_MsgAuthenticateResponse_messageType struct{} + +func (x fastReflection_MsgAuthenticateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAuthenticateResponse)(nil) +} +func (x fastReflection_MsgAuthenticateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAuthenticateResponse) +} +func (x fastReflection_MsgAuthenticateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthenticateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAuthenticateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthenticateResponse +} + +// 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_MsgAuthenticateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgAuthenticateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAuthenticateResponse) New() protoreflect.Message { + return new(fastReflection_MsgAuthenticateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAuthenticateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgAuthenticateResponse)(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_MsgAuthenticateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgAuthenticateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse 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_MsgAuthenticateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse", 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_MsgAuthenticateResponse) 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_MsgAuthenticateResponse) 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_MsgAuthenticateResponse) 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_MsgAuthenticateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAuthenticateResponse) + 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.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().(*MsgAuthenticateResponse) + 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 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().(*MsgAuthenticateResponse) + 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: MsgAuthenticateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_MsgPayBundler_1_list)(nil) + +type _MsgPayBundler_1_list struct { + list *[]*anypb.Any +} + +func (x *_MsgPayBundler_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgPayBundler_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgPayBundler_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgPayBundler_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgPayBundler_1_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgPayBundler_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgPayBundler_1_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgPayBundler_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgPayBundler protoreflect.MessageDescriptor + fd_MsgPayBundler_bundler_payment_messages protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgPayBundler = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgPayBundler") + fd_MsgPayBundler_bundler_payment_messages = md_MsgPayBundler.Fields().ByName("bundler_payment_messages") +} + +var _ protoreflect.Message = (*fastReflection_MsgPayBundler)(nil) + +type fastReflection_MsgPayBundler MsgPayBundler + +func (x *MsgPayBundler) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPayBundler)(x) +} + +func (x *MsgPayBundler) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[2] + 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_MsgPayBundler_messageType fastReflection_MsgPayBundler_messageType +var _ protoreflect.MessageType = fastReflection_MsgPayBundler_messageType{} + +type fastReflection_MsgPayBundler_messageType struct{} + +func (x fastReflection_MsgPayBundler_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPayBundler)(nil) +} +func (x fastReflection_MsgPayBundler_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPayBundler) +} +func (x fastReflection_MsgPayBundler_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPayBundler +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPayBundler) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPayBundler +} + +// 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_MsgPayBundler) Type() protoreflect.MessageType { + return _fastReflection_MsgPayBundler_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPayBundler) New() protoreflect.Message { + return new(fastReflection_MsgPayBundler) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPayBundler) Interface() protoreflect.ProtoMessage { + return (*MsgPayBundler)(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_MsgPayBundler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.BundlerPaymentMessages) != 0 { + value := protoreflect.ValueOfList(&_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages}) + if !f(fd_MsgPayBundler_bundler_payment_messages, 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_MsgPayBundler) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + return len(x.BundlerPaymentMessages) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + x.BundlerPaymentMessages = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + if len(x.BundlerPaymentMessages) == 0 { + return protoreflect.ValueOfList(&_MsgPayBundler_1_list{}) + } + listValue := &_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + lv := value.List() + clv := lv.(*_MsgPayBundler_1_list) + x.BundlerPaymentMessages = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + if x.BundlerPaymentMessages == nil { + x.BundlerPaymentMessages = []*anypb.Any{} + } + value := &_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgPayBundler_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler 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_MsgPayBundler) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler", 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_MsgPayBundler) 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_MsgPayBundler) 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_MsgPayBundler) 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_MsgPayBundler) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPayBundler) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.BundlerPaymentMessages) > 0 { + for _, e := range x.BundlerPaymentMessages { + 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().(*MsgPayBundler) + 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.BundlerPaymentMessages) > 0 { + for iNdEx := len(x.BundlerPaymentMessages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BundlerPaymentMessages[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] = 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().(*MsgPayBundler) + 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: MsgPayBundler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPayBundler: 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 BundlerPaymentMessages", 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.BundlerPaymentMessages = append(x.BundlerPaymentMessages, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BundlerPaymentMessages[len(x.BundlerPaymentMessages)-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 _ protoreflect.List = (*_MsgPayBundlerResponse_1_list)(nil) + +type _MsgPayBundlerResponse_1_list struct { + list *[]*anypb.Any +} + +func (x *_MsgPayBundlerResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgPayBundlerResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgPayBundlerResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgPayBundlerResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgPayBundlerResponse_1_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgPayBundlerResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgPayBundlerResponse_1_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgPayBundlerResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgPayBundlerResponse protoreflect.MessageDescriptor + fd_MsgPayBundlerResponse_bundler_payment_messages_response protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgPayBundlerResponse = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgPayBundlerResponse") + fd_MsgPayBundlerResponse_bundler_payment_messages_response = md_MsgPayBundlerResponse.Fields().ByName("bundler_payment_messages_response") +} + +var _ protoreflect.Message = (*fastReflection_MsgPayBundlerResponse)(nil) + +type fastReflection_MsgPayBundlerResponse MsgPayBundlerResponse + +func (x *MsgPayBundlerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPayBundlerResponse)(x) +} + +func (x *MsgPayBundlerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[3] + 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_MsgPayBundlerResponse_messageType fastReflection_MsgPayBundlerResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgPayBundlerResponse_messageType{} + +type fastReflection_MsgPayBundlerResponse_messageType struct{} + +func (x fastReflection_MsgPayBundlerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPayBundlerResponse)(nil) +} +func (x fastReflection_MsgPayBundlerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPayBundlerResponse) +} +func (x fastReflection_MsgPayBundlerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPayBundlerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPayBundlerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPayBundlerResponse +} + +// 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_MsgPayBundlerResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgPayBundlerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPayBundlerResponse) New() protoreflect.Message { + return new(fastReflection_MsgPayBundlerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPayBundlerResponse) Interface() protoreflect.ProtoMessage { + return (*MsgPayBundlerResponse)(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_MsgPayBundlerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.BundlerPaymentMessagesResponse) != 0 { + value := protoreflect.ValueOfList(&_MsgPayBundlerResponse_1_list{list: &x.BundlerPaymentMessagesResponse}) + if !f(fd_MsgPayBundlerResponse_bundler_payment_messages_response, 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_MsgPayBundlerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + return len(x.BundlerPaymentMessagesResponse) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + x.BundlerPaymentMessagesResponse = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + if len(x.BundlerPaymentMessagesResponse) == 0 { + return protoreflect.ValueOfList(&_MsgPayBundlerResponse_1_list{}) + } + listValue := &_MsgPayBundlerResponse_1_list{list: &x.BundlerPaymentMessagesResponse} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + lv := value.List() + clv := lv.(*_MsgPayBundlerResponse_1_list) + x.BundlerPaymentMessagesResponse = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + if x.BundlerPaymentMessagesResponse == nil { + x.BundlerPaymentMessagesResponse = []*anypb.Any{} + } + value := &_MsgPayBundlerResponse_1_list{list: &x.BundlerPaymentMessagesResponse} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgPayBundlerResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse 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_MsgPayBundlerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse", 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_MsgPayBundlerResponse) 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_MsgPayBundlerResponse) 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_MsgPayBundlerResponse) 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_MsgPayBundlerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPayBundlerResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.BundlerPaymentMessagesResponse) > 0 { + for _, e := range x.BundlerPaymentMessagesResponse { + 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().(*MsgPayBundlerResponse) + 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.BundlerPaymentMessagesResponse) > 0 { + for iNdEx := len(x.BundlerPaymentMessagesResponse) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BundlerPaymentMessagesResponse[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] = 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().(*MsgPayBundlerResponse) + 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: MsgPayBundlerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPayBundlerResponse: 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 BundlerPaymentMessagesResponse", 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.BundlerPaymentMessagesResponse = append(x.BundlerPaymentMessagesResponse, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BundlerPaymentMessagesResponse[len(x.BundlerPaymentMessagesResponse)-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 _ protoreflect.List = (*_MsgExecute_1_list)(nil) + +type _MsgExecute_1_list struct { + list *[]*anypb.Any +} + +func (x *_MsgExecute_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgExecute_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgExecute_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgExecute_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgExecute_1_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecute_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgExecute_1_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecute_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgExecute protoreflect.MessageDescriptor + fd_MsgExecute_execution_messages protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgExecute = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgExecute") + fd_MsgExecute_execution_messages = md_MsgExecute.Fields().ByName("execution_messages") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecute)(nil) + +type fastReflection_MsgExecute MsgExecute + +func (x *MsgExecute) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecute)(x) +} + +func (x *MsgExecute) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_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_MsgExecute_messageType fastReflection_MsgExecute_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecute_messageType{} + +type fastReflection_MsgExecute_messageType struct{} + +func (x fastReflection_MsgExecute_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecute)(nil) +} +func (x fastReflection_MsgExecute_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecute) +} +func (x fastReflection_MsgExecute_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecute +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecute) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecute +} + +// 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_MsgExecute) Type() protoreflect.MessageType { + return _fastReflection_MsgExecute_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecute) New() protoreflect.Message { + return new(fastReflection_MsgExecute) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecute) Interface() protoreflect.ProtoMessage { + return (*MsgExecute)(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_MsgExecute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ExecutionMessages) != 0 { + value := protoreflect.ValueOfList(&_MsgExecute_1_list{list: &x.ExecutionMessages}) + if !f(fd_MsgExecute_execution_messages, 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_MsgExecute) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + return len(x.ExecutionMessages) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + x.ExecutionMessages = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + if len(x.ExecutionMessages) == 0 { + return protoreflect.ValueOfList(&_MsgExecute_1_list{}) + } + listValue := &_MsgExecute_1_list{list: &x.ExecutionMessages} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + lv := value.List() + clv := lv.(*_MsgExecute_1_list) + x.ExecutionMessages = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + if x.ExecutionMessages == nil { + x.ExecutionMessages = []*anypb.Any{} + } + value := &_MsgExecute_1_list{list: &x.ExecutionMessages} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgExecute_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute 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_MsgExecute) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute", 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_MsgExecute) 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_MsgExecute) 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_MsgExecute) 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_MsgExecute) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecute) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ExecutionMessages) > 0 { + for _, e := range x.ExecutionMessages { + 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().(*MsgExecute) + 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.ExecutionMessages) > 0 { + for iNdEx := len(x.ExecutionMessages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExecutionMessages[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] = 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().(*MsgExecute) + 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: MsgExecute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecute: 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 ExecutionMessages", 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.ExecutionMessages = append(x.ExecutionMessages, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecutionMessages[len(x.ExecutionMessages)-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 _ protoreflect.List = (*_MsgExecuteResponse_1_list)(nil) + +type _MsgExecuteResponse_1_list struct { + list *[]*anypb.Any +} + +func (x *_MsgExecuteResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgExecuteResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgExecuteResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgExecuteResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgExecuteResponse_1_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgExecuteResponse_1_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgExecuteResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgExecuteResponse protoreflect.MessageDescriptor + fd_MsgExecuteResponse_execution_messages_response protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_MsgExecuteResponse = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgExecuteResponse") + fd_MsgExecuteResponse_execution_messages_response = md_MsgExecuteResponse.Fields().ByName("execution_messages_response") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecuteResponse)(nil) + +type fastReflection_MsgExecuteResponse MsgExecuteResponse + +func (x *MsgExecuteResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecuteResponse)(x) +} + +func (x *MsgExecuteResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_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_MsgExecuteResponse_messageType fastReflection_MsgExecuteResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecuteResponse_messageType{} + +type fastReflection_MsgExecuteResponse_messageType struct{} + +func (x fastReflection_MsgExecuteResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecuteResponse)(nil) +} +func (x fastReflection_MsgExecuteResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecuteResponse) +} +func (x fastReflection_MsgExecuteResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecuteResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecuteResponse +} + +// 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_MsgExecuteResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgExecuteResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecuteResponse) New() protoreflect.Message { + return new(fastReflection_MsgExecuteResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecuteResponse) Interface() protoreflect.ProtoMessage { + return (*MsgExecuteResponse)(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_MsgExecuteResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ExecutionMessagesResponse) != 0 { + value := protoreflect.ValueOfList(&_MsgExecuteResponse_1_list{list: &x.ExecutionMessagesResponse}) + if !f(fd_MsgExecuteResponse_execution_messages_response, 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_MsgExecuteResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + return len(x.ExecutionMessagesResponse) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + x.ExecutionMessagesResponse = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + if len(x.ExecutionMessagesResponse) == 0 { + return protoreflect.ValueOfList(&_MsgExecuteResponse_1_list{}) + } + listValue := &_MsgExecuteResponse_1_list{list: &x.ExecutionMessagesResponse} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + lv := value.List() + clv := lv.(*_MsgExecuteResponse_1_list) + x.ExecutionMessagesResponse = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + if x.ExecutionMessagesResponse == nil { + x.ExecutionMessagesResponse = []*anypb.Any{} + } + value := &_MsgExecuteResponse_1_list{list: &x.ExecutionMessagesResponse} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgExecuteResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse 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_MsgExecuteResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse", 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_MsgExecuteResponse) 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_MsgExecuteResponse) 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_MsgExecuteResponse) 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_MsgExecuteResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecuteResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ExecutionMessagesResponse) > 0 { + for _, e := range x.ExecutionMessagesResponse { + 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().(*MsgExecuteResponse) + 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.ExecutionMessagesResponse) > 0 { + for iNdEx := len(x.ExecutionMessagesResponse) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExecutionMessagesResponse[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] = 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().(*MsgExecuteResponse) + 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: MsgExecuteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteResponse: 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 ExecutionMessagesResponse", 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.ExecutionMessagesResponse = append(x.ExecutionMessagesResponse, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecutionMessagesResponse[len(x.ExecutionMessagesResponse)-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_QueryAuthenticationMethods protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_QueryAuthenticationMethods = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("QueryAuthenticationMethods") +} + +var _ protoreflect.Message = (*fastReflection_QueryAuthenticationMethods)(nil) + +type fastReflection_QueryAuthenticationMethods QueryAuthenticationMethods + +func (x *QueryAuthenticationMethods) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAuthenticationMethods)(x) +} + +func (x *QueryAuthenticationMethods) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[6] + 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_QueryAuthenticationMethods_messageType fastReflection_QueryAuthenticationMethods_messageType +var _ protoreflect.MessageType = fastReflection_QueryAuthenticationMethods_messageType{} + +type fastReflection_QueryAuthenticationMethods_messageType struct{} + +func (x fastReflection_QueryAuthenticationMethods_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAuthenticationMethods)(nil) +} +func (x fastReflection_QueryAuthenticationMethods_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAuthenticationMethods) +} +func (x fastReflection_QueryAuthenticationMethods_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAuthenticationMethods +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAuthenticationMethods) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAuthenticationMethods +} + +// 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_QueryAuthenticationMethods) Type() protoreflect.MessageType { + return _fastReflection_QueryAuthenticationMethods_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAuthenticationMethods) New() protoreflect.Message { + return new(fastReflection_QueryAuthenticationMethods) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAuthenticationMethods) Interface() protoreflect.ProtoMessage { + return (*QueryAuthenticationMethods)(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_QueryAuthenticationMethods) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryAuthenticationMethods) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods 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_QueryAuthenticationMethods) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods", 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_QueryAuthenticationMethods) 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_QueryAuthenticationMethods) 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_QueryAuthenticationMethods) 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_QueryAuthenticationMethods) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAuthenticationMethods) + 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.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().(*QueryAuthenticationMethods) + 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 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().(*QueryAuthenticationMethods) + 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: QueryAuthenticationMethods: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAuthenticationMethods: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_QueryAuthenticationMethodsResponse_1_list)(nil) + +type _QueryAuthenticationMethodsResponse_1_list struct { + list *[]string +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryAuthenticationMethodsResponse at list field AuthenticationMethods as it is not of Message kind")) +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryAuthenticationMethodsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAuthenticationMethodsResponse protoreflect.MessageDescriptor + fd_QueryAuthenticationMethodsResponse_authentication_methods protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() + md_QueryAuthenticationMethodsResponse = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("QueryAuthenticationMethodsResponse") + fd_QueryAuthenticationMethodsResponse_authentication_methods = md_QueryAuthenticationMethodsResponse.Fields().ByName("authentication_methods") +} + +var _ protoreflect.Message = (*fastReflection_QueryAuthenticationMethodsResponse)(nil) + +type fastReflection_QueryAuthenticationMethodsResponse QueryAuthenticationMethodsResponse + +func (x *QueryAuthenticationMethodsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAuthenticationMethodsResponse)(x) +} + +func (x *QueryAuthenticationMethodsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[7] + 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_QueryAuthenticationMethodsResponse_messageType fastReflection_QueryAuthenticationMethodsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAuthenticationMethodsResponse_messageType{} + +type fastReflection_QueryAuthenticationMethodsResponse_messageType struct{} + +func (x fastReflection_QueryAuthenticationMethodsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAuthenticationMethodsResponse)(nil) +} +func (x fastReflection_QueryAuthenticationMethodsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAuthenticationMethodsResponse) +} +func (x fastReflection_QueryAuthenticationMethodsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAuthenticationMethodsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAuthenticationMethodsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAuthenticationMethodsResponse +} + +// 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_QueryAuthenticationMethodsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAuthenticationMethodsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAuthenticationMethodsResponse) New() protoreflect.Message { + return new(fastReflection_QueryAuthenticationMethodsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAuthenticationMethodsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAuthenticationMethodsResponse)(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_QueryAuthenticationMethodsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AuthenticationMethods) != 0 { + value := protoreflect.ValueOfList(&_QueryAuthenticationMethodsResponse_1_list{list: &x.AuthenticationMethods}) + if !f(fd_QueryAuthenticationMethodsResponse_authentication_methods, 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_QueryAuthenticationMethodsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + return len(x.AuthenticationMethods) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + x.AuthenticationMethods = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + if len(x.AuthenticationMethods) == 0 { + return protoreflect.ValueOfList(&_QueryAuthenticationMethodsResponse_1_list{}) + } + listValue := &_QueryAuthenticationMethodsResponse_1_list{list: &x.AuthenticationMethods} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + lv := value.List() + clv := lv.(*_QueryAuthenticationMethodsResponse_1_list) + x.AuthenticationMethods = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + if x.AuthenticationMethods == nil { + x.AuthenticationMethods = []string{} + } + value := &_QueryAuthenticationMethodsResponse_1_list{list: &x.AuthenticationMethods} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse.authentication_methods": + list := []string{} + return protoreflect.ValueOfList(&_QueryAuthenticationMethodsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse 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_QueryAuthenticationMethodsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse", 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_QueryAuthenticationMethodsResponse) 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_QueryAuthenticationMethodsResponse) 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_QueryAuthenticationMethodsResponse) 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_QueryAuthenticationMethodsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAuthenticationMethodsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.AuthenticationMethods) > 0 { + for _, s := range x.AuthenticationMethods { + l = len(s) + 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().(*QueryAuthenticationMethodsResponse) + 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.AuthenticationMethods) > 0 { + for iNdEx := len(x.AuthenticationMethods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AuthenticationMethods[iNdEx]) + copy(dAtA[i:], x.AuthenticationMethods[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthenticationMethods[iNdEx]))) + 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().(*QueryAuthenticationMethodsResponse) + 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: QueryAuthenticationMethodsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAuthenticationMethodsResponse: 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 AuthenticationMethods", 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.AuthenticationMethods = append(x.AuthenticationMethods, 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/accounts/interfaces/account_abstraction/v1/interface.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgAuthenticate is a message that an x/account account abstraction implementer +// must handle to authenticate a state transition. +type MsgAuthenticate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // user_operation is the operation that the user is trying to perform. + // it also contains authentication information. + UserOperation *v1.UserOperation `protobuf:"bytes,1,opt,name=user_operation,json=userOperation,proto3" json:"user_operation,omitempty"` + // chain_id defines the network identifier. + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // account_number is the account number of the user_operation. + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (x *MsgAuthenticate) Reset() { + *x = MsgAuthenticate{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthenticate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthenticate) ProtoMessage() {} + +// Deprecated: Use MsgAuthenticate.ProtoReflect.Descriptor instead. +func (*MsgAuthenticate) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgAuthenticate) GetUserOperation() *v1.UserOperation { + if x != nil { + return x.UserOperation + } + return nil +} + +func (x *MsgAuthenticate) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *MsgAuthenticate) GetAccountNumber() uint64 { + if x != nil { + return x.AccountNumber + } + return 0 +} + +// MsgAuthenticateResponse is the response to MsgAuthenticate. +// The authentication either fails or succeeds, this is why +// there are no auxiliary fields to the response. +type MsgAuthenticateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgAuthenticateResponse) Reset() { + *x = MsgAuthenticateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthenticateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthenticateResponse) ProtoMessage() {} + +// Deprecated: Use MsgAuthenticateResponse.ProtoReflect.Descriptor instead. +func (*MsgAuthenticateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{1} +} + +// MsgPayBundler is a message that an x/account account abstraction implementer +// can optionally implement in case it wants to further refine control over +// the bundler payment messages. +// The account must ensure the caller of this message is the x/accounts module itself. +type MsgPayBundler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bundler_payment_messages are the messages that the operation sender will execute. + // The account can modify the messages as it sees fit. + BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,1,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` +} + +func (x *MsgPayBundler) Reset() { + *x = MsgPayBundler{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPayBundler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPayBundler) ProtoMessage() {} + +// Deprecated: Use MsgPayBundler.ProtoReflect.Descriptor instead. +func (*MsgPayBundler) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgPayBundler) GetBundlerPaymentMessages() []*anypb.Any { + if x != nil { + return x.BundlerPaymentMessages + } + return nil +} + +// MsgPayBundlerResponse is the response to MsgPayBundler. +type MsgPayBundlerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bundler_payment_messages_response are the messages that the bundler will pay for. + BundlerPaymentMessagesResponse []*anypb.Any `protobuf:"bytes,1,rep,name=bundler_payment_messages_response,json=bundlerPaymentMessagesResponse,proto3" json:"bundler_payment_messages_response,omitempty"` +} + +func (x *MsgPayBundlerResponse) Reset() { + *x = MsgPayBundlerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPayBundlerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPayBundlerResponse) ProtoMessage() {} + +// Deprecated: Use MsgPayBundlerResponse.ProtoReflect.Descriptor instead. +func (*MsgPayBundlerResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgPayBundlerResponse) GetBundlerPaymentMessagesResponse() []*anypb.Any { + if x != nil { + return x.BundlerPaymentMessagesResponse + } + return nil +} + +// MsgExecute is a message that an x/account account abstraction implementer +// can optionally implement in case it wants to further refine control over +// the execution messages. It can be used to extend the execution flow, possibly +// block certain messages, or modify them. +// The account must ensure the caller of this message is the x/accounts module itself. +type MsgExecute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // execution_messages are the messages that the operation sender will execute. + // The account can modify the messages as it sees fit. + ExecutionMessages []*anypb.Any `protobuf:"bytes,1,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` +} + +func (x *MsgExecute) Reset() { + *x = MsgExecute{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecute) ProtoMessage() {} + +// Deprecated: Use MsgExecute.ProtoReflect.Descriptor instead. +func (*MsgExecute) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgExecute) GetExecutionMessages() []*anypb.Any { + if x != nil { + return x.ExecutionMessages + } + return nil +} + +// MsgExecuteResponse is the response to MsgExecute. +type MsgExecuteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // execution_messages_response are the messages that the operation sender will execute. + ExecutionMessagesResponse []*anypb.Any `protobuf:"bytes,1,rep,name=execution_messages_response,json=executionMessagesResponse,proto3" json:"execution_messages_response,omitempty"` +} + +func (x *MsgExecuteResponse) Reset() { + *x = MsgExecuteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecuteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecuteResponse) ProtoMessage() {} + +// Deprecated: Use MsgExecuteResponse.ProtoReflect.Descriptor instead. +func (*MsgExecuteResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgExecuteResponse) GetExecutionMessagesResponse() []*anypb.Any { + if x != nil { + return x.ExecutionMessagesResponse + } + return nil +} + +// QueryAuthenticationMethods is a query that an x/account account abstraction implementer +// must handle to return the authentication methods that the account supports. +type QueryAuthenticationMethods struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryAuthenticationMethods) Reset() { + *x = QueryAuthenticationMethods{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAuthenticationMethods) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAuthenticationMethods) ProtoMessage() {} + +// Deprecated: Use QueryAuthenticationMethods.ProtoReflect.Descriptor instead. +func (*QueryAuthenticationMethods) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{6} +} + +// QueryAuthenticationMethodsResponse is the response to QueryAuthenticationMethods. +type QueryAuthenticationMethodsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authentication_methods are the authentication methods that the account supports. + AuthenticationMethods []string `protobuf:"bytes,1,rep,name=authentication_methods,json=authenticationMethods,proto3" json:"authentication_methods,omitempty"` +} + +func (x *QueryAuthenticationMethodsResponse) Reset() { + *x = QueryAuthenticationMethodsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAuthenticationMethodsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAuthenticationMethodsResponse) ProtoMessage() {} + +// Deprecated: Use QueryAuthenticationMethodsResponse.ProtoReflect.Descriptor instead. +func (*QueryAuthenticationMethodsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryAuthenticationMethodsResponse) GetAuthenticationMethods() []string { + if x != nil { + return x.AuthenticationMethods + } + return nil +} + +var File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto protoreflect.FileDescriptor + +var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDesc = []byte{ + 0x0a, 0x41, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x31, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, + 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x9d, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, + 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x0d, 0x4d, 0x73, + 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x18, 0x62, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x78, 0x0a, 0x15, 0x4d, + 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x21, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x1e, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x1b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x03, 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, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x22, 0x5b, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x42, + 0x86, 0x03, 0x0a, 0x35, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x66, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 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, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x49, 0x41, 0xaa, 0x02, 0x30, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x30, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x3c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x34, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, + 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescOnce sync.Once + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescData = file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDesc +) + +func file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP() []byte { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescOnce.Do(func() { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescData) + }) + return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescData +} + +var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_goTypes = []interface{}{ + (*MsgAuthenticate)(nil), // 0: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate + (*MsgAuthenticateResponse)(nil), // 1: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticateResponse + (*MsgPayBundler)(nil), // 2: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler + (*MsgPayBundlerResponse)(nil), // 3: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse + (*MsgExecute)(nil), // 4: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute + (*MsgExecuteResponse)(nil), // 5: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse + (*QueryAuthenticationMethods)(nil), // 6: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethods + (*QueryAuthenticationMethodsResponse)(nil), // 7: cosmos.accounts.interfaces.account_abstraction.v1.QueryAuthenticationMethodsResponse + (*v1.UserOperation)(nil), // 8: cosmos.accounts.v1.UserOperation + (*anypb.Any)(nil), // 9: google.protobuf.Any +} +var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_depIdxs = []int32{ + 8, // 0: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation:type_name -> cosmos.accounts.v1.UserOperation + 9, // 1: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages:type_name -> google.protobuf.Any + 9, // 2: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundlerResponse.bundler_payment_messages_response:type_name -> google.protobuf.Any + 9, // 3: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages:type_name -> google.protobuf.Any + 9, // 4: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecuteResponse.execution_messages_response:type_name -> google.protobuf.Any + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] 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 +} + +func init() { file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() } +func file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() { + if File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAuthenticate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAuthenticateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPayBundler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPayBundlerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgExecuteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAuthenticationMethods); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAuthenticationMethodsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_goTypes, + DependencyIndexes: file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_depIdxs, + MessageInfos: file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_msgTypes, + }.Build() + File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto = out.File + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDesc = nil + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_goTypes = nil + file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_depIdxs = nil +} diff --git a/api/cosmos/accounts/testing/rotation/v1/partial.pulsar.go b/api/cosmos/accounts/testing/rotation/v1/partial.pulsar.go new file mode 100644 index 000000000000..10a99b2196ac --- /dev/null +++ b/api/cosmos/accounts/testing/rotation/v1/partial.pulsar.go @@ -0,0 +1,1853 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package rotationv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgInit protoreflect.MessageDescriptor + fd_MsgInit_pub_key_bytes protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_testing_rotation_v1_partial_proto_init() + md_MsgInit = File_cosmos_accounts_testing_rotation_v1_partial_proto.Messages().ByName("MsgInit") + fd_MsgInit_pub_key_bytes = md_MsgInit.Fields().ByName("pub_key_bytes") +} + +var _ protoreflect.Message = (*fastReflection_MsgInit)(nil) + +type fastReflection_MsgInit MsgInit + +func (x *MsgInit) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgInit)(x) +} + +func (x *MsgInit) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[0] + 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_MsgInit_messageType fastReflection_MsgInit_messageType +var _ protoreflect.MessageType = fastReflection_MsgInit_messageType{} + +type fastReflection_MsgInit_messageType struct{} + +func (x fastReflection_MsgInit_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgInit)(nil) +} +func (x fastReflection_MsgInit_messageType) New() protoreflect.Message { + return new(fastReflection_MsgInit) +} +func (x fastReflection_MsgInit_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgInit +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgInit) Descriptor() protoreflect.MessageDescriptor { + return md_MsgInit +} + +// 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_MsgInit) Type() protoreflect.MessageType { + return _fastReflection_MsgInit_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgInit) New() protoreflect.Message { + return new(fastReflection_MsgInit) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgInit) Interface() protoreflect.ProtoMessage { + return (*MsgInit)(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_MsgInit) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.PubKeyBytes) != 0 { + value := protoreflect.ValueOfBytes(x.PubKeyBytes) + if !f(fd_MsgInit_pub_key_bytes, 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_MsgInit) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + return len(x.PubKeyBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + x.PubKeyBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + value := x.PubKeyBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + x.PubKeyBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + panic(fmt.Errorf("field pub_key_bytes of message cosmos.accounts.testing.rotation.v1.MsgInit is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgInit.pub_key_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInit")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInit 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_MsgInit) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.testing.rotation.v1.MsgInit", 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_MsgInit) 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_MsgInit) 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_MsgInit) 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_MsgInit) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgInit) + 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.PubKeyBytes) + 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().(*MsgInit) + 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.PubKeyBytes) > 0 { + i -= len(x.PubKeyBytes) + copy(dAtA[i:], x.PubKeyBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PubKeyBytes))) + 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().(*MsgInit) + 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: MsgInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInit: 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 PubKeyBytes", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.PubKeyBytes = append(x.PubKeyBytes[:0], dAtA[iNdEx:postIndex]...) + if x.PubKeyBytes == nil { + x.PubKeyBytes = []byte{} + } + 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_MsgInitResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_testing_rotation_v1_partial_proto_init() + md_MsgInitResponse = File_cosmos_accounts_testing_rotation_v1_partial_proto.Messages().ByName("MsgInitResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgInitResponse)(nil) + +type fastReflection_MsgInitResponse MsgInitResponse + +func (x *MsgInitResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgInitResponse)(x) +} + +func (x *MsgInitResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[1] + 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_MsgInitResponse_messageType fastReflection_MsgInitResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgInitResponse_messageType{} + +type fastReflection_MsgInitResponse_messageType struct{} + +func (x fastReflection_MsgInitResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgInitResponse)(nil) +} +func (x fastReflection_MsgInitResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgInitResponse) +} +func (x fastReflection_MsgInitResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgInitResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgInitResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgInitResponse +} + +// 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_MsgInitResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgInitResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgInitResponse) New() protoreflect.Message { + return new(fastReflection_MsgInitResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgInitResponse) Interface() protoreflect.ProtoMessage { + return (*MsgInitResponse)(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_MsgInitResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgInitResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgInitResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgInitResponse 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_MsgInitResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.testing.rotation.v1.MsgInitResponse", 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_MsgInitResponse) 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_MsgInitResponse) 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_MsgInitResponse) 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_MsgInitResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgInitResponse) + 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.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().(*MsgInitResponse) + 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 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().(*MsgInitResponse) + 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: MsgInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgRotatePubKey protoreflect.MessageDescriptor + fd_MsgRotatePubKey_new_pub_key_bytes protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_testing_rotation_v1_partial_proto_init() + md_MsgRotatePubKey = File_cosmos_accounts_testing_rotation_v1_partial_proto.Messages().ByName("MsgRotatePubKey") + fd_MsgRotatePubKey_new_pub_key_bytes = md_MsgRotatePubKey.Fields().ByName("new_pub_key_bytes") +} + +var _ protoreflect.Message = (*fastReflection_MsgRotatePubKey)(nil) + +type fastReflection_MsgRotatePubKey MsgRotatePubKey + +func (x *MsgRotatePubKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRotatePubKey)(x) +} + +func (x *MsgRotatePubKey) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[2] + 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_MsgRotatePubKey_messageType fastReflection_MsgRotatePubKey_messageType +var _ protoreflect.MessageType = fastReflection_MsgRotatePubKey_messageType{} + +type fastReflection_MsgRotatePubKey_messageType struct{} + +func (x fastReflection_MsgRotatePubKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRotatePubKey)(nil) +} +func (x fastReflection_MsgRotatePubKey_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRotatePubKey) +} +func (x fastReflection_MsgRotatePubKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRotatePubKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRotatePubKey) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRotatePubKey +} + +// 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_MsgRotatePubKey) Type() protoreflect.MessageType { + return _fastReflection_MsgRotatePubKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRotatePubKey) New() protoreflect.Message { + return new(fastReflection_MsgRotatePubKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRotatePubKey) Interface() protoreflect.ProtoMessage { + return (*MsgRotatePubKey)(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_MsgRotatePubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.NewPubKeyBytes) != 0 { + value := protoreflect.ValueOfBytes(x.NewPubKeyBytes) + if !f(fd_MsgRotatePubKey_new_pub_key_bytes, 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_MsgRotatePubKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + return len(x.NewPubKeyBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + x.NewPubKeyBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + value := x.NewPubKeyBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + x.NewPubKeyBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + panic(fmt.Errorf("field new_pub_key_bytes of message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.testing.rotation.v1.MsgRotatePubKey.new_pub_key_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKey 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_MsgRotatePubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.testing.rotation.v1.MsgRotatePubKey", 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_MsgRotatePubKey) 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_MsgRotatePubKey) 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_MsgRotatePubKey) 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_MsgRotatePubKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRotatePubKey) + 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.NewPubKeyBytes) + 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().(*MsgRotatePubKey) + 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.NewPubKeyBytes) > 0 { + i -= len(x.NewPubKeyBytes) + copy(dAtA[i:], x.NewPubKeyBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewPubKeyBytes))) + 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().(*MsgRotatePubKey) + 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: MsgRotatePubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRotatePubKey: 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 NewPubKeyBytes", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.NewPubKeyBytes = append(x.NewPubKeyBytes[:0], dAtA[iNdEx:postIndex]...) + if x.NewPubKeyBytes == nil { + x.NewPubKeyBytes = []byte{} + } + 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_MsgRotatePubKeyResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_testing_rotation_v1_partial_proto_init() + md_MsgRotatePubKeyResponse = File_cosmos_accounts_testing_rotation_v1_partial_proto.Messages().ByName("MsgRotatePubKeyResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgRotatePubKeyResponse)(nil) + +type fastReflection_MsgRotatePubKeyResponse MsgRotatePubKeyResponse + +func (x *MsgRotatePubKeyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRotatePubKeyResponse)(x) +} + +func (x *MsgRotatePubKeyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[3] + 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_MsgRotatePubKeyResponse_messageType fastReflection_MsgRotatePubKeyResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRotatePubKeyResponse_messageType{} + +type fastReflection_MsgRotatePubKeyResponse_messageType struct{} + +func (x fastReflection_MsgRotatePubKeyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRotatePubKeyResponse)(nil) +} +func (x fastReflection_MsgRotatePubKeyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRotatePubKeyResponse) +} +func (x fastReflection_MsgRotatePubKeyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRotatePubKeyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRotatePubKeyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRotatePubKeyResponse +} + +// 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_MsgRotatePubKeyResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRotatePubKeyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRotatePubKeyResponse) New() protoreflect.Message { + return new(fastReflection_MsgRotatePubKeyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRotatePubKeyResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRotatePubKeyResponse)(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_MsgRotatePubKeyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgRotatePubKeyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse 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_MsgRotatePubKeyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse", 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_MsgRotatePubKeyResponse) 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_MsgRotatePubKeyResponse) 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_MsgRotatePubKeyResponse) 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_MsgRotatePubKeyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRotatePubKeyResponse) + 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.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().(*MsgRotatePubKeyResponse) + 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 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().(*MsgRotatePubKeyResponse) + 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: MsgRotatePubKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRotatePubKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/accounts/testing/rotation/v1/partial.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgInit is the init message used to create a new account +// abstraction implementation that we use for testing, this account +// also allows for rotating the public key. +type MsgInit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PubKeyBytes []byte `protobuf:"bytes,1,opt,name=pub_key_bytes,json=pubKeyBytes,proto3" json:"pub_key_bytes,omitempty"` +} + +func (x *MsgInit) Reset() { + *x = MsgInit{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgInit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgInit) ProtoMessage() {} + +// Deprecated: Use MsgInit.ProtoReflect.Descriptor instead. +func (*MsgInit) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgInit) GetPubKeyBytes() []byte { + if x != nil { + return x.PubKeyBytes + } + return nil +} + +// MsgInitResponse is the init message response. +type MsgInitResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgInitResponse) Reset() { + *x = MsgInitResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgInitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgInitResponse) ProtoMessage() {} + +// Deprecated: Use MsgInitResponse.ProtoReflect.Descriptor instead. +func (*MsgInitResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescGZIP(), []int{1} +} + +// MsgRotatePubKey is the message used to swap the public key +// of the account. +type MsgRotatePubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewPubKeyBytes []byte `protobuf:"bytes,1,opt,name=new_pub_key_bytes,json=newPubKeyBytes,proto3" json:"new_pub_key_bytes,omitempty"` +} + +func (x *MsgRotatePubKey) Reset() { + *x = MsgRotatePubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRotatePubKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRotatePubKey) ProtoMessage() {} + +// Deprecated: Use MsgRotatePubKey.ProtoReflect.Descriptor instead. +func (*MsgRotatePubKey) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgRotatePubKey) GetNewPubKeyBytes() []byte { + if x != nil { + return x.NewPubKeyBytes + } + return nil +} + +// MsgRotatePubKeyResponse is the MsgRotatePubKey response. +type MsgRotatePubKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgRotatePubKeyResponse) Reset() { + *x = MsgRotatePubKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRotatePubKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRotatePubKeyResponse) ProtoMessage() {} + +// Deprecated: Use MsgRotatePubKeyResponse.ProtoReflect.Descriptor instead. +func (*MsgRotatePubKeyResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescGZIP(), []int{3} +} + +var File_cosmos_accounts_testing_rotation_v1_partial_proto protoreflect.FileDescriptor + +var file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDesc = []byte{ + 0x0a, 0x31, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0x2d, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x49, + 0x6e, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x49, 0x6e, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, + 0x11, 0x6e, 0x65, 0x77, 0x5f, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6e, 0x65, 0x77, 0x50, 0x75, 0x62, + 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x52, + 0x6f, 0x74, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0xa9, 0x02, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3f, 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, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, + 0xa2, 0x02, 0x04, 0x43, 0x41, 0x54, 0x52, 0xaa, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x23, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, + 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x52, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x3a, 0x3a, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescOnce sync.Once + file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescData = file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDesc +) + +func file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescGZIP() []byte { + file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescOnce.Do(func() { + file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescData) + }) + return file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDescData +} + +var file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_accounts_testing_rotation_v1_partial_proto_goTypes = []interface{}{ + (*MsgInit)(nil), // 0: cosmos.accounts.testing.rotation.v1.MsgInit + (*MsgInitResponse)(nil), // 1: cosmos.accounts.testing.rotation.v1.MsgInitResponse + (*MsgRotatePubKey)(nil), // 2: cosmos.accounts.testing.rotation.v1.MsgRotatePubKey + (*MsgRotatePubKeyResponse)(nil), // 3: cosmos.accounts.testing.rotation.v1.MsgRotatePubKeyResponse +} +var file_cosmos_accounts_testing_rotation_v1_partial_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_accounts_testing_rotation_v1_partial_proto_init() } +func file_cosmos_accounts_testing_rotation_v1_partial_proto_init() { + if File_cosmos_accounts_testing_rotation_v1_partial_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgInit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgInitResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRotatePubKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRotatePubKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_accounts_testing_rotation_v1_partial_proto_goTypes, + DependencyIndexes: file_cosmos_accounts_testing_rotation_v1_partial_proto_depIdxs, + MessageInfos: file_cosmos_accounts_testing_rotation_v1_partial_proto_msgTypes, + }.Build() + File_cosmos_accounts_testing_rotation_v1_partial_proto = out.File + file_cosmos_accounts_testing_rotation_v1_partial_proto_rawDesc = nil + file_cosmos_accounts_testing_rotation_v1_partial_proto_goTypes = nil + file_cosmos_accounts_testing_rotation_v1_partial_proto_depIdxs = nil +} diff --git a/api/cosmos/accounts/v1/account_abstraction.pulsar.go b/api/cosmos/accounts/v1/account_abstraction.pulsar.go new file mode 100644 index 000000000000..f805e13d32bf --- /dev/null +++ b/api/cosmos/accounts/v1/account_abstraction.pulsar.go @@ -0,0 +1,2180 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package accountsv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_UserOperation_6_list)(nil) + +type _UserOperation_6_list struct { + list *[]*anypb.Any +} + +func (x *_UserOperation_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UserOperation_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UserOperation_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_UserOperation_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UserOperation_6_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperation_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UserOperation_6_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperation_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_UserOperation_8_list)(nil) + +type _UserOperation_8_list struct { + list *[]*anypb.Any +} + +func (x *_UserOperation_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UserOperation_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UserOperation_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_UserOperation_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UserOperation_8_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperation_8_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UserOperation_8_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperation_8_list) IsValid() bool { + return x.list != nil +} + +var ( + md_UserOperation protoreflect.MessageDescriptor + fd_UserOperation_sender protoreflect.FieldDescriptor + fd_UserOperation_authentication_method protoreflect.FieldDescriptor + fd_UserOperation_authentication_data protoreflect.FieldDescriptor + fd_UserOperation_sequence protoreflect.FieldDescriptor + fd_UserOperation_authentication_gas_limit protoreflect.FieldDescriptor + fd_UserOperation_bundler_payment_messages protoreflect.FieldDescriptor + fd_UserOperation_bundler_payment_gas_limit protoreflect.FieldDescriptor + fd_UserOperation_execution_messages protoreflect.FieldDescriptor + fd_UserOperation_execution_gas_limit protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_account_abstraction_proto_init() + md_UserOperation = File_cosmos_accounts_v1_account_abstraction_proto.Messages().ByName("UserOperation") + fd_UserOperation_sender = md_UserOperation.Fields().ByName("sender") + fd_UserOperation_authentication_method = md_UserOperation.Fields().ByName("authentication_method") + fd_UserOperation_authentication_data = md_UserOperation.Fields().ByName("authentication_data") + fd_UserOperation_sequence = md_UserOperation.Fields().ByName("sequence") + fd_UserOperation_authentication_gas_limit = md_UserOperation.Fields().ByName("authentication_gas_limit") + fd_UserOperation_bundler_payment_messages = md_UserOperation.Fields().ByName("bundler_payment_messages") + fd_UserOperation_bundler_payment_gas_limit = md_UserOperation.Fields().ByName("bundler_payment_gas_limit") + fd_UserOperation_execution_messages = md_UserOperation.Fields().ByName("execution_messages") + fd_UserOperation_execution_gas_limit = md_UserOperation.Fields().ByName("execution_gas_limit") +} + +var _ protoreflect.Message = (*fastReflection_UserOperation)(nil) + +type fastReflection_UserOperation UserOperation + +func (x *UserOperation) ProtoReflect() protoreflect.Message { + return (*fastReflection_UserOperation)(x) +} + +func (x *UserOperation) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[0] + 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_UserOperation_messageType fastReflection_UserOperation_messageType +var _ protoreflect.MessageType = fastReflection_UserOperation_messageType{} + +type fastReflection_UserOperation_messageType struct{} + +func (x fastReflection_UserOperation_messageType) Zero() protoreflect.Message { + return (*fastReflection_UserOperation)(nil) +} +func (x fastReflection_UserOperation_messageType) New() protoreflect.Message { + return new(fastReflection_UserOperation) +} +func (x fastReflection_UserOperation_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_UserOperation +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_UserOperation) Descriptor() protoreflect.MessageDescriptor { + return md_UserOperation +} + +// 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_UserOperation) Type() protoreflect.MessageType { + return _fastReflection_UserOperation_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_UserOperation) New() protoreflect.Message { + return new(fastReflection_UserOperation) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_UserOperation) Interface() protoreflect.ProtoMessage { + return (*UserOperation)(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_UserOperation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_UserOperation_sender, value) { + return + } + } + if x.AuthenticationMethod != "" { + value := protoreflect.ValueOfString(x.AuthenticationMethod) + if !f(fd_UserOperation_authentication_method, value) { + return + } + } + if len(x.AuthenticationData) != 0 { + value := protoreflect.ValueOfBytes(x.AuthenticationData) + if !f(fd_UserOperation_authentication_data, value) { + return + } + } + if x.Sequence != uint64(0) { + value := protoreflect.ValueOfUint64(x.Sequence) + if !f(fd_UserOperation_sequence, value) { + return + } + } + if x.AuthenticationGasLimit != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuthenticationGasLimit) + if !f(fd_UserOperation_authentication_gas_limit, value) { + return + } + } + if len(x.BundlerPaymentMessages) != 0 { + value := protoreflect.ValueOfList(&_UserOperation_6_list{list: &x.BundlerPaymentMessages}) + if !f(fd_UserOperation_bundler_payment_messages, value) { + return + } + } + if x.BundlerPaymentGasLimit != uint64(0) { + value := protoreflect.ValueOfUint64(x.BundlerPaymentGasLimit) + if !f(fd_UserOperation_bundler_payment_gas_limit, value) { + return + } + } + if len(x.ExecutionMessages) != 0 { + value := protoreflect.ValueOfList(&_UserOperation_8_list{list: &x.ExecutionMessages}) + if !f(fd_UserOperation_execution_messages, value) { + return + } + } + if x.ExecutionGasLimit != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExecutionGasLimit) + if !f(fd_UserOperation_execution_gas_limit, 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_UserOperation) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.sender": + return x.Sender != "" + case "cosmos.accounts.v1.UserOperation.authentication_method": + return x.AuthenticationMethod != "" + case "cosmos.accounts.v1.UserOperation.authentication_data": + return len(x.AuthenticationData) != 0 + case "cosmos.accounts.v1.UserOperation.sequence": + return x.Sequence != uint64(0) + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + return x.AuthenticationGasLimit != uint64(0) + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + return len(x.BundlerPaymentMessages) != 0 + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + return x.BundlerPaymentGasLimit != uint64(0) + case "cosmos.accounts.v1.UserOperation.execution_messages": + return len(x.ExecutionMessages) != 0 + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + return x.ExecutionGasLimit != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.sender": + x.Sender = "" + case "cosmos.accounts.v1.UserOperation.authentication_method": + x.AuthenticationMethod = "" + case "cosmos.accounts.v1.UserOperation.authentication_data": + x.AuthenticationData = nil + case "cosmos.accounts.v1.UserOperation.sequence": + x.Sequence = uint64(0) + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + x.AuthenticationGasLimit = uint64(0) + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + x.BundlerPaymentMessages = nil + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + x.BundlerPaymentGasLimit = uint64(0) + case "cosmos.accounts.v1.UserOperation.execution_messages": + x.ExecutionMessages = nil + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + x.ExecutionGasLimit = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.UserOperation.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.UserOperation.authentication_method": + value := x.AuthenticationMethod + return protoreflect.ValueOfString(value) + case "cosmos.accounts.v1.UserOperation.authentication_data": + value := x.AuthenticationData + return protoreflect.ValueOfBytes(value) + case "cosmos.accounts.v1.UserOperation.sequence": + value := x.Sequence + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + value := x.AuthenticationGasLimit + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + if len(x.BundlerPaymentMessages) == 0 { + return protoreflect.ValueOfList(&_UserOperation_6_list{}) + } + listValue := &_UserOperation_6_list{list: &x.BundlerPaymentMessages} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + value := x.BundlerPaymentGasLimit + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperation.execution_messages": + if len(x.ExecutionMessages) == 0 { + return protoreflect.ValueOfList(&_UserOperation_8_list{}) + } + listValue := &_UserOperation_8_list{list: &x.ExecutionMessages} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + value := x.ExecutionGasLimit + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.sender": + x.Sender = value.Interface().(string) + case "cosmos.accounts.v1.UserOperation.authentication_method": + x.AuthenticationMethod = value.Interface().(string) + case "cosmos.accounts.v1.UserOperation.authentication_data": + x.AuthenticationData = value.Bytes() + case "cosmos.accounts.v1.UserOperation.sequence": + x.Sequence = value.Uint() + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + x.AuthenticationGasLimit = value.Uint() + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + lv := value.List() + clv := lv.(*_UserOperation_6_list) + x.BundlerPaymentMessages = *clv.list + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + x.BundlerPaymentGasLimit = value.Uint() + case "cosmos.accounts.v1.UserOperation.execution_messages": + lv := value.List() + clv := lv.(*_UserOperation_8_list) + x.ExecutionMessages = *clv.list + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + x.ExecutionGasLimit = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + if x.BundlerPaymentMessages == nil { + x.BundlerPaymentMessages = []*anypb.Any{} + } + value := &_UserOperation_6_list{list: &x.BundlerPaymentMessages} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperation.execution_messages": + if x.ExecutionMessages == nil { + x.ExecutionMessages = []*anypb.Any{} + } + value := &_UserOperation_8_list{list: &x.ExecutionMessages} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperation.sender": + panic(fmt.Errorf("field sender of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.authentication_method": + panic(fmt.Errorf("field authentication_method of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.authentication_data": + panic(fmt.Errorf("field authentication_data of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.sequence": + panic(fmt.Errorf("field sequence of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + panic(fmt.Errorf("field authentication_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + panic(fmt.Errorf("field bundler_payment_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + panic(fmt.Errorf("field execution_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.sender": + return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.UserOperation.authentication_method": + return protoreflect.ValueOfString("") + case "cosmos.accounts.v1.UserOperation.authentication_data": + return protoreflect.ValueOfBytes(nil) + case "cosmos.accounts.v1.UserOperation.sequence": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_UserOperation_6_list{list: &list}) + case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperation.execution_messages": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_UserOperation_8_list{list: &list}) + case "cosmos.accounts.v1.UserOperation.execution_gas_limit": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperation 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_UserOperation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.UserOperation", 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_UserOperation) 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_UserOperation) 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_UserOperation) 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_UserOperation) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*UserOperation) + 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.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AuthenticationMethod) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AuthenticationData) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Sequence != 0 { + n += 1 + runtime.Sov(uint64(x.Sequence)) + } + if x.AuthenticationGasLimit != 0 { + n += 1 + runtime.Sov(uint64(x.AuthenticationGasLimit)) + } + if len(x.BundlerPaymentMessages) > 0 { + for _, e := range x.BundlerPaymentMessages { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.BundlerPaymentGasLimit != 0 { + n += 1 + runtime.Sov(uint64(x.BundlerPaymentGasLimit)) + } + if len(x.ExecutionMessages) > 0 { + for _, e := range x.ExecutionMessages { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.ExecutionGasLimit != 0 { + n += 1 + runtime.Sov(uint64(x.ExecutionGasLimit)) + } + 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().(*UserOperation) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ExecutionGasLimit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecutionGasLimit)) + i-- + dAtA[i] = 0x48 + } + if len(x.ExecutionMessages) > 0 { + for iNdEx := len(x.ExecutionMessages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExecutionMessages[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] = 0x42 + } + } + if x.BundlerPaymentGasLimit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BundlerPaymentGasLimit)) + i-- + dAtA[i] = 0x38 + } + if len(x.BundlerPaymentMessages) > 0 { + for iNdEx := len(x.BundlerPaymentMessages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BundlerPaymentMessages[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] = 0x32 + } + } + if x.AuthenticationGasLimit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuthenticationGasLimit)) + i-- + dAtA[i] = 0x28 + } + if x.Sequence != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) + i-- + dAtA[i] = 0x20 + } + if len(x.AuthenticationData) > 0 { + i -= len(x.AuthenticationData) + copy(dAtA[i:], x.AuthenticationData) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthenticationData))) + i-- + dAtA[i] = 0x1a + } + if len(x.AuthenticationMethod) > 0 { + i -= len(x.AuthenticationMethod) + copy(dAtA[i:], x.AuthenticationMethod) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthenticationMethod))) + i-- + dAtA[i] = 0x12 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + 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().(*UserOperation) + 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: UserOperation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UserOperation: 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 Sender", 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.Sender = 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 AuthenticationMethod", 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.AuthenticationMethod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.AuthenticationData = append(x.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) + if x.AuthenticationData == nil { + x.AuthenticationData = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + x.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasLimit", wireType) + } + x.AuthenticationGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuthenticationGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentMessages", 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.BundlerPaymentMessages = append(x.BundlerPaymentMessages, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BundlerPaymentMessages[len(x.BundlerPaymentMessages)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasLimit", wireType) + } + x.BundlerPaymentGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BundlerPaymentGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionMessages", 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.ExecutionMessages = append(x.ExecutionMessages, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecutionMessages[len(x.ExecutionMessages)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasLimit", wireType) + } + x.ExecutionGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ExecutionGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_UserOperationResponse_3_list)(nil) + +type _UserOperationResponse_3_list struct { + list *[]*anypb.Any +} + +func (x *_UserOperationResponse_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UserOperationResponse_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UserOperationResponse_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_UserOperationResponse_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UserOperationResponse_3_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperationResponse_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UserOperationResponse_3_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperationResponse_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_UserOperationResponse_5_list)(nil) + +type _UserOperationResponse_5_list struct { + list *[]*anypb.Any +} + +func (x *_UserOperationResponse_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UserOperationResponse_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UserOperationResponse_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_UserOperationResponse_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UserOperationResponse_5_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperationResponse_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UserOperationResponse_5_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UserOperationResponse_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_UserOperationResponse protoreflect.MessageDescriptor + fd_UserOperationResponse_authentication_gas_used protoreflect.FieldDescriptor + fd_UserOperationResponse_bundler_payment_gas_used protoreflect.FieldDescriptor + fd_UserOperationResponse_bundler_payment_responses protoreflect.FieldDescriptor + fd_UserOperationResponse_execution_gas_used protoreflect.FieldDescriptor + fd_UserOperationResponse_execution_responses protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_account_abstraction_proto_init() + md_UserOperationResponse = File_cosmos_accounts_v1_account_abstraction_proto.Messages().ByName("UserOperationResponse") + fd_UserOperationResponse_authentication_gas_used = md_UserOperationResponse.Fields().ByName("authentication_gas_used") + fd_UserOperationResponse_bundler_payment_gas_used = md_UserOperationResponse.Fields().ByName("bundler_payment_gas_used") + fd_UserOperationResponse_bundler_payment_responses = md_UserOperationResponse.Fields().ByName("bundler_payment_responses") + fd_UserOperationResponse_execution_gas_used = md_UserOperationResponse.Fields().ByName("execution_gas_used") + fd_UserOperationResponse_execution_responses = md_UserOperationResponse.Fields().ByName("execution_responses") +} + +var _ protoreflect.Message = (*fastReflection_UserOperationResponse)(nil) + +type fastReflection_UserOperationResponse UserOperationResponse + +func (x *UserOperationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_UserOperationResponse)(x) +} + +func (x *UserOperationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + 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_UserOperationResponse_messageType fastReflection_UserOperationResponse_messageType +var _ protoreflect.MessageType = fastReflection_UserOperationResponse_messageType{} + +type fastReflection_UserOperationResponse_messageType struct{} + +func (x fastReflection_UserOperationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_UserOperationResponse)(nil) +} +func (x fastReflection_UserOperationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_UserOperationResponse) +} +func (x fastReflection_UserOperationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_UserOperationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_UserOperationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_UserOperationResponse +} + +// 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_UserOperationResponse) Type() protoreflect.MessageType { + return _fastReflection_UserOperationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_UserOperationResponse) New() protoreflect.Message { + return new(fastReflection_UserOperationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_UserOperationResponse) Interface() protoreflect.ProtoMessage { + return (*UserOperationResponse)(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_UserOperationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuthenticationGasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.AuthenticationGasUsed) + if !f(fd_UserOperationResponse_authentication_gas_used, value) { + return + } + } + if x.BundlerPaymentGasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.BundlerPaymentGasUsed) + if !f(fd_UserOperationResponse_bundler_payment_gas_used, value) { + return + } + } + if len(x.BundlerPaymentResponses) != 0 { + value := protoreflect.ValueOfList(&_UserOperationResponse_3_list{list: &x.BundlerPaymentResponses}) + if !f(fd_UserOperationResponse_bundler_payment_responses, value) { + return + } + } + if x.ExecutionGasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExecutionGasUsed) + if !f(fd_UserOperationResponse_execution_gas_used, value) { + return + } + } + if len(x.ExecutionResponses) != 0 { + value := protoreflect.ValueOfList(&_UserOperationResponse_5_list{list: &x.ExecutionResponses}) + if !f(fd_UserOperationResponse_execution_responses, 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_UserOperationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + return x.AuthenticationGasUsed != uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + return x.BundlerPaymentGasUsed != uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + return len(x.BundlerPaymentResponses) != 0 + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + return x.ExecutionGasUsed != uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + return len(x.ExecutionResponses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + x.AuthenticationGasUsed = uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + x.BundlerPaymentGasUsed = uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + x.BundlerPaymentResponses = nil + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + x.ExecutionGasUsed = uint64(0) + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + x.ExecutionResponses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + value := x.AuthenticationGasUsed + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + value := x.BundlerPaymentGasUsed + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + if len(x.BundlerPaymentResponses) == 0 { + return protoreflect.ValueOfList(&_UserOperationResponse_3_list{}) + } + listValue := &_UserOperationResponse_3_list{list: &x.BundlerPaymentResponses} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + value := x.ExecutionGasUsed + return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + if len(x.ExecutionResponses) == 0 { + return protoreflect.ValueOfList(&_UserOperationResponse_5_list{}) + } + listValue := &_UserOperationResponse_5_list{list: &x.ExecutionResponses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + x.AuthenticationGasUsed = value.Uint() + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + x.BundlerPaymentGasUsed = value.Uint() + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + lv := value.List() + clv := lv.(*_UserOperationResponse_3_list) + x.BundlerPaymentResponses = *clv.list + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + x.ExecutionGasUsed = value.Uint() + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + lv := value.List() + clv := lv.(*_UserOperationResponse_5_list) + x.ExecutionResponses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + if x.BundlerPaymentResponses == nil { + x.BundlerPaymentResponses = []*anypb.Any{} + } + value := &_UserOperationResponse_3_list{list: &x.BundlerPaymentResponses} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + if x.ExecutionResponses == nil { + x.ExecutionResponses = []*anypb.Any{} + } + value := &_UserOperationResponse_5_list{list: &x.ExecutionResponses} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + panic(fmt.Errorf("field authentication_gas_used of message cosmos.accounts.v1.UserOperationResponse is not mutable")) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + panic(fmt.Errorf("field bundler_payment_gas_used of message cosmos.accounts.v1.UserOperationResponse is not mutable")) + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + panic(fmt.Errorf("field execution_gas_used of message cosmos.accounts.v1.UserOperationResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.UserOperationResponse.authentication_gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_UserOperationResponse_3_list{list: &list}) + case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperationResponse.execution_responses": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_UserOperationResponse_5_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.UserOperationResponse 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_UserOperationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.UserOperationResponse", 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_UserOperationResponse) 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_UserOperationResponse) 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_UserOperationResponse) 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_UserOperationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*UserOperationResponse) + 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.AuthenticationGasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.AuthenticationGasUsed)) + } + if x.BundlerPaymentGasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.BundlerPaymentGasUsed)) + } + if len(x.BundlerPaymentResponses) > 0 { + for _, e := range x.BundlerPaymentResponses { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.ExecutionGasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.ExecutionGasUsed)) + } + if len(x.ExecutionResponses) > 0 { + for _, e := range x.ExecutionResponses { + 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().(*UserOperationResponse) + 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.ExecutionResponses) > 0 { + for iNdEx := len(x.ExecutionResponses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExecutionResponses[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] = 0x2a + } + } + if x.ExecutionGasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecutionGasUsed)) + i-- + dAtA[i] = 0x20 + } + if len(x.BundlerPaymentResponses) > 0 { + for iNdEx := len(x.BundlerPaymentResponses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.BundlerPaymentResponses[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 x.BundlerPaymentGasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BundlerPaymentGasUsed)) + i-- + dAtA[i] = 0x10 + } + if x.AuthenticationGasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AuthenticationGasUsed)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*UserOperationResponse) + 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: UserOperationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UserOperationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasUsed", wireType) + } + x.AuthenticationGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.AuthenticationGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasUsed", wireType) + } + x.BundlerPaymentGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BundlerPaymentGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentResponses", 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.BundlerPaymentResponses = append(x.BundlerPaymentResponses, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BundlerPaymentResponses[len(x.BundlerPaymentResponses)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasUsed", wireType) + } + x.ExecutionGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ExecutionGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionResponses", 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.ExecutionResponses = append(x.ExecutionResponses, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExecutionResponses[len(x.ExecutionResponses)-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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/accounts/v1/account_abstraction.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// UserOperation defines the type used to define a state transition that +// an account wants to make. +type UserOperation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sender defines the account that is sending the UserOperation. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // authentication_method defines the authentication strategy the account wants to use. + // since accounts can have multiple authentication methods, this field is used to + // instruct the account on what auth method to use. + AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` + // authentication_data defines the authentication data associated with the authentication method. + // It is the account implementer duty to assess that the UserOperation is properly signed. + AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + // sequence defines the sequence number of the account, the authentication method might require this + // to ensure non-replayability. + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + // authentication_gas_limit expresses the gas limit to be used for the authentication part of the + // UserOperation. + AuthenticationGasLimit uint64 `protobuf:"varint,5,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` + // bundler_payment_messages expresses a list of messages that the account + // executes to pay the bundler for submitting the UserOperation. + // It can be empty if the bundler does not need any form of payment, + // the handshake for submitting the UserOperation might have happened off-chain. + // Bundlers and accounts are free to use any form of payment, in fact the payment can + // either be empty or be expressed as: + // - NFT payment + // - IBC Token payment. + // - Payment through delegations. + BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,6,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` + // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. + // This ensures that, since the bundler executes a list of UserOperations and there needs to + // be minimal trust between bundler and UserOperation sender, the sender cannot consume + // the whole bundle gas. + BundlerPaymentGasLimit uint64 `protobuf:"varint,7,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` + // execution_messages expresses a list of messages that the account wants to execute. + // This concretely is the intent of the transaction expressed as a UserOperation. + ExecutionMessages []*anypb.Any `protobuf:"bytes,8,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` + // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's + // execution messages. + ExecutionGasLimit uint64 `protobuf:"varint,9,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` +} + +func (x *UserOperation) Reset() { + *x = UserOperation{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserOperation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserOperation) ProtoMessage() {} + +// Deprecated: Use UserOperation.ProtoReflect.Descriptor instead. +func (*UserOperation) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{0} +} + +func (x *UserOperation) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *UserOperation) GetAuthenticationMethod() string { + if x != nil { + return x.AuthenticationMethod + } + return "" +} + +func (x *UserOperation) GetAuthenticationData() []byte { + if x != nil { + return x.AuthenticationData + } + return nil +} + +func (x *UserOperation) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *UserOperation) GetAuthenticationGasLimit() uint64 { + if x != nil { + return x.AuthenticationGasLimit + } + return 0 +} + +func (x *UserOperation) GetBundlerPaymentMessages() []*anypb.Any { + if x != nil { + return x.BundlerPaymentMessages + } + return nil +} + +func (x *UserOperation) GetBundlerPaymentGasLimit() uint64 { + if x != nil { + return x.BundlerPaymentGasLimit + } + return 0 +} + +func (x *UserOperation) GetExecutionMessages() []*anypb.Any { + if x != nil { + return x.ExecutionMessages + } + return nil +} + +func (x *UserOperation) GetExecutionGasLimit() uint64 { + if x != nil { + return x.ExecutionGasLimit + } + return 0 +} + +// UserOperationResponse defines the response of a UserOperation. +type UserOperationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authentication_gas_used defines the gas used for the authentication part of the UserOperation. + AuthenticationGasUsed uint64 `protobuf:"varint,1,opt,name=authentication_gas_used,json=authenticationGasUsed,proto3" json:"authentication_gas_used,omitempty"` + // bundler_payment_gas_used defines the gas used for the bundler payment part of the UserOperation. + BundlerPaymentGasUsed uint64 `protobuf:"varint,2,opt,name=bundler_payment_gas_used,json=bundlerPaymentGasUsed,proto3" json:"bundler_payment_gas_used,omitempty"` + // bundler_payment_responses defines the responses of the bundler payment messages. + // It can be empty if the bundler does not need any form of payment. + BundlerPaymentResponses []*anypb.Any `protobuf:"bytes,3,rep,name=bundler_payment_responses,json=bundlerPaymentResponses,proto3" json:"bundler_payment_responses,omitempty"` + // execution_gas_used defines the gas used for the execution part of the UserOperation. + ExecutionGasUsed uint64 `protobuf:"varint,4,opt,name=execution_gas_used,json=executionGasUsed,proto3" json:"execution_gas_used,omitempty"` + // execution_responses defines the responses of the execution messages. + ExecutionResponses []*anypb.Any `protobuf:"bytes,5,rep,name=execution_responses,json=executionResponses,proto3" json:"execution_responses,omitempty"` +} + +func (x *UserOperationResponse) Reset() { + *x = UserOperationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserOperationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserOperationResponse) ProtoMessage() {} + +// Deprecated: Use UserOperationResponse.ProtoReflect.Descriptor instead. +func (*UserOperationResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{1} +} + +func (x *UserOperationResponse) GetAuthenticationGasUsed() uint64 { + if x != nil { + return x.AuthenticationGasUsed + } + return 0 +} + +func (x *UserOperationResponse) GetBundlerPaymentGasUsed() uint64 { + if x != nil { + return x.BundlerPaymentGasUsed + } + return 0 +} + +func (x *UserOperationResponse) GetBundlerPaymentResponses() []*anypb.Any { + if x != nil { + return x.BundlerPaymentResponses + } + return nil +} + +func (x *UserOperationResponse) GetExecutionGasUsed() uint64 { + if x != nil { + return x.ExecutionGasUsed + } + return 0 +} + +func (x *UserOperationResponse) GetExecutionResponses() []*anypb.Any { + if x != nil { + return x.ExecutionResponses + } + return nil +} + +var File_cosmos_accounts_v1_account_abstraction_proto protoreflect.FileDescriptor + +var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x03, + 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2f, 0x0a, 0x13, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x61, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, + 0x06, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x43, + 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, + 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, + 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x50, + 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 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, 0x17, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, + 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 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, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0xcb, 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, 0x17, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 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 ( + file_cosmos_accounts_v1_account_abstraction_proto_rawDescOnce sync.Once + file_cosmos_accounts_v1_account_abstraction_proto_rawDescData = file_cosmos_accounts_v1_account_abstraction_proto_rawDesc +) + +func file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP() []byte { + file_cosmos_accounts_v1_account_abstraction_proto_rawDescOnce.Do(func() { + file_cosmos_accounts_v1_account_abstraction_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_accounts_v1_account_abstraction_proto_rawDescData) + }) + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescData +} + +var file_cosmos_accounts_v1_account_abstraction_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_accounts_v1_account_abstraction_proto_goTypes = []interface{}{ + (*UserOperation)(nil), // 0: cosmos.accounts.v1.UserOperation + (*UserOperationResponse)(nil), // 1: cosmos.accounts.v1.UserOperationResponse + (*anypb.Any)(nil), // 2: google.protobuf.Any +} +var file_cosmos_accounts_v1_account_abstraction_proto_depIdxs = []int32{ + 2, // 0: cosmos.accounts.v1.UserOperation.bundler_payment_messages:type_name -> google.protobuf.Any + 2, // 1: cosmos.accounts.v1.UserOperation.execution_messages:type_name -> google.protobuf.Any + 2, // 2: cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses:type_name -> google.protobuf.Any + 2, // 3: cosmos.accounts.v1.UserOperationResponse.execution_responses:type_name -> google.protobuf.Any + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cosmos_accounts_v1_account_abstraction_proto_init() } +func file_cosmos_accounts_v1_account_abstraction_proto_init() { + if File_cosmos_accounts_v1_account_abstraction_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserOperation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserOperationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_accounts_v1_account_abstraction_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_accounts_v1_account_abstraction_proto_goTypes, + DependencyIndexes: file_cosmos_accounts_v1_account_abstraction_proto_depIdxs, + MessageInfos: file_cosmos_accounts_v1_account_abstraction_proto_msgTypes, + }.Build() + File_cosmos_accounts_v1_account_abstraction_proto = out.File + file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = nil + file_cosmos_accounts_v1_account_abstraction_proto_goTypes = nil + file_cosmos_accounts_v1_account_abstraction_proto_depIdxs = nil +} diff --git a/x/accounts/v1/account_abstraction.pb.go b/x/accounts/v1/account_abstraction.pb.go new file mode 100644 index 000000000000..76a7ccd2e140 --- /dev/null +++ b/x/accounts/v1/account_abstraction.pb.go @@ -0,0 +1,1088 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/accounts/v1/account_abstraction.proto + +package v1 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// UserOperation defines the type used to define a state transition that +// an account wants to make. +type UserOperation struct { + // sender defines the account that is sending the UserOperation. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // authentication_method defines the authentication strategy the account wants to use. + // since accounts can have multiple authentication methods, this field is used to + // instruct the account on what auth method to use. + AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` + // authentication_data defines the authentication data associated with the authentication method. + // It is the account implementer duty to assess that the UserOperation is properly signed. + AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + // sequence defines the sequence number of the account, the authentication method might require this + // to ensure non-replayability. + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + // authentication_gas_limit expresses the gas limit to be used for the authentication part of the + // UserOperation. + AuthenticationGasLimit uint64 `protobuf:"varint,5,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` + // bundler_payment_messages expresses a list of messages that the account + // executes to pay the bundler for submitting the UserOperation. + // It can be empty if the bundler does not need any form of payment, + // the handshake for submitting the UserOperation might have happened off-chain. + // Bundlers and accounts are free to use any form of payment, in fact the payment can + // either be empty or be expressed as: + // - NFT payment + // - IBC Token payment. + // - Payment through delegations. + BundlerPaymentMessages []*types.Any `protobuf:"bytes,6,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` + // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. + // This ensures that, since the bundler executes a list of UserOperations and there needs to + // be minimal trust between bundler and UserOperation sender, the sender cannot consume + // the whole bundle gas. + BundlerPaymentGasLimit uint64 `protobuf:"varint,7,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` + // execution_messages expresses a list of messages that the account wants to execute. + // This concretely is the intent of the transaction expressed as a UserOperation. + ExecutionMessages []*types.Any `protobuf:"bytes,8,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` + // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's + // execution messages. + ExecutionGasLimit uint64 `protobuf:"varint,9,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` +} + +func (m *UserOperation) Reset() { *m = UserOperation{} } +func (m *UserOperation) String() string { return proto.CompactTextString(m) } +func (*UserOperation) ProtoMessage() {} +func (*UserOperation) Descriptor() ([]byte, []int) { + return fileDescriptor_9f9bcc910ad46d4b, []int{0} +} +func (m *UserOperation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserOperation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserOperation.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 *UserOperation) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserOperation.Merge(m, src) +} +func (m *UserOperation) XXX_Size() int { + return m.Size() +} +func (m *UserOperation) XXX_DiscardUnknown() { + xxx_messageInfo_UserOperation.DiscardUnknown(m) +} + +var xxx_messageInfo_UserOperation proto.InternalMessageInfo + +func (m *UserOperation) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *UserOperation) GetAuthenticationMethod() string { + if m != nil { + return m.AuthenticationMethod + } + return "" +} + +func (m *UserOperation) GetAuthenticationData() []byte { + if m != nil { + return m.AuthenticationData + } + return nil +} + +func (m *UserOperation) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *UserOperation) GetAuthenticationGasLimit() uint64 { + if m != nil { + return m.AuthenticationGasLimit + } + return 0 +} + +func (m *UserOperation) GetBundlerPaymentMessages() []*types.Any { + if m != nil { + return m.BundlerPaymentMessages + } + return nil +} + +func (m *UserOperation) GetBundlerPaymentGasLimit() uint64 { + if m != nil { + return m.BundlerPaymentGasLimit + } + return 0 +} + +func (m *UserOperation) GetExecutionMessages() []*types.Any { + if m != nil { + return m.ExecutionMessages + } + return nil +} + +func (m *UserOperation) GetExecutionGasLimit() uint64 { + if m != nil { + return m.ExecutionGasLimit + } + return 0 +} + +// UserOperationResponse defines the response of a UserOperation. +type UserOperationResponse struct { + // authentication_gas_used defines the gas used for the authentication part of the UserOperation. + AuthenticationGasUsed uint64 `protobuf:"varint,1,opt,name=authentication_gas_used,json=authenticationGasUsed,proto3" json:"authentication_gas_used,omitempty"` + // bundler_payment_gas_used defines the gas used for the bundler payment part of the UserOperation. + BundlerPaymentGasUsed uint64 `protobuf:"varint,2,opt,name=bundler_payment_gas_used,json=bundlerPaymentGasUsed,proto3" json:"bundler_payment_gas_used,omitempty"` + // bundler_payment_responses defines the responses of the bundler payment messages. + // It can be empty if the bundler does not need any form of payment. + BundlerPaymentResponses []*types.Any `protobuf:"bytes,3,rep,name=bundler_payment_responses,json=bundlerPaymentResponses,proto3" json:"bundler_payment_responses,omitempty"` + // execution_gas_used defines the gas used for the execution part of the UserOperation. + ExecutionGasUsed uint64 `protobuf:"varint,4,opt,name=execution_gas_used,json=executionGasUsed,proto3" json:"execution_gas_used,omitempty"` + // execution_responses defines the responses of the execution messages. + ExecutionResponses []*types.Any `protobuf:"bytes,5,rep,name=execution_responses,json=executionResponses,proto3" json:"execution_responses,omitempty"` +} + +func (m *UserOperationResponse) Reset() { *m = UserOperationResponse{} } +func (m *UserOperationResponse) String() string { return proto.CompactTextString(m) } +func (*UserOperationResponse) ProtoMessage() {} +func (*UserOperationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9f9bcc910ad46d4b, []int{1} +} +func (m *UserOperationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserOperationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserOperationResponse.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 *UserOperationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserOperationResponse.Merge(m, src) +} +func (m *UserOperationResponse) XXX_Size() int { + return m.Size() +} +func (m *UserOperationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UserOperationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UserOperationResponse proto.InternalMessageInfo + +func (m *UserOperationResponse) GetAuthenticationGasUsed() uint64 { + if m != nil { + return m.AuthenticationGasUsed + } + return 0 +} + +func (m *UserOperationResponse) GetBundlerPaymentGasUsed() uint64 { + if m != nil { + return m.BundlerPaymentGasUsed + } + return 0 +} + +func (m *UserOperationResponse) GetBundlerPaymentResponses() []*types.Any { + if m != nil { + return m.BundlerPaymentResponses + } + return nil +} + +func (m *UserOperationResponse) GetExecutionGasUsed() uint64 { + if m != nil { + return m.ExecutionGasUsed + } + return 0 +} + +func (m *UserOperationResponse) GetExecutionResponses() []*types.Any { + if m != nil { + return m.ExecutionResponses + } + return nil +} + +func init() { + proto.RegisterType((*UserOperation)(nil), "cosmos.accounts.v1.UserOperation") + proto.RegisterType((*UserOperationResponse)(nil), "cosmos.accounts.v1.UserOperationResponse") +} + +func init() { + proto.RegisterFile("cosmos/accounts/v1/account_abstraction.proto", fileDescriptor_9f9bcc910ad46d4b) +} + +var fileDescriptor_9f9bcc910ad46d4b = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, + 0x14, 0x85, 0xe3, 0x24, 0x0d, 0xed, 0x00, 0x12, 0x4c, 0x9b, 0x74, 0x9a, 0x85, 0x15, 0x75, 0x95, + 0x45, 0x35, 0x56, 0x29, 0xe2, 0x67, 0xc9, 0x9f, 0xd8, 0x50, 0xa8, 0x2c, 0x75, 0xc3, 0xc6, 0x9a, + 0xd8, 0x97, 0xd4, 0x22, 0x9e, 0x09, 0xbe, 0xe3, 0xaa, 0x79, 0x0b, 0x1e, 0x8b, 0x1d, 0x5d, 0xb2, + 0x44, 0xc9, 0x8b, 0xa0, 0xcc, 0xf8, 0x27, 0x8e, 0x51, 0x76, 0x19, 0xdd, 0x73, 0xee, 0x39, 0xf9, + 0xc6, 0x43, 0xce, 0x42, 0x85, 0x89, 0x42, 0x4f, 0x84, 0xa1, 0xca, 0xa4, 0x46, 0xef, 0xf6, 0xbc, + 0xf8, 0x1d, 0x88, 0x09, 0xea, 0x54, 0x84, 0x3a, 0x56, 0x92, 0xcf, 0x53, 0xa5, 0x15, 0xa5, 0x56, + 0xcd, 0x0b, 0x35, 0xbf, 0x3d, 0x1f, 0x9e, 0x4c, 0x95, 0x9a, 0xce, 0xc0, 0x33, 0x8a, 0x49, 0xf6, + 0xcd, 0x13, 0x72, 0x61, 0xe5, 0xa7, 0xab, 0x0e, 0x79, 0x7c, 0x8d, 0x90, 0x7e, 0x99, 0x43, 0x2a, + 0xd6, 0x6b, 0xe8, 0x80, 0xf4, 0x10, 0x64, 0x04, 0x29, 0x73, 0x46, 0xce, 0xf8, 0xc0, 0xcf, 0x4f, + 0xf4, 0x82, 0xf4, 0x45, 0xa6, 0x6f, 0x40, 0xea, 0x38, 0x34, 0xca, 0x20, 0x01, 0x7d, 0xa3, 0x22, + 0xd6, 0x36, 0xb2, 0xa3, 0xfa, 0xf0, 0xd2, 0xcc, 0xa8, 0x47, 0x0e, 0xb7, 0x4c, 0x91, 0xd0, 0x82, + 0x75, 0x46, 0xce, 0xf8, 0x91, 0x4f, 0xeb, 0xa3, 0xf7, 0x42, 0x0b, 0x3a, 0x24, 0xfb, 0x08, 0x3f, + 0x32, 0x90, 0x21, 0xb0, 0xee, 0xc8, 0x19, 0x77, 0xfd, 0xf2, 0x4c, 0x5f, 0x11, 0xb6, 0xb5, 0x6c, + 0x2a, 0x30, 0x98, 0xc5, 0x49, 0xac, 0xd9, 0x9e, 0xd1, 0x0e, 0xea, 0xf3, 0x8f, 0x02, 0x3f, 0xad, + 0xa7, 0xf4, 0x33, 0x61, 0x93, 0x4c, 0x46, 0x33, 0x48, 0x83, 0xb9, 0x58, 0x24, 0x20, 0x75, 0x90, + 0x00, 0xa2, 0x98, 0x02, 0xb2, 0xde, 0xa8, 0x33, 0x7e, 0xf8, 0xec, 0x88, 0x5b, 0x46, 0xbc, 0x60, + 0xc4, 0xdf, 0xc8, 0x85, 0x3f, 0xc8, 0x5d, 0x57, 0xd6, 0x74, 0x99, 0x7b, 0xe8, 0x6b, 0x72, 0xb2, + 0xbd, 0xaf, 0xaa, 0xf2, 0xc0, 0x56, 0xa9, 0x5b, 0xcb, 0x2a, 0xef, 0x08, 0x85, 0x3b, 0x08, 0xb3, + 0x9c, 0x60, 0x5e, 0x62, 0x7f, 0x47, 0x89, 0xa7, 0xa5, 0xbe, 0xcc, 0xe7, 0xe4, 0xb0, 0x5a, 0x52, + 0x25, 0x1f, 0x98, 0xe4, 0x4a, 0x5f, 0x84, 0x9e, 0xfe, 0x6e, 0x93, 0x7e, 0xed, 0x96, 0x7d, 0xc0, + 0xb9, 0x92, 0x08, 0xf4, 0x05, 0x39, 0xfe, 0x0f, 0xd3, 0x0c, 0x21, 0x32, 0xd7, 0xdf, 0xf5, 0xfb, + 0x0d, 0xa4, 0xd7, 0x08, 0x11, 0x7d, 0xd9, 0x24, 0x5a, 0x1a, 0xdb, 0xd6, 0xd8, 0x00, 0x60, 0x8c, + 0x57, 0x4d, 0x74, 0x69, 0x5e, 0x06, 0x59, 0x67, 0x07, 0x86, 0xe3, 0xfa, 0xbe, 0xe2, 0x1f, 0x20, + 0x3d, 0xdb, 0x24, 0x5a, 0x96, 0xb0, 0x1f, 0xcf, 0x93, 0x4d, 0x16, 0x26, 0xff, 0xc3, 0x26, 0xba, + 0x2a, 0x79, 0x6f, 0x47, 0x72, 0xb5, 0xbe, 0x0c, 0x7d, 0xfb, 0xfc, 0xd7, 0xd2, 0x75, 0xee, 0x97, + 0xae, 0xf3, 0x77, 0xe9, 0x3a, 0x3f, 0x57, 0x6e, 0xeb, 0x7e, 0xe5, 0xb6, 0xfe, 0xac, 0xdc, 0xd6, + 0xd7, 0xa1, 0x7d, 0x80, 0x18, 0x7d, 0xe7, 0xb1, 0xf2, 0xee, 0x36, 0x9f, 0xed, 0xa4, 0x67, 0xf6, + 0x5e, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xea, 0xb4, 0x8f, 0x4f, 0xd3, 0x03, 0x00, 0x00, +} + +func (m *UserOperation) 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 *UserOperation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExecutionGasLimit != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.ExecutionGasLimit)) + i-- + dAtA[i] = 0x48 + } + if len(m.ExecutionMessages) > 0 { + for iNdEx := len(m.ExecutionMessages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExecutionMessages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.BundlerPaymentGasLimit != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.BundlerPaymentGasLimit)) + i-- + dAtA[i] = 0x38 + } + if len(m.BundlerPaymentMessages) > 0 { + for iNdEx := len(m.BundlerPaymentMessages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BundlerPaymentMessages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.AuthenticationGasLimit != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.AuthenticationGasLimit)) + i-- + dAtA[i] = 0x28 + } + if m.Sequence != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if len(m.AuthenticationData) > 0 { + i -= len(m.AuthenticationData) + copy(dAtA[i:], m.AuthenticationData) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthenticationData))) + i-- + dAtA[i] = 0x1a + } + if len(m.AuthenticationMethod) > 0 { + i -= len(m.AuthenticationMethod) + copy(dAtA[i:], m.AuthenticationMethod) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthenticationMethod))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserOperationResponse) 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 *UserOperationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserOperationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExecutionResponses) > 0 { + for iNdEx := len(m.ExecutionResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExecutionResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.ExecutionGasUsed != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.ExecutionGasUsed)) + i-- + dAtA[i] = 0x20 + } + if len(m.BundlerPaymentResponses) > 0 { + for iNdEx := len(m.BundlerPaymentResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BundlerPaymentResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.BundlerPaymentGasUsed != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.BundlerPaymentGasUsed)) + i-- + dAtA[i] = 0x10 + } + if m.AuthenticationGasUsed != 0 { + i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.AuthenticationGasUsed)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAccountAbstraction(dAtA []byte, offset int, v uint64) int { + offset -= sovAccountAbstraction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *UserOperation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + l = len(m.AuthenticationMethod) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + l = len(m.AuthenticationData) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovAccountAbstraction(uint64(m.Sequence)) + } + if m.AuthenticationGasLimit != 0 { + n += 1 + sovAccountAbstraction(uint64(m.AuthenticationGasLimit)) + } + if len(m.BundlerPaymentMessages) > 0 { + for _, e := range m.BundlerPaymentMessages { + l = e.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + } + if m.BundlerPaymentGasLimit != 0 { + n += 1 + sovAccountAbstraction(uint64(m.BundlerPaymentGasLimit)) + } + if len(m.ExecutionMessages) > 0 { + for _, e := range m.ExecutionMessages { + l = e.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + } + if m.ExecutionGasLimit != 0 { + n += 1 + sovAccountAbstraction(uint64(m.ExecutionGasLimit)) + } + return n +} + +func (m *UserOperationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuthenticationGasUsed != 0 { + n += 1 + sovAccountAbstraction(uint64(m.AuthenticationGasUsed)) + } + if m.BundlerPaymentGasUsed != 0 { + n += 1 + sovAccountAbstraction(uint64(m.BundlerPaymentGasUsed)) + } + if len(m.BundlerPaymentResponses) > 0 { + for _, e := range m.BundlerPaymentResponses { + l = e.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + } + if m.ExecutionGasUsed != 0 { + n += 1 + sovAccountAbstraction(uint64(m.ExecutionGasUsed)) + } + if len(m.ExecutionResponses) > 0 { + for _, e := range m.ExecutionResponses { + l = e.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + } + return n +} + +func sovAccountAbstraction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAccountAbstraction(x uint64) (n int) { + return sovAccountAbstraction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *UserOperation) 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 ErrIntOverflowAccountAbstraction + } + 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: UserOperation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserOperation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + 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 ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationMethod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + 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 ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthenticationMethod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthenticationData = append(m.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) + if m.AuthenticationData == nil { + m.AuthenticationData = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasLimit", wireType) + } + m.AuthenticationGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuthenticationGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentMessages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BundlerPaymentMessages = append(m.BundlerPaymentMessages, &types.Any{}) + if err := m.BundlerPaymentMessages[len(m.BundlerPaymentMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasLimit", wireType) + } + m.BundlerPaymentGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BundlerPaymentGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionMessages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutionMessages = append(m.ExecutionMessages, &types.Any{}) + if err := m.ExecutionMessages[len(m.ExecutionMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasLimit", wireType) + } + m.ExecutionGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutionGasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccountAbstraction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserOperationResponse) 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 ErrIntOverflowAccountAbstraction + } + 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: UserOperationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserOperationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasUsed", wireType) + } + m.AuthenticationGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuthenticationGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasUsed", wireType) + } + m.BundlerPaymentGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BundlerPaymentGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BundlerPaymentResponses = append(m.BundlerPaymentResponses, &types.Any{}) + if err := m.BundlerPaymentResponses[len(m.BundlerPaymentResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasUsed", wireType) + } + m.ExecutionGasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutionGasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutionResponses = append(m.ExecutionResponses, &types.Any{}) + if err := m.ExecutionResponses[len(m.ExecutionResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccountAbstraction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAccountAbstraction(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAccountAbstraction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAccountAbstraction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAccountAbstraction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAccountAbstraction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAccountAbstraction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAccountAbstraction = fmt.Errorf("proto: unexpected end of group") +) From 16deb5bc41e4015817c033b8ffbcdaf45a155824 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Fri, 10 Nov 2023 12:58:42 +0100 Subject: [PATCH 04/19] tmp commit --- .../v1/interface.pulsar.go | 448 +++++++++++++----- .../accounts/v1/account_abstraction.pulsar.go | 110 ++++- .../account_abstraction/v1/interface.proto | 22 +- .../accounts/v1/account_abstraction.proto | 7 + testutil/testdata/query.pb.go | 7 +- testutil/testdata/testdata.pb.go | 7 +- testutil/testdata/testpb/query.pulsar.go | 7 +- testutil/testdata/testpb/query_grpc.pb.go | 1 - testutil/testdata/testpb/testdata.pulsar.go | 7 +- testutil/testdata/testpb/tx.pulsar.go | 9 +- testutil/testdata/testpb/tx_grpc.pb.go | 1 - .../testdata/testpb/unknonwnproto.pulsar.go | 13 +- testutil/testdata/tx.pb.go | 7 +- testutil/testdata/unknonwnproto.pb.go | 7 +- .../internal/implementation/api_builder.go | 9 + x/accounts/keeper.go | 33 +- x/accounts/keeper_account_abstraction.go | 123 +++++ x/accounts/msg_server.go | 17 +- ...tial_account.go => full_implementation.go} | 6 +- x/accounts/v1/account_abstraction.go | 32 ++ x/accounts/v1/account_abstraction.pb.go | 118 +++-- 21 files changed, 776 insertions(+), 215 deletions(-) create mode 100644 x/accounts/keeper_account_abstraction.go rename x/accounts/testing/account_abstraction/{partial_account.go => full_implementation.go} (89%) create mode 100644 x/accounts/v1/account_abstraction.go diff --git a/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go index 9b3c46e0a297..63eb59fc2514 100644 --- a/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go +++ b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go @@ -16,6 +16,7 @@ import ( var ( md_MsgAuthenticate protoreflect.MessageDescriptor + fd_MsgAuthenticate_bundler protoreflect.FieldDescriptor fd_MsgAuthenticate_user_operation protoreflect.FieldDescriptor fd_MsgAuthenticate_chain_id protoreflect.FieldDescriptor fd_MsgAuthenticate_account_number protoreflect.FieldDescriptor @@ -24,6 +25,7 @@ var ( func init() { file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() md_MsgAuthenticate = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgAuthenticate") + fd_MsgAuthenticate_bundler = md_MsgAuthenticate.Fields().ByName("bundler") fd_MsgAuthenticate_user_operation = md_MsgAuthenticate.Fields().ByName("user_operation") fd_MsgAuthenticate_chain_id = md_MsgAuthenticate.Fields().ByName("chain_id") fd_MsgAuthenticate_account_number = md_MsgAuthenticate.Fields().ByName("account_number") @@ -94,6 +96,12 @@ func (x *fastReflection_MsgAuthenticate) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bundler != "" { + value := protoreflect.ValueOfString(x.Bundler) + if !f(fd_MsgAuthenticate_bundler, value) { + return + } + } if x.UserOperation != nil { value := protoreflect.ValueOfMessage(x.UserOperation.ProtoReflect()) if !f(fd_MsgAuthenticate_user_operation, value) { @@ -127,6 +135,8 @@ func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescript // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + return x.Bundler != "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": return x.UserOperation != nil case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": @@ -149,6 +159,8 @@ func (x *fastReflection_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAuthenticate) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + x.Bundler = "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": x.UserOperation = nil case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": @@ -171,6 +183,9 @@ func (x *fastReflection_MsgAuthenticate) Clear(fd protoreflect.FieldDescriptor) // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + value := x.Bundler + return protoreflect.ValueOfString(value) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": value := x.UserOperation return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -200,6 +215,8 @@ func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescri // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAuthenticate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + x.Bundler = value.Interface().(string) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": x.UserOperation = value.Message().Interface().(*v1.UserOperation) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": @@ -231,6 +248,8 @@ func (x *fastReflection_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor x.UserOperation = new(v1.UserOperation) } return protoreflect.ValueOfMessage(x.UserOperation.ProtoReflect()) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + panic(fmt.Errorf("field bundler of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": panic(fmt.Errorf("field chain_id of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": @@ -248,6 +267,8 @@ func (x *fastReflection_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgAuthenticate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": + return protoreflect.ValueOfString("") case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": m := new(v1.UserOperation) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -324,6 +345,10 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Bundler) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.UserOperation != nil { l = options.Size(x.UserOperation) n += 1 + l + runtime.Sov(uint64(l)) @@ -367,14 +392,14 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { if x.AccountNumber != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } if len(x.ChainId) > 0 { i -= len(x.ChainId) copy(dAtA[i:], x.ChainId) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if x.UserOperation != nil { encoded, err := options.Marshal(x.UserOperation) @@ -388,6 +413,13 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- + dAtA[i] = 0x12 + } + if len(x.Bundler) > 0 { + i -= len(x.Bundler) + copy(dAtA[i:], x.Bundler) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bundler))) + i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -440,6 +472,38 @@ func (x *fastReflection_MsgAuthenticate) 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 Bundler", 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.Bundler = 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 UserOperation", wireType) } @@ -475,7 +539,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } @@ -507,7 +571,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { } x.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) } @@ -917,65 +981,67 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.List = (*_MsgPayBundler_1_list)(nil) +var _ protoreflect.List = (*_MsgPayBundler_2_list)(nil) -type _MsgPayBundler_1_list struct { +type _MsgPayBundler_2_list struct { list *[]*anypb.Any } -func (x *_MsgPayBundler_1_list) Len() int { +func (x *_MsgPayBundler_2_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgPayBundler_1_list) Get(i int) protoreflect.Value { +func (x *_MsgPayBundler_2_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_MsgPayBundler_1_list) Set(i int, value protoreflect.Value) { +func (x *_MsgPayBundler_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) (*x.list)[i] = concreteValue } -func (x *_MsgPayBundler_1_list) Append(value protoreflect.Value) { +func (x *_MsgPayBundler_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) *x.list = append(*x.list, concreteValue) } -func (x *_MsgPayBundler_1_list) AppendMutable() protoreflect.Value { +func (x *_MsgPayBundler_2_list) AppendMutable() protoreflect.Value { v := new(anypb.Any) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgPayBundler_1_list) Truncate(n int) { +func (x *_MsgPayBundler_2_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_MsgPayBundler_1_list) NewElement() protoreflect.Value { +func (x *_MsgPayBundler_2_list) NewElement() protoreflect.Value { v := new(anypb.Any) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgPayBundler_1_list) IsValid() bool { +func (x *_MsgPayBundler_2_list) IsValid() bool { return x.list != nil } var ( md_MsgPayBundler protoreflect.MessageDescriptor + fd_MsgPayBundler_bundler protoreflect.FieldDescriptor fd_MsgPayBundler_bundler_payment_messages protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() md_MsgPayBundler = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgPayBundler") + fd_MsgPayBundler_bundler = md_MsgPayBundler.Fields().ByName("bundler") fd_MsgPayBundler_bundler_payment_messages = md_MsgPayBundler.Fields().ByName("bundler_payment_messages") } @@ -1044,8 +1110,14 @@ func (x *fastReflection_MsgPayBundler) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgPayBundler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bundler != "" { + value := protoreflect.ValueOfString(x.Bundler) + if !f(fd_MsgPayBundler_bundler, value) { + return + } + } if len(x.BundlerPaymentMessages) != 0 { - value := protoreflect.ValueOfList(&_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages}) + value := protoreflect.ValueOfList(&_MsgPayBundler_2_list{list: &x.BundlerPaymentMessages}) if !f(fd_MsgPayBundler_bundler_payment_messages, value) { return } @@ -1065,6 +1137,8 @@ func (x *fastReflection_MsgPayBundler) Range(f func(protoreflect.FieldDescriptor // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgPayBundler) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + return x.Bundler != "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": return len(x.BundlerPaymentMessages) != 0 default: @@ -1083,6 +1157,8 @@ func (x *fastReflection_MsgPayBundler) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgPayBundler) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + x.Bundler = "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": x.BundlerPaymentMessages = nil default: @@ -1101,11 +1177,14 @@ func (x *fastReflection_MsgPayBundler) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgPayBundler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + value := x.Bundler + return protoreflect.ValueOfString(value) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": if len(x.BundlerPaymentMessages) == 0 { - return protoreflect.ValueOfList(&_MsgPayBundler_1_list{}) + return protoreflect.ValueOfList(&_MsgPayBundler_2_list{}) } - listValue := &_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages} + listValue := &_MsgPayBundler_2_list{list: &x.BundlerPaymentMessages} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -1127,9 +1206,11 @@ func (x *fastReflection_MsgPayBundler) Get(descriptor protoreflect.FieldDescript // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgPayBundler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + x.Bundler = value.Interface().(string) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": lv := value.List() - clv := lv.(*_MsgPayBundler_1_list) + clv := lv.(*_MsgPayBundler_2_list) x.BundlerPaymentMessages = *clv.list default: if fd.IsExtension() { @@ -1155,8 +1236,10 @@ func (x *fastReflection_MsgPayBundler) Mutable(fd protoreflect.FieldDescriptor) if x.BundlerPaymentMessages == nil { x.BundlerPaymentMessages = []*anypb.Any{} } - value := &_MsgPayBundler_1_list{list: &x.BundlerPaymentMessages} + value := &_MsgPayBundler_2_list{list: &x.BundlerPaymentMessages} return protoreflect.ValueOfList(value) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + panic(fmt.Errorf("field bundler of message cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) @@ -1170,9 +1253,11 @@ func (x *fastReflection_MsgPayBundler) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgPayBundler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler": + return protoreflect.ValueOfString("") case "cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler.bundler_payment_messages": list := []*anypb.Any{} - return protoreflect.ValueOfList(&_MsgPayBundler_1_list{list: &list}) + return protoreflect.ValueOfList(&_MsgPayBundler_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgPayBundler")) @@ -1242,6 +1327,10 @@ func (x *fastReflection_MsgPayBundler) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Bundler) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if len(x.BundlerPaymentMessages) > 0 { for _, e := range x.BundlerPaymentMessages { l = options.Size(e) @@ -1290,9 +1379,16 @@ func (x *fastReflection_MsgPayBundler) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(x.Bundler) > 0 { + i -= len(x.Bundler) + copy(dAtA[i:], x.Bundler) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bundler))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1343,6 +1439,38 @@ func (x *fastReflection_MsgPayBundler) 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 Bundler", 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.Bundler = 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 BundlerPaymentMessages", wireType) } @@ -1905,65 +2033,67 @@ func (x *fastReflection_MsgPayBundlerResponse) ProtoMethods() *protoiface.Method } } -var _ protoreflect.List = (*_MsgExecute_1_list)(nil) +var _ protoreflect.List = (*_MsgExecute_2_list)(nil) -type _MsgExecute_1_list struct { +type _MsgExecute_2_list struct { list *[]*anypb.Any } -func (x *_MsgExecute_1_list) Len() int { +func (x *_MsgExecute_2_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgExecute_1_list) Get(i int) protoreflect.Value { +func (x *_MsgExecute_2_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_MsgExecute_1_list) Set(i int, value protoreflect.Value) { +func (x *_MsgExecute_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) (*x.list)[i] = concreteValue } -func (x *_MsgExecute_1_list) Append(value protoreflect.Value) { +func (x *_MsgExecute_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) *x.list = append(*x.list, concreteValue) } -func (x *_MsgExecute_1_list) AppendMutable() protoreflect.Value { +func (x *_MsgExecute_2_list) AppendMutable() protoreflect.Value { v := new(anypb.Any) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgExecute_1_list) Truncate(n int) { +func (x *_MsgExecute_2_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_MsgExecute_1_list) NewElement() protoreflect.Value { +func (x *_MsgExecute_2_list) NewElement() protoreflect.Value { v := new(anypb.Any) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgExecute_1_list) IsValid() bool { +func (x *_MsgExecute_2_list) IsValid() bool { return x.list != nil } var ( md_MsgExecute protoreflect.MessageDescriptor + fd_MsgExecute_bundler protoreflect.FieldDescriptor fd_MsgExecute_execution_messages protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_init() md_MsgExecute = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgExecute") + fd_MsgExecute_bundler = md_MsgExecute.Fields().ByName("bundler") fd_MsgExecute_execution_messages = md_MsgExecute.Fields().ByName("execution_messages") } @@ -2032,8 +2162,14 @@ func (x *fastReflection_MsgExecute) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgExecute) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bundler != "" { + value := protoreflect.ValueOfString(x.Bundler) + if !f(fd_MsgExecute_bundler, value) { + return + } + } if len(x.ExecutionMessages) != 0 { - value := protoreflect.ValueOfList(&_MsgExecute_1_list{list: &x.ExecutionMessages}) + value := protoreflect.ValueOfList(&_MsgExecute_2_list{list: &x.ExecutionMessages}) if !f(fd_MsgExecute_execution_messages, value) { return } @@ -2053,6 +2189,8 @@ func (x *fastReflection_MsgExecute) Range(f func(protoreflect.FieldDescriptor, p // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgExecute) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + return x.Bundler != "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": return len(x.ExecutionMessages) != 0 default: @@ -2071,6 +2209,8 @@ func (x *fastReflection_MsgExecute) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgExecute) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + x.Bundler = "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": x.ExecutionMessages = nil default: @@ -2089,11 +2229,14 @@ func (x *fastReflection_MsgExecute) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgExecute) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + value := x.Bundler + return protoreflect.ValueOfString(value) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": if len(x.ExecutionMessages) == 0 { - return protoreflect.ValueOfList(&_MsgExecute_1_list{}) + return protoreflect.ValueOfList(&_MsgExecute_2_list{}) } - listValue := &_MsgExecute_1_list{list: &x.ExecutionMessages} + listValue := &_MsgExecute_2_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -2115,9 +2258,11 @@ func (x *fastReflection_MsgExecute) Get(descriptor protoreflect.FieldDescriptor) // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgExecute) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + x.Bundler = value.Interface().(string) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": lv := value.List() - clv := lv.(*_MsgExecute_1_list) + clv := lv.(*_MsgExecute_2_list) x.ExecutionMessages = *clv.list default: if fd.IsExtension() { @@ -2143,8 +2288,10 @@ func (x *fastReflection_MsgExecute) Mutable(fd protoreflect.FieldDescriptor) pro if x.ExecutionMessages == nil { x.ExecutionMessages = []*anypb.Any{} } - value := &_MsgExecute_1_list{list: &x.ExecutionMessages} + value := &_MsgExecute_2_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(value) + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + panic(fmt.Errorf("field bundler of message cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) @@ -2158,9 +2305,11 @@ func (x *fastReflection_MsgExecute) Mutable(fd protoreflect.FieldDescriptor) pro // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgExecute) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.bundler": + return protoreflect.ValueOfString("") case "cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute.execution_messages": list := []*anypb.Any{} - return protoreflect.ValueOfList(&_MsgExecute_1_list{list: &list}) + return protoreflect.ValueOfList(&_MsgExecute_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgExecute")) @@ -2230,6 +2379,10 @@ func (x *fastReflection_MsgExecute) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Bundler) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if len(x.ExecutionMessages) > 0 { for _, e := range x.ExecutionMessages { l = options.Size(e) @@ -2278,9 +2431,16 @@ func (x *fastReflection_MsgExecute) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(x.Bundler) > 0 { + i -= len(x.Bundler) + copy(dAtA[i:], x.Bundler) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bundler))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -2331,6 +2491,38 @@ func (x *fastReflection_MsgExecute) 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 Bundler", 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.Bundler = 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 ExecutionMessages", wireType) } @@ -3749,13 +3941,17 @@ type MsgAuthenticate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // bundler defines the address of the bundler that sent the operation. + // NOTE: in case the operation was sent directly by the user, this field will reflect + // the user address. + Bundler string `protobuf:"bytes,1,opt,name=bundler,proto3" json:"bundler,omitempty"` // user_operation is the operation that the user is trying to perform. // it also contains authentication information. - UserOperation *v1.UserOperation `protobuf:"bytes,1,opt,name=user_operation,json=userOperation,proto3" json:"user_operation,omitempty"` + UserOperation *v1.UserOperation `protobuf:"bytes,2,opt,name=user_operation,json=userOperation,proto3" json:"user_operation,omitempty"` // chain_id defines the network identifier. - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // account_number is the account number of the user_operation. - AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` + AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` } func (x *MsgAuthenticate) Reset() { @@ -3778,6 +3974,13 @@ func (*MsgAuthenticate) Descriptor() ([]byte, []int) { return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{0} } +func (x *MsgAuthenticate) GetBundler() string { + if x != nil { + return x.Bundler + } + return "" +} + func (x *MsgAuthenticate) GetUserOperation() *v1.UserOperation { if x != nil { return x.UserOperation @@ -3837,9 +4040,13 @@ type MsgPayBundler struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // bundler is the address of the bundler. + // NOTE: in case the operation was sent directly by the user, this field will + // reflect the user address. + Bundler string `protobuf:"bytes,1,opt,name=bundler,proto3" json:"bundler,omitempty"` // bundler_payment_messages are the messages that the operation sender will execute. // The account can modify the messages as it sees fit. - BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,1,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` + BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,2,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` } func (x *MsgPayBundler) Reset() { @@ -3862,6 +4069,13 @@ func (*MsgPayBundler) Descriptor() ([]byte, []int) { return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{2} } +func (x *MsgPayBundler) GetBundler() string { + if x != nil { + return x.Bundler + } + return "" +} + func (x *MsgPayBundler) GetBundlerPaymentMessages() []*anypb.Any { if x != nil { return x.BundlerPaymentMessages @@ -3916,9 +4130,13 @@ type MsgExecute struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // bundler is the address of the bundler. + // NOTE: in case the operation was sent directly by the user, this field will + // reflect the user address. + Bundler string `protobuf:"bytes,1,opt,name=bundler,proto3" json:"bundler,omitempty"` // execution_messages are the messages that the operation sender will execute. // The account can modify the messages as it sees fit. - ExecutionMessages []*anypb.Any `protobuf:"bytes,1,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` + ExecutionMessages []*anypb.Any `protobuf:"bytes,2,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` } func (x *MsgExecute) Reset() { @@ -3941,6 +4159,13 @@ func (*MsgExecute) Descriptor() ([]byte, []int) { return file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDescGZIP(), []int{4} } +func (x *MsgExecute) GetBundler() string { + if x != nil { + return x.Bundler + } + return "" +} + func (x *MsgExecute) GetExecutionMessages() []*anypb.Any { if x != nil { return x.ExecutionMessages @@ -4065,76 +4290,81 @@ var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDe 0x6f, 0x1a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x9d, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, - 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, - 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, - 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x0d, 0x4d, 0x73, - 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x18, 0x62, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x78, 0x0a, 0x15, 0x4d, - 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x21, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x1e, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, - 0x0a, 0x1b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0xb7, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x48, 0x0a, + 0x0e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, + 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, + 0x78, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x21, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x73, 0x22, 0x5b, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1e, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, 0x0a, 0x4d, 0x73, 0x67, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x1b, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, - 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x42, - 0x86, 0x03, 0x0a, 0x35, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, - 0x65, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x66, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 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, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x49, 0x41, 0xaa, 0x02, 0x30, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x30, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x3c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, + 0x22, 0x5b, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x42, 0x86, 0x03, + 0x0a, 0x35, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 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, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, + 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x49, 0x41, 0xaa, 0x02, 0x30, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x30, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x3c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x34, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x3a, 0x3a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x34, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, - 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/accounts/v1/account_abstraction.pulsar.go b/api/cosmos/accounts/v1/account_abstraction.pulsar.go index f805e13d32bf..b76ceccfea50 100644 --- a/api/cosmos/accounts/v1/account_abstraction.pulsar.go +++ b/api/cosmos/accounts/v1/account_abstraction.pulsar.go @@ -1140,6 +1140,7 @@ var ( fd_UserOperationResponse_bundler_payment_responses protoreflect.FieldDescriptor fd_UserOperationResponse_execution_gas_used protoreflect.FieldDescriptor fd_UserOperationResponse_execution_responses protoreflect.FieldDescriptor + fd_UserOperationResponse_error protoreflect.FieldDescriptor ) func init() { @@ -1150,6 +1151,7 @@ func init() { fd_UserOperationResponse_bundler_payment_responses = md_UserOperationResponse.Fields().ByName("bundler_payment_responses") fd_UserOperationResponse_execution_gas_used = md_UserOperationResponse.Fields().ByName("execution_gas_used") fd_UserOperationResponse_execution_responses = md_UserOperationResponse.Fields().ByName("execution_responses") + fd_UserOperationResponse_error = md_UserOperationResponse.Fields().ByName("error") } var _ protoreflect.Message = (*fastReflection_UserOperationResponse)(nil) @@ -1247,6 +1249,12 @@ func (x *fastReflection_UserOperationResponse) Range(f func(protoreflect.FieldDe return } } + if x.Error != "" { + value := protoreflect.ValueOfString(x.Error) + if !f(fd_UserOperationResponse_error, value) { + return + } + } } // Has reports whether a field is populated. @@ -1272,6 +1280,8 @@ func (x *fastReflection_UserOperationResponse) Has(fd protoreflect.FieldDescript return x.ExecutionGasUsed != uint64(0) case "cosmos.accounts.v1.UserOperationResponse.execution_responses": return len(x.ExecutionResponses) != 0 + case "cosmos.accounts.v1.UserOperationResponse.error": + return x.Error != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1298,6 +1308,8 @@ func (x *fastReflection_UserOperationResponse) Clear(fd protoreflect.FieldDescri x.ExecutionGasUsed = uint64(0) case "cosmos.accounts.v1.UserOperationResponse.execution_responses": x.ExecutionResponses = nil + case "cosmos.accounts.v1.UserOperationResponse.error": + x.Error = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1335,6 +1347,9 @@ func (x *fastReflection_UserOperationResponse) Get(descriptor protoreflect.Field } listValue := &_UserOperationResponse_5_list{list: &x.ExecutionResponses} return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.v1.UserOperationResponse.error": + value := x.Error + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1369,6 +1384,8 @@ func (x *fastReflection_UserOperationResponse) Set(fd protoreflect.FieldDescript lv := value.List() clv := lv.(*_UserOperationResponse_5_list) x.ExecutionResponses = *clv.list + case "cosmos.accounts.v1.UserOperationResponse.error": + x.Error = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1407,6 +1424,8 @@ func (x *fastReflection_UserOperationResponse) Mutable(fd protoreflect.FieldDesc panic(fmt.Errorf("field bundler_payment_gas_used of message cosmos.accounts.v1.UserOperationResponse is not mutable")) case "cosmos.accounts.v1.UserOperationResponse.execution_gas_used": panic(fmt.Errorf("field execution_gas_used of message cosmos.accounts.v1.UserOperationResponse is not mutable")) + case "cosmos.accounts.v1.UserOperationResponse.error": + panic(fmt.Errorf("field error of message cosmos.accounts.v1.UserOperationResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1432,6 +1451,8 @@ func (x *fastReflection_UserOperationResponse) NewField(fd protoreflect.FieldDes case "cosmos.accounts.v1.UserOperationResponse.execution_responses": list := []*anypb.Any{} return protoreflect.ValueOfList(&_UserOperationResponse_5_list{list: &list}) + case "cosmos.accounts.v1.UserOperationResponse.error": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperationResponse")) @@ -1522,6 +1543,10 @@ func (x *fastReflection_UserOperationResponse) ProtoMethods() *protoiface.Method n += 1 + l + runtime.Sov(uint64(l)) } } + l = len(x.Error) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1551,6 +1576,13 @@ func (x *fastReflection_UserOperationResponse) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Error) > 0 { + i -= len(x.Error) + copy(dAtA[i:], x.Error) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) + i-- + dAtA[i] = 0x32 + } if len(x.ExecutionResponses) > 0 { for iNdEx := len(x.ExecutionResponses) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.ExecutionResponses[iNdEx]) @@ -1772,6 +1804,38 @@ func (x *fastReflection_UserOperationResponse) ProtoMethods() *protoiface.Method return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Error", 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.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1949,6 +2013,7 @@ func (x *UserOperation) GetExecutionGasLimit() uint64 { } // UserOperationResponse defines the response of a UserOperation. +// If the operation fails the error field will be populated. type UserOperationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1965,6 +2030,12 @@ type UserOperationResponse struct { ExecutionGasUsed uint64 `protobuf:"varint,4,opt,name=execution_gas_used,json=executionGasUsed,proto3" json:"execution_gas_used,omitempty"` // execution_responses defines the responses of the execution messages. ExecutionResponses []*anypb.Any `protobuf:"bytes,5,rep,name=execution_responses,json=executionResponses,proto3" json:"execution_responses,omitempty"` + // error defines the error that occurred during the execution of the UserOperation. + // If the error is not empty, the UserOperation failed. + // Other fields might be populated even if the error is not empty, for example + // if the operation fails after the authentication step, the authentication_gas_used + // field will be populated. + Error string `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"` } func (x *UserOperationResponse) Reset() { @@ -2022,6 +2093,13 @@ func (x *UserOperationResponse) GetExecutionResponses() []*anypb.Any { return nil } +func (x *UserOperationResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + var File_cosmos_accounts_v1_account_abstraction_proto protoreflect.FileDescriptor var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ @@ -2061,7 +2139,7 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x22, 0xcf, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x74, 0x22, 0xe5, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, @@ -2082,20 +2160,22 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 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, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0xcb, 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, 0x17, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 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, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0xcb, 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, 0x17, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 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 ( diff --git a/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto index 0f09e60c688b..cd94ba338a7f 100644 --- a/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto +++ b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto @@ -8,13 +8,17 @@ import "cosmos/accounts/v1/account_abstraction.proto"; // MsgAuthenticate is a message that an x/account account abstraction implementer // must handle to authenticate a state transition. message MsgAuthenticate { + // bundler defines the address of the bundler that sent the operation. + // NOTE: in case the operation was sent directly by the user, this field will reflect + // the user address. + string bundler = 1; // user_operation is the operation that the user is trying to perform. // it also contains authentication information. - cosmos.accounts.v1.UserOperation user_operation = 1; + cosmos.accounts.v1.UserOperation user_operation = 2; // chain_id defines the network identifier. - string chain_id = 2; + string chain_id = 3; // account_number is the account number of the user_operation. - uint64 account_number = 3; + uint64 account_number = 4; } // MsgAuthenticateResponse is the response to MsgAuthenticate. @@ -27,9 +31,13 @@ message MsgAuthenticateResponse {} // the bundler payment messages. // The account must ensure the caller of this message is the x/accounts module itself. message MsgPayBundler { + // bundler is the address of the bundler. + // NOTE: in case the operation was sent directly by the user, this field will + // reflect the user address. + string bundler = 1; // bundler_payment_messages are the messages that the operation sender will execute. // The account can modify the messages as it sees fit. - repeated google.protobuf.Any bundler_payment_messages = 1; + repeated google.protobuf.Any bundler_payment_messages = 2; } // MsgPayBundlerResponse is the response to MsgPayBundler. @@ -44,9 +52,13 @@ message MsgPayBundlerResponse { // block certain messages, or modify them. // The account must ensure the caller of this message is the x/accounts module itself. message MsgExecute { + // bundler is the address of the bundler. + // NOTE: in case the operation was sent directly by the user, this field will + // reflect the user address. + string bundler = 1; // execution_messages are the messages that the operation sender will execute. // The account can modify the messages as it sees fit. - repeated google.protobuf.Any execution_messages = 1; + repeated google.protobuf.Any execution_messages = 2; } // MsgExecuteResponse is the response to MsgExecute. diff --git a/proto/cosmos/accounts/v1/account_abstraction.proto b/proto/cosmos/accounts/v1/account_abstraction.proto index a77eda5cea97..04bbed0fafcb 100644 --- a/proto/cosmos/accounts/v1/account_abstraction.proto +++ b/proto/cosmos/accounts/v1/account_abstraction.proto @@ -48,6 +48,7 @@ message UserOperation { } // UserOperationResponse defines the response of a UserOperation. +// If the operation fails the error field will be populated. message UserOperationResponse { // authentication_gas_used defines the gas used for the authentication part of the UserOperation. uint64 authentication_gas_used = 1; @@ -60,4 +61,10 @@ message UserOperationResponse { uint64 execution_gas_used = 4; // execution_responses defines the responses of the execution messages. repeated google.protobuf.Any execution_responses = 5; + // error defines the error that occurred during the execution of the UserOperation. + // If the error is not empty, the UserOperation failed. + // Other fields might be populated even if the error is not empty, for example + // if the operation fails after the authentication step, the authentication_gas_used + // field will be populated. + string error = 6; } \ No newline at end of file diff --git a/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go index 0bb946d1a9a6..d104840c5dce 100644 --- a/testutil/testdata/query.pb.go +++ b/testutil/testdata/query.pb.go @@ -6,16 +6,15 @@ package testdata import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/testdata.pb.go b/testutil/testdata/testdata.pb.go index 93017231c60c..3db89888b056 100644 --- a/testutil/testdata/testdata.pb.go +++ b/testutil/testdata/testdata.pb.go @@ -5,13 +5,12 @@ package testdata import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/testpb/query.pulsar.go b/testutil/testdata/testpb/query.pulsar.go index f4e9bad12663..9b2a04bab5cc 100644 --- a/testutil/testdata/testpb/query.pulsar.go +++ b/testutil/testdata/testpb/query.pulsar.go @@ -3,15 +3,14 @@ package testpb import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/query_grpc.pb.go b/testutil/testdata/testpb/query_grpc.pb.go index e01aae23a5c3..565a93499d4b 100644 --- a/testutil/testdata/testpb/query_grpc.pb.go +++ b/testutil/testdata/testpb/query_grpc.pb.go @@ -8,7 +8,6 @@ package testpb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/testutil/testdata/testpb/testdata.pulsar.go b/testutil/testdata/testpb/testdata.pulsar.go index 00473c4fd0e8..8802ea9cd312 100644 --- a/testutil/testdata/testpb/testdata.pulsar.go +++ b/testutil/testdata/testpb/testdata.pulsar.go @@ -3,16 +3,15 @@ package testpb import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/tx.pulsar.go b/testutil/testdata/testpb/tx.pulsar.go index d1a26a980dc6..5e4213c4802a 100644 --- a/testutil/testdata/testpb/tx.pulsar.go +++ b/testutil/testdata/testpb/tx.pulsar.go @@ -2,18 +2,17 @@ package testpb import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/tx_grpc.pb.go b/testutil/testdata/testpb/tx_grpc.pb.go index 103111c993a2..3971c84d770a 100644 --- a/testutil/testdata/testpb/tx_grpc.pb.go +++ b/testutil/testdata/testpb/tx_grpc.pb.go @@ -8,7 +8,6 @@ package testpb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/testutil/testdata/testpb/unknonwnproto.pulsar.go b/testutil/testdata/testpb/unknonwnproto.pulsar.go index 5e5c214b36f5..84dbe6fbdb53 100644 --- a/testutil/testdata/testpb/unknonwnproto.pulsar.go +++ b/testutil/testdata/testpb/unknonwnproto.pulsar.go @@ -2,21 +2,20 @@ package testpb import ( + v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" binary "encoding/binary" fmt "fmt" - io "io" - math "math" - reflect "reflect" - sort "sort" - sync "sync" - - v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + math "math" + reflect "reflect" + sort "sort" + sync "sync" ) var ( diff --git a/testutil/testdata/tx.pb.go b/testutil/testdata/tx.pb.go index 70ed5f9952b7..e2d416faa41e 100644 --- a/testutil/testdata/tx.pb.go +++ b/testutil/testdata/tx.pb.go @@ -6,10 +6,6 @@ package testdata import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index 69d4059c44ef..3522a7253598 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -6,14 +6,13 @@ package testdata import ( encoding_binary "encoding/binary" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/accounts/internal/implementation/api_builder.go b/x/accounts/internal/implementation/api_builder.go index 10fb653bb395..2828a50c6676 100644 --- a/x/accounts/internal/implementation/api_builder.go +++ b/x/accounts/internal/implementation/api_builder.go @@ -152,3 +152,12 @@ type QueryBuilder struct { func (r *QueryBuilder) makeHandler() (func(ctx context.Context, queryRequest any) (queryResponse any, err error), error) { return r.er.makeHandler() } + +// IsRoutingError returns true if the error is a routing error. +// which means that it was impossible to route the message to a handler. +func IsRoutingError(err error) bool { + if err == nil { + return false + } + return errors.Is(err, errInvalidMessage) +} diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 0b4c61d8f1e6..18500e4d2c08 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -27,6 +27,8 @@ var ( AccountTypeKeyPrefix = collections.NewPrefix(0) // AccountNumberKey is the key for the account number. AccountNumberKey = collections.NewPrefix(1) + // AccountByNumber is the key for the accounts by number. + AccountByNumber = collections.NewPrefix(2) ) // QueryRouter represents a router which can be used to route queries to the correct module. @@ -90,9 +92,11 @@ func NewKeeper( } return handlers[0](ctx, req, resp) }, - AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), - AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), - AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), + Schema: collections.Schema{}, + AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), + AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), + AccountByNumber: collections.NewMap(sb, AccountByNumber, "account_by_number", collections.BytesKey, collections.Uint64Value), + AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), } schema, err := sb.Build() @@ -124,6 +128,8 @@ type Keeper struct { AccountNumber collections.Sequence // AccountsByType maps account address to their implementation. AccountsByType collections.Map[[]byte, string] + // AccountByNumber maps account number to their address. + AccountByNumber collections.Map[[]byte, uint64] // AccountsState keeps track of the state of each account. // NOTE: this is only used for genesis import and export. @@ -144,8 +150,14 @@ func (k Keeper) Init( return nil, nil, err } + // get the next account number + num, err := k.AccountNumber.Next(ctx) + if err != nil { + return nil, nil, err + } + // make a new account address - accountAddr, err := k.makeAddress(ctx) + accountAddr, err := k.makeAddress(num) if err != nil { return nil, nil, err } @@ -161,6 +173,10 @@ func (k Keeper) Init( if err := k.AccountsByType.Set(ctx, accountAddr, accountType); err != nil { return nil, nil, err } + // map account number to account address + if err := k.AccountByNumber.Set(ctx, accountAddr, num); err != nil { + return nil, nil, err + } return resp, accountAddr, nil } @@ -225,14 +241,9 @@ func (k Keeper) getImplementation(accountType string) (implementation.Implementa return impl, nil } -func (k Keeper) makeAddress(ctx context.Context) ([]byte, error) { - num, err := k.AccountNumber.Next(ctx) - if err != nil { - return nil, err - } - +func (k Keeper) makeAddress(accNum uint64) ([]byte, error) { // TODO: better address scheme, ref: https://github.com/cosmos/cosmos-sdk/issues/17516 - addr := sha256.Sum256(append([]byte("x/accounts"), binary.BigEndian.AppendUint64(nil, num)...)) + addr := sha256.Sum256(append([]byte("x/accounts"), binary.BigEndian.AppendUint64(nil, accNum)...)) return addr[:], nil } diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go new file mode 100644 index 000000000000..d9a060815f97 --- /dev/null +++ b/x/accounts/keeper_account_abstraction.go @@ -0,0 +1,123 @@ +package accounts + +import ( + "context" + "fmt" + + account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" + "cosmossdk.io/x/accounts/internal/implementation" + v1 "cosmossdk.io/x/accounts/v1" + "google.golang.org/protobuf/types/known/anypb" +) + +// ExecuteUserOperation handles the execution of an abstracted account UserOperation. +func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *v1.UserOperation) *v1.UserOperationResponse { + authGas, err := k.Authenticate(ctx, bundler, op) + if err != nil { + return &v1.UserOperationResponse{ + Error: fmt.Sprintf("authentication failed: %s", err.Error()), + } + } + resp := &v1.UserOperationResponse{ + AuthenticationGasUsed: authGas, + } + // pay bundler + bundlerPayGas, bundlerPayResp, err := k.PayBundler(ctx, bundler, op) + if err != nil { + resp.Error = fmt.Sprintf("bundler payment failed: %s", err.Error()) + return resp + } + resp.BundlerPaymentGasUsed = bundlerPayGas + resp.BundlerPaymentResponses = bundlerPayResp + + // execute messages, the real operation intent + +} + +// Authenticate handles the authentication flow of an abstracted account. +// Authentication happens in an isolated context with the authentication gas limit. +// If the authentication is successful, then the state is committed. +func (k Keeper) Authenticate( + ctx context.Context, + bundler string, + op *v1.UserOperation, +) (gasUsed uint64, err error) { + opV2 := v1.GogoUserOpToProtoV2(op) + senderAddr, err := k.addressCodec.StringToBytes(op.Sender) + if err != nil { + return 0, err + } + accountNumber, err := k.AccountByNumber.Get(ctx, senderAddr) + // create an isolated context in which we execute authentication + // without affecting the parent context and with the authentication gas limit. + // TODO: add branch with gas limit + _, err = k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgAuthenticate{ + Bundler: bundler, + UserOperation: opV2, + ChainId: "chain-id", // TODO how to get chain id? + AccountNumber: accountNumber, + }) + return gasUsed, nil +} + +// PayBundler handles the payment of the bundler in a given v1.UserOperation. +// Must be called after Authenticate. +// It gets executed in an isolated context with the bundler payment gas limit. +// If the payment is successful, then the state is committed. +// Since for an abstracted account the bundler payment method is optional, +// if the account does not handle bundler payment messages, then this method +// will simply execute the provided messages on behalf of the sender and return. +func (k Keeper) PayBundler(ctx context.Context, bundler string, op *v1.UserOperation) (gasUsed uint64, paymentResponses []*anypb.Any, err error) { + senderAddr, err := k.addressCodec.StringToBytes(op.Sender) + if err != nil { + return 0, nil, err + } + resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgPayBundler{ + Bundler: bundler, + BundlerPaymentMessages: op.BundlerPaymentMessages, + }) + // here is where we check if the account handles bundler payment messages + // if it does not, then we simply execute the provided messages on behalf of the sender + switch { + case err == nil: + // TODO: get gas used + payBundlerResp, err := parsePayBundlerResponse(resp) + return gasUsed, payBundlerResp, err + // if we get a routing message error it means the account does not handle bundler payment messages, + // in this case we attempt to execute the provided messages on behalf of the op sender. + case implementation.IsRoutingError(err): + // TODO: get gas used + payBundlerResp, err := k.payBundlerFallback(ctx, op) + return gasUsed, payBundlerResp, err + // some other execution error. + default: + // TODO: get gas used + return gasUsed, nil, err + } +} + +// payBundlerFallback attempts to execute the provided messages on behalf of the op sender. +// it checks that the op sender does not try to impersonate other accounts. +func (k Keeper) payBundlerFallback(ctx context.Context, op *v1.UserOperation) ([]*anypb.Any, error) { + return nil, fmt.Errorf("not implemented") +} + +func (k Keeper) untypedExecute(ctx context.Context, anyMsg *anypb.Any) (*anypb.Any, error) { + msg, err := anyMsg.UnmarshalNew() + if err != nil { + return nil, err + } + // we now need to fetch the response type from the request message type. + // this is because the response type is not known. +} + +// parsePayBundlerResponse parses the bundler response as any into a slice of +// responses on payment messages. +func parsePayBundlerResponse(resp any) ([]*anypb.Any, error) { + payBundlerResp, ok := resp.(*account_abstractionv1.MsgPayBundlerResponse) + // this means the account does not properly implement account abstraction. + if !ok { + return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got %T", &account_abstractionv1.MsgPayBundlerResponse{}, resp) + } + return payBundlerResp.BundlerPaymentMessagesResponse, nil +} diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 5b5408790406..1bfb470d6510 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -3,13 +3,12 @@ package accounts import ( "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "cosmossdk.io/core/event" v1 "cosmossdk.io/x/accounts/v1" ) +var ModuleAccountAddr = []byte{0x01} + var _ v1.MsgServer = msgServer{} func NewMsgServer(k Keeper) v1.MsgServer { @@ -121,5 +120,15 @@ func (m msgServer) Execute(ctx context.Context, execute *v1.MsgExecute) (*v1.Msg } func (m msgServer) ExecuteBundle(ctx context.Context, req *v1.MsgExecuteBundle) (*v1.MsgExecuteBundleResponse, error) { - return nil, status.New(codes.Unimplemented, "not implemented").Err() + // validate bundler addr + _, err := m.k.addressCodec.StringToBytes(req.Bundler) + if err != nil { + return nil, err + } + // execute operations + responses := make([]*v1.UserOperationResponse, len(req.Operations)) + for i, op := range req.Operations { + responses[i] = m.k.ExecuteUserOperation(ctx, req.Bundler, op) + } + return &v1.MsgExecuteBundleResponse{Responses: responses}, nil } diff --git a/x/accounts/testing/account_abstraction/partial_account.go b/x/accounts/testing/account_abstraction/full_implementation.go similarity index 89% rename from x/accounts/testing/account_abstraction/partial_account.go rename to x/accounts/testing/account_abstraction/full_implementation.go index 43acef23e053..63d368eee097 100644 --- a/x/accounts/testing/account_abstraction/partial_account.go +++ b/x/accounts/testing/account_abstraction/full_implementation.go @@ -44,9 +44,9 @@ func (a PartialAccount) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRot return nil, fmt.Errorf("not implemented") } -// Authenticate authenticates the account. -func (a PartialAccount) Authenticate(ctx context.Context, msg *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { - return nil, fmt.Errorf("not implemented") +// Authenticate authenticates the account, auth always passess. +func (a PartialAccount) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { + return &account_abstractionv1.MsgAuthenticateResponse{}, nil } // QueryAuthenticateMethods queries the authentication methods of the account. diff --git a/x/accounts/v1/account_abstraction.go b/x/accounts/v1/account_abstraction.go new file mode 100644 index 000000000000..c89f40b71089 --- /dev/null +++ b/x/accounts/v1/account_abstraction.go @@ -0,0 +1,32 @@ +package v1 + +import ( + accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "google.golang.org/protobuf/types/known/anypb" +) + +func GogoUserOpToProtoV2(op *UserOperation) *accountsv1.UserOperation { + return &accountsv1.UserOperation{ + Sender: op.Sender, + AuthenticationMethod: op.AuthenticationMethod, + AuthenticationData: op.AuthenticationData, + Sequence: op.Sequence, + AuthenticationGasLimit: op.AuthenticationGasLimit, + BundlerPaymentMessages: intoProtoV2Any(op.BundlerPaymentMessages), + BundlerPaymentGasLimit: op.BundlerPaymentGasLimit, + ExecutionMessages: intoProtoV2Any(op.ExecutionMessages), + ExecutionGasLimit: op.ExecutionGasLimit, + } +} + +func intoProtoV2Any(msgs []*codectypes.Any) []*anypb.Any { + protoMsgs := make([]*anypb.Any, len(msgs)) + for i, msg := range msgs { + protoMsgs[i] = &anypb.Any{ + TypeUrl: msg.TypeUrl, + Value: msg.Value, + } + } + return protoMsgs +} diff --git a/x/accounts/v1/account_abstraction.pb.go b/x/accounts/v1/account_abstraction.pb.go index 76a7ccd2e140..b706f7a0e290 100644 --- a/x/accounts/v1/account_abstraction.pb.go +++ b/x/accounts/v1/account_abstraction.pb.go @@ -161,6 +161,7 @@ func (m *UserOperation) GetExecutionGasLimit() uint64 { } // UserOperationResponse defines the response of a UserOperation. +// If the operation fails the error field will be populated. type UserOperationResponse struct { // authentication_gas_used defines the gas used for the authentication part of the UserOperation. AuthenticationGasUsed uint64 `protobuf:"varint,1,opt,name=authentication_gas_used,json=authenticationGasUsed,proto3" json:"authentication_gas_used,omitempty"` @@ -173,6 +174,12 @@ type UserOperationResponse struct { ExecutionGasUsed uint64 `protobuf:"varint,4,opt,name=execution_gas_used,json=executionGasUsed,proto3" json:"execution_gas_used,omitempty"` // execution_responses defines the responses of the execution messages. ExecutionResponses []*types.Any `protobuf:"bytes,5,rep,name=execution_responses,json=executionResponses,proto3" json:"execution_responses,omitempty"` + // error defines the error that occurred during the execution of the UserOperation. + // If the error is not empty, the UserOperation failed. + // Other fields might be populated even if the error is not empty, for example + // if the operation fails after the authentication step, the authentication_gas_used + // field will be populated. + Error string `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"` } func (m *UserOperationResponse) Reset() { *m = UserOperationResponse{} } @@ -243,6 +250,13 @@ func (m *UserOperationResponse) GetExecutionResponses() []*types.Any { return nil } +func (m *UserOperationResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + func init() { proto.RegisterType((*UserOperation)(nil), "cosmos.accounts.v1.UserOperation") proto.RegisterType((*UserOperationResponse)(nil), "cosmos.accounts.v1.UserOperationResponse") @@ -253,36 +267,37 @@ func init() { } var fileDescriptor_9f9bcc910ad46d4b = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xe3, 0x24, 0x0d, 0xed, 0x00, 0x12, 0x4c, 0x9b, 0x74, 0x9a, 0x85, 0x15, 0x75, 0x95, - 0x45, 0x35, 0x56, 0x29, 0xe2, 0x67, 0xc9, 0x9f, 0xd8, 0x50, 0xa8, 0x2c, 0x75, 0xc3, 0xc6, 0x9a, - 0xd8, 0x97, 0xd4, 0x22, 0x9e, 0x09, 0xbe, 0xe3, 0xaa, 0x79, 0x0b, 0x1e, 0x8b, 0x1d, 0x5d, 0xb2, - 0x44, 0xc9, 0x8b, 0xa0, 0xcc, 0xf8, 0x27, 0x8e, 0x51, 0x76, 0x19, 0xdd, 0x73, 0xee, 0x39, 0xf9, - 0xc6, 0x43, 0xce, 0x42, 0x85, 0x89, 0x42, 0x4f, 0x84, 0xa1, 0xca, 0xa4, 0x46, 0xef, 0xf6, 0xbc, - 0xf8, 0x1d, 0x88, 0x09, 0xea, 0x54, 0x84, 0x3a, 0x56, 0x92, 0xcf, 0x53, 0xa5, 0x15, 0xa5, 0x56, - 0xcd, 0x0b, 0x35, 0xbf, 0x3d, 0x1f, 0x9e, 0x4c, 0x95, 0x9a, 0xce, 0xc0, 0x33, 0x8a, 0x49, 0xf6, - 0xcd, 0x13, 0x72, 0x61, 0xe5, 0xa7, 0xab, 0x0e, 0x79, 0x7c, 0x8d, 0x90, 0x7e, 0x99, 0x43, 0x2a, - 0xd6, 0x6b, 0xe8, 0x80, 0xf4, 0x10, 0x64, 0x04, 0x29, 0x73, 0x46, 0xce, 0xf8, 0xc0, 0xcf, 0x4f, - 0xf4, 0x82, 0xf4, 0x45, 0xa6, 0x6f, 0x40, 0xea, 0x38, 0x34, 0xca, 0x20, 0x01, 0x7d, 0xa3, 0x22, - 0xd6, 0x36, 0xb2, 0xa3, 0xfa, 0xf0, 0xd2, 0xcc, 0xa8, 0x47, 0x0e, 0xb7, 0x4c, 0x91, 0xd0, 0x82, - 0x75, 0x46, 0xce, 0xf8, 0x91, 0x4f, 0xeb, 0xa3, 0xf7, 0x42, 0x0b, 0x3a, 0x24, 0xfb, 0x08, 0x3f, - 0x32, 0x90, 0x21, 0xb0, 0xee, 0xc8, 0x19, 0x77, 0xfd, 0xf2, 0x4c, 0x5f, 0x11, 0xb6, 0xb5, 0x6c, - 0x2a, 0x30, 0x98, 0xc5, 0x49, 0xac, 0xd9, 0x9e, 0xd1, 0x0e, 0xea, 0xf3, 0x8f, 0x02, 0x3f, 0xad, - 0xa7, 0xf4, 0x33, 0x61, 0x93, 0x4c, 0x46, 0x33, 0x48, 0x83, 0xb9, 0x58, 0x24, 0x20, 0x75, 0x90, - 0x00, 0xa2, 0x98, 0x02, 0xb2, 0xde, 0xa8, 0x33, 0x7e, 0xf8, 0xec, 0x88, 0x5b, 0x46, 0xbc, 0x60, - 0xc4, 0xdf, 0xc8, 0x85, 0x3f, 0xc8, 0x5d, 0x57, 0xd6, 0x74, 0x99, 0x7b, 0xe8, 0x6b, 0x72, 0xb2, - 0xbd, 0xaf, 0xaa, 0xf2, 0xc0, 0x56, 0xa9, 0x5b, 0xcb, 0x2a, 0xef, 0x08, 0x85, 0x3b, 0x08, 0xb3, - 0x9c, 0x60, 0x5e, 0x62, 0x7f, 0x47, 0x89, 0xa7, 0xa5, 0xbe, 0xcc, 0xe7, 0xe4, 0xb0, 0x5a, 0x52, - 0x25, 0x1f, 0x98, 0xe4, 0x4a, 0x5f, 0x84, 0x9e, 0xfe, 0x6e, 0x93, 0x7e, 0xed, 0x96, 0x7d, 0xc0, - 0xb9, 0x92, 0x08, 0xf4, 0x05, 0x39, 0xfe, 0x0f, 0xd3, 0x0c, 0x21, 0x32, 0xd7, 0xdf, 0xf5, 0xfb, - 0x0d, 0xa4, 0xd7, 0x08, 0x11, 0x7d, 0xd9, 0x24, 0x5a, 0x1a, 0xdb, 0xd6, 0xd8, 0x00, 0x60, 0x8c, - 0x57, 0x4d, 0x74, 0x69, 0x5e, 0x06, 0x59, 0x67, 0x07, 0x86, 0xe3, 0xfa, 0xbe, 0xe2, 0x1f, 0x20, - 0x3d, 0xdb, 0x24, 0x5a, 0x96, 0xb0, 0x1f, 0xcf, 0x93, 0x4d, 0x16, 0x26, 0xff, 0xc3, 0x26, 0xba, - 0x2a, 0x79, 0x6f, 0x47, 0x72, 0xb5, 0xbe, 0x0c, 0x7d, 0xfb, 0xfc, 0xd7, 0xd2, 0x75, 0xee, 0x97, - 0xae, 0xf3, 0x77, 0xe9, 0x3a, 0x3f, 0x57, 0x6e, 0xeb, 0x7e, 0xe5, 0xb6, 0xfe, 0xac, 0xdc, 0xd6, - 0xd7, 0xa1, 0x7d, 0x80, 0x18, 0x7d, 0xe7, 0xb1, 0xf2, 0xee, 0x36, 0x9f, 0xed, 0xa4, 0x67, 0xf6, - 0x5e, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xea, 0xb4, 0x8f, 0x4f, 0xd3, 0x03, 0x00, 0x00, + // 471 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x49, 0x6f, 0xd3, 0x40, + 0x14, 0x8e, 0xb3, 0xd1, 0x0e, 0x20, 0xc1, 0x34, 0x49, 0xa7, 0x39, 0x58, 0x51, 0x4f, 0x39, 0x54, + 0xb6, 0x4a, 0x11, 0xcb, 0x91, 0x4d, 0x5c, 0x28, 0x54, 0x96, 0x7a, 0xe1, 0x62, 0x4d, 0xec, 0x47, + 0x6a, 0x11, 0xcf, 0x84, 0x79, 0xe3, 0xaa, 0xf9, 0x17, 0xfc, 0x2c, 0x8e, 0x3d, 0x72, 0x44, 0x89, + 0xf8, 0x1f, 0x28, 0x33, 0x5e, 0xe2, 0x04, 0xe5, 0xe6, 0xa7, 0xf7, 0x6d, 0xfe, 0x66, 0x86, 0x9c, + 0x45, 0x12, 0x53, 0x89, 0x3e, 0x8f, 0x22, 0x99, 0x09, 0x8d, 0xfe, 0xed, 0x79, 0xf1, 0x1d, 0xf2, + 0x09, 0x6a, 0xc5, 0x23, 0x9d, 0x48, 0xe1, 0xcd, 0x95, 0xd4, 0x92, 0x52, 0x8b, 0xf6, 0x0a, 0xb4, + 0x77, 0x7b, 0x3e, 0x3c, 0x99, 0x4a, 0x39, 0x9d, 0x81, 0x6f, 0x10, 0x93, 0xec, 0x9b, 0xcf, 0xc5, + 0xc2, 0xc2, 0x4f, 0x57, 0x2d, 0xf2, 0xf8, 0x1a, 0x41, 0x7d, 0x99, 0x83, 0xe2, 0x6b, 0x19, 0x3a, + 0x20, 0x5d, 0x04, 0x11, 0x83, 0x62, 0xce, 0xc8, 0x19, 0x1f, 0x06, 0xf9, 0x44, 0x2f, 0x48, 0x9f, + 0x67, 0xfa, 0x06, 0x84, 0x4e, 0x22, 0x83, 0x0c, 0x53, 0xd0, 0x37, 0x32, 0x66, 0x4d, 0x03, 0xeb, + 0xd5, 0x97, 0x97, 0x66, 0x47, 0x7d, 0x72, 0xb4, 0x45, 0x8a, 0xb9, 0xe6, 0xac, 0x35, 0x72, 0xc6, + 0x8f, 0x02, 0x5a, 0x5f, 0xbd, 0xe7, 0x9a, 0xd3, 0x21, 0x39, 0x40, 0xf8, 0x91, 0x81, 0x88, 0x80, + 0xb5, 0x47, 0xce, 0xb8, 0x1d, 0x94, 0x33, 0x7d, 0x45, 0xd8, 0x96, 0xd8, 0x94, 0x63, 0x38, 0x4b, + 0xd2, 0x44, 0xb3, 0x8e, 0xc1, 0x0e, 0xea, 0xfb, 0x8f, 0x1c, 0x3f, 0xad, 0xb7, 0xf4, 0x33, 0x61, + 0x93, 0x4c, 0xc4, 0x33, 0x50, 0xe1, 0x9c, 0x2f, 0x52, 0x10, 0x3a, 0x4c, 0x01, 0x91, 0x4f, 0x01, + 0x59, 0x77, 0xd4, 0x1a, 0x3f, 0x7c, 0xd6, 0xf3, 0x6c, 0x47, 0x5e, 0xd1, 0x91, 0xf7, 0x46, 0x2c, + 0x82, 0x41, 0xce, 0xba, 0xb2, 0xa4, 0xcb, 0x9c, 0x43, 0x5f, 0x93, 0x93, 0x6d, 0xbd, 0x2a, 0xca, + 0x03, 0x1b, 0xa5, 0x4e, 0x2d, 0xa3, 0xbc, 0x23, 0x14, 0xee, 0x20, 0xca, 0xf2, 0x06, 0xf3, 0x10, + 0x07, 0x7b, 0x42, 0x3c, 0x2d, 0xf1, 0xa5, 0xbf, 0x47, 0x8e, 0x2a, 0x91, 0xca, 0xf9, 0xd0, 0x38, + 0x57, 0xf8, 0xc2, 0xf4, 0xf4, 0x6f, 0x93, 0xf4, 0x6b, 0xa7, 0x1c, 0x00, 0xce, 0xa5, 0x40, 0xa0, + 0x2f, 0xc8, 0xf1, 0x7f, 0x3a, 0xcd, 0x10, 0x62, 0x73, 0xfc, 0xed, 0xa0, 0xbf, 0x53, 0xe9, 0x35, + 0x42, 0x4c, 0x5f, 0xee, 0x36, 0x5a, 0x12, 0x9b, 0x96, 0xb8, 0x53, 0x80, 0x21, 0x5e, 0xed, 0x56, + 0xa7, 0xf2, 0x30, 0xc8, 0x5a, 0x7b, 0x6a, 0x38, 0xae, 0xeb, 0x15, 0x7f, 0x80, 0xf4, 0x6c, 0xb3, + 0xd1, 0x32, 0x84, 0xbd, 0x3c, 0x4f, 0x36, 0xbb, 0x30, 0xfe, 0x1f, 0x36, 0xab, 0xab, 0x9c, 0x3b, + 0x7b, 0x9c, 0x2b, 0xf9, 0xca, 0xb4, 0x47, 0x3a, 0xa0, 0x94, 0x54, 0xac, 0x6b, 0x6e, 0xbf, 0x1d, + 0xde, 0x3e, 0xff, 0xb5, 0x74, 0x9d, 0xfb, 0xa5, 0xeb, 0xfc, 0x59, 0xba, 0xce, 0xcf, 0x95, 0xdb, + 0xb8, 0x5f, 0xb9, 0x8d, 0xdf, 0x2b, 0xb7, 0xf1, 0x75, 0x68, 0x9f, 0x25, 0xc6, 0xdf, 0xbd, 0x44, + 0xfa, 0x77, 0x9b, 0x8f, 0x79, 0xd2, 0x35, 0x6e, 0x17, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x37, + 0x3f, 0x89, 0xed, 0xe9, 0x03, 0x00, 0x00, } func (m *UserOperation) Marshal() (dAtA []byte, err error) { @@ -397,6 +412,13 @@ func (m *UserOperationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x32 + } if len(m.ExecutionResponses) > 0 { for iNdEx := len(m.ExecutionResponses) - 1; iNdEx >= 0; iNdEx-- { { @@ -526,6 +548,10 @@ func (m *UserOperationResponse) Size() (n int) { n += 1 + l + sovAccountAbstraction(uint64(l)) } } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } return n } @@ -981,6 +1007,38 @@ func (m *UserOperationResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + 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 ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) From 77b959d6b7d187701d1ba1d1a758068e9b5eeeeb Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Fri, 10 Nov 2023 17:54:07 +0100 Subject: [PATCH 05/19] more stuff --- baseapp/internal/protocompat/protocompat.go | 13 ++++ baseapp/msg_service_router.go | 17 ++++- x/accounts/keeper.go | 25 +++--- x/accounts/keeper_account_abstraction.go | 85 ++++++++++++++++----- 4 files changed, 110 insertions(+), 30 deletions(-) diff --git a/baseapp/internal/protocompat/protocompat.go b/baseapp/internal/protocompat/protocompat.go index 18de9ac7a608..a60c145b74a6 100644 --- a/baseapp/internal/protocompat/protocompat.go +++ b/baseapp/internal/protocompat/protocompat.go @@ -221,3 +221,16 @@ func RequestFullNameFromMethodDesc(sd *grpc.ServiceDesc, method grpc.MethodDesc) } return methodDesc.Input().FullName(), nil } + +func ResponseFullNameFromMethodDesc(sd *grpc.ServiceDesc, method grpc.MethodDesc) (protoreflect.FullName, error) { + methodFullName := protoreflect.FullName(fmt.Sprintf("%s.%s", sd.ServiceName, method.MethodName)) + desc, err := gogoproto.HybridResolver.FindDescriptorByName(methodFullName) + if err != nil { + return "", fmt.Errorf("cannot find method descriptor %s", methodFullName) + } + methodDesc, ok := desc.(protoreflect.MethodDescriptor) + if !ok { + return "", fmt.Errorf("invalid method descriptor %s", methodFullName) + } + return methodDesc.Output().FullName(), nil +} diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index 506112490220..e27f938b053f 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -31,6 +31,7 @@ type MsgServiceRouter struct { interfaceRegistry codectypes.InterfaceRegistry routes map[string]MsgServiceHandler hybridHandlers map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error + responseByRequest map[string]string circuitBreaker CircuitBreaker } @@ -39,8 +40,10 @@ var _ gogogrpc.Server = &MsgServiceRouter{} // NewMsgServiceRouter creates a new MsgServiceRouter. func NewMsgServiceRouter() *MsgServiceRouter { return &MsgServiceRouter{ - routes: map[string]MsgServiceHandler{}, - hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, + routes: map[string]MsgServiceHandler{}, + hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, + responseByRequest: map[string]string{}, + circuitBreaker: nil, } } @@ -87,16 +90,26 @@ func (msr *MsgServiceRouter) HybridHandlerByMsgName(msgName string) func(ctx con return msr.hybridHandlers[msgName] } +func (msr *MsgServiceRouter) ResponseByRequestName(msgName string) string { + return msr.responseByRequest[msgName] +} + func (msr *MsgServiceRouter) registerHybridHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { inputName, err := protocompat.RequestFullNameFromMethodDesc(sd, method) if err != nil { return err } + outputName, err := protocompat.ResponseFullNameFromMethodDesc(sd, method) + if err != nil { + return err + } cdc := codec.NewProtoCodec(msr.interfaceRegistry) hybridHandler, err := protocompat.MakeHybridHandler(cdc, sd, method, handler) if err != nil { return err } + // map input name to output name + msr.responseByRequest[string(inputName)] = string(outputName) // if circuit breaker is not nil, then we decorate the hybrid handler with the circuit breaker if msr.circuitBreaker == nil { msr.hybridHandlers[string(inputName)] = hybridHandler diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 18500e4d2c08..caa17f340480 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -41,6 +41,7 @@ type QueryRouter interface { // MsgRouter represents a router which can be used to route messages to the correct module. type MsgRouter interface { HybridHandlerByMsgName(msgName string) func(ctx context.Context, req, resp protoiface.MessageV1) error + ResponseByRequestName(name string) string } // SignerProvider defines an interface used to get the expected sender from a message. @@ -92,11 +93,12 @@ func NewKeeper( } return handlers[0](ctx, req, resp) }, - Schema: collections.Schema{}, - AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), - AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), - AccountByNumber: collections.NewMap(sb, AccountByNumber, "account_by_number", collections.BytesKey, collections.Uint64Value), - AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), + msgResponseFromRequestName: execRouter.ResponseByRequestName, + Schema: collections.Schema{}, + AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), + AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), + AccountByNumber: collections.NewMap(sb, AccountByNumber, "account_by_number", collections.BytesKey, collections.Uint64Value), + AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), } schema, err := sb.Build() @@ -113,12 +115,13 @@ func NewKeeper( type Keeper struct { // deps coming from the runtime - storeService store.KVStoreService - eventService event.Service - addressCodec address.Codec - getSenderFunc func(msg proto.Message) ([]byte, error) - execModuleFunc implementation.ModuleExecFunc - queryModuleFunc implementation.ModuleQueryFunc + storeService store.KVStoreService + eventService event.Service + addressCodec address.Codec + getSenderFunc func(msg proto.Message) ([]byte, error) + execModuleFunc implementation.ModuleExecFunc + queryModuleFunc implementation.ModuleQueryFunc + msgResponseFromRequestName func(name string) string // msgResponseFromRequestName returns the response name for a given request name. accounts map[string]implementation.Implementation diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index d9a060815f97..39e7081d55d5 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -1,26 +1,31 @@ package accounts import ( + "bytes" "context" "fmt" account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" + accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" "cosmossdk.io/x/accounts/internal/implementation" - v1 "cosmossdk.io/x/accounts/v1" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/anypb" ) // ExecuteUserOperation handles the execution of an abstracted account UserOperation. -func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *v1.UserOperation) *v1.UserOperationResponse { +func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *accountsv1.UserOperation) *accountsv1.UserOperationResponse { + resp := &accountsv1.UserOperationResponse{} + + // authenticate authGas, err := k.Authenticate(ctx, bundler, op) if err != nil { - return &v1.UserOperationResponse{ - Error: fmt.Sprintf("authentication failed: %s", err.Error()), - } - } - resp := &v1.UserOperationResponse{ - AuthenticationGasUsed: authGas, + resp.Error = fmt.Sprintf("authentication failed: %s", err.Error()) + return resp } + resp.AuthenticationGasUsed = authGas + // pay bundler bundlerPayGas, bundlerPayResp, err := k.PayBundler(ctx, bundler, op) if err != nil { @@ -31,7 +36,16 @@ func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *v1 resp.BundlerPaymentResponses = bundlerPayResp // execute messages, the real operation intent + executeGas, executeResp, err := k.ExecuteMessages(ctx, bundler, op) + if err != nil { + resp.Error = fmt.Sprintf("execution failed: %s", err.Error()) + return resp + } + resp.ExecutionGasUsed = executeGas + resp.ExecutionResponses = executeResp + // done! + return resp } // Authenticate handles the authentication flow of an abstracted account. @@ -40,9 +54,9 @@ func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *v1 func (k Keeper) Authenticate( ctx context.Context, bundler string, - op *v1.UserOperation, + op *accountsv1.UserOperation, ) (gasUsed uint64, err error) { - opV2 := v1.GogoUserOpToProtoV2(op) + // TODO: add branch with gas limit senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { return 0, err @@ -50,10 +64,9 @@ func (k Keeper) Authenticate( accountNumber, err := k.AccountByNumber.Get(ctx, senderAddr) // create an isolated context in which we execute authentication // without affecting the parent context and with the authentication gas limit. - // TODO: add branch with gas limit _, err = k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgAuthenticate{ Bundler: bundler, - UserOperation: opV2, + UserOperation: op, ChainId: "chain-id", // TODO how to get chain id? AccountNumber: accountNumber, }) @@ -67,7 +80,8 @@ func (k Keeper) Authenticate( // Since for an abstracted account the bundler payment method is optional, // if the account does not handle bundler payment messages, then this method // will simply execute the provided messages on behalf of the sender and return. -func (k Keeper) PayBundler(ctx context.Context, bundler string, op *v1.UserOperation) (gasUsed uint64, paymentResponses []*anypb.Any, err error) { +func (k Keeper) PayBundler(ctx context.Context, bundler string, op *accountsv1.UserOperation) (gasUsed uint64, paymentResponses []*anypb.Any, err error) { + // TODO add branch with gas limit senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { return 0, nil, err @@ -97,18 +111,55 @@ func (k Keeper) PayBundler(ctx context.Context, bundler string, op *v1.UserOpera } // payBundlerFallback attempts to execute the provided messages on behalf of the op sender. -// it checks that the op sender does not try to impersonate other accounts. -func (k Keeper) payBundlerFallback(ctx context.Context, op *v1.UserOperation) ([]*anypb.Any, error) { - return nil, fmt.Errorf("not implemented") +func (k Keeper) payBundlerFallback(ctx context.Context, op *accountsv1.UserOperation) ([]*anypb.Any, error) { + // TODO: execute in isolated context with gas limit + responses := make([]*anypb.Any, len(op.BundlerPaymentMessages)) + sender, err := k.addressCodec.StringToBytes(op.Sender) + if err != nil { + return nil, err + } + for i, msg := range op.BundlerPaymentMessages { + resp, err := k.untypedExecute(ctx, sender, msg) + if err != nil { + return nil, fmt.Errorf("failed to execute bundler payment message %d: %s", i, err.Error()) + } + responses[i] = resp + } + return responses, nil } -func (k Keeper) untypedExecute(ctx context.Context, anyMsg *anypb.Any) (*anypb.Any, error) { +// untypedExecute executes a protobuf message without knowing the response type. +// It will check if the sender is allowed to execute the message and then execute it. +func (k Keeper) untypedExecute(ctx context.Context, sender []byte, anyMsg *anypb.Any) (*anypb.Any, error) { msg, err := anyMsg.UnmarshalNew() if err != nil { return nil, err } + // we check if the sender is allowed to execute the message. + wantSender, err := k.getSenderFunc(msg) + if err != nil { + return nil, err + } + if !bytes.Equal(sender, wantSender) { + return nil, fmt.Errorf("sender %s is not allowed to execute message %T", sender, msg) + } // we now need to fetch the response type from the request message type. // this is because the response type is not known. + respName := k.msgResponseFromRequestName(string(msg.ProtoReflect().Descriptor().FullName())) + if respName == "" { + return nil, fmt.Errorf("could not find response type for message %T", msg) + } + // get response type + respType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(respName)) + if err != nil { + return nil, err + } + resp := respType.New().Interface() + err = k.execModuleFunc(ctx, msg.(protoiface.MessageV1), resp.(protoiface.MessageV1)) + if err != nil { + return nil, err + } + return anypb.New(resp) } // parsePayBundlerResponse parses the bundler response as any into a slice of From 3374e5cb527fad48881379650e96ac4e166839a6 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 13 Nov 2023 15:55:17 +0100 Subject: [PATCH 06/19] tmp --- x/accounts/keeper_account_abstraction.go | 35 +++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 39e7081d55d5..dfd41a1d80b0 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -36,7 +36,7 @@ func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *ac resp.BundlerPaymentResponses = bundlerPayResp // execute messages, the real operation intent - executeGas, executeResp, err := k.ExecuteMessages(ctx, bundler, op) + executeGas, executeResp, err := k.OpExecuteMessages(ctx, bundler, op) if err != nil { resp.Error = fmt.Sprintf("execution failed: %s", err.Error()) return resp @@ -73,6 +73,28 @@ func (k Keeper) Authenticate( return gasUsed, nil } +func (k Keeper) OpExecuteMessages(ctx context.Context, bundler string, op *accountsv1.UserOperation) (gasUsed uint64, messagesResponse []*anypb.Any, err error) { + senderAddr, err := k.addressCodec.StringToBytes(op.Sender) + if err != nil { + return 0, nil, err + } + resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgExecute{ + Bundler: bundler, + ExecutionMessages: op.ExecutionMessages, + }) + // here is where we check if the account handles execution messages + // if it does not, then we simply execute the provided messages on behalf of the sender + switch { + case err == nil: + // TODO get gas used. + executeResp, err := parseExecuteResponse(resp) + return gasUsed, executeResp, err + case implementation.IsRoutingError(err): + // TODO get gas used. + + } +} + // PayBundler handles the payment of the bundler in a given v1.UserOperation. // Must be called after Authenticate. // It gets executed in an isolated context with the bundler payment gas limit. @@ -172,3 +194,14 @@ func parsePayBundlerResponse(resp any) ([]*anypb.Any, error) { } return payBundlerResp.BundlerPaymentMessagesResponse, nil } + +// parseExecuteResponse parses the execute response as any into a slice of +// responses on execution messages. +func parseExecuteResponse(resp any) ([]*anypb.Any, error) { + executeResp, ok := resp.(*account_abstractionv1.MsgExecuteResponse) + // this means the account does not properly implement account abstraction. + if !ok { + return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got %T", &account_abstractionv1.MsgExecuteResponse{}, resp) + } + return executeResp.ExecutionMessagesResponse, nil +} From 1d550593a38433cb1e30ea2b6b129917ba0d3dd1 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Thu, 16 Nov 2023 21:08:39 +0100 Subject: [PATCH 07/19] cleanups plus start testing --- .../v1/interface.pulsar.go | 268 +++++------------- .../accounts/v1/account_abstraction.pulsar.go | 266 +++++++---------- .../account_abstraction/v1/interface.proto | 4 - .../accounts/v1/account_abstraction.proto | 13 +- simapp/app.go | 3 + .../e2e/accounts/account_abstraction_test.go | 73 +++++ x/accounts/keeper.go | 15 +- x/accounts/keeper_account_abstraction.go | 124 +++++--- x/accounts/keeper_test.go | 2 +- x/accounts/msg_server.go | 14 +- .../{full_implementation.go => full.go} | 36 ++- x/accounts/v1/account_abstraction.go | 32 --- x/accounts/v1/account_abstraction.pb.go | 124 +++----- 13 files changed, 416 insertions(+), 558 deletions(-) create mode 100644 tests/e2e/accounts/account_abstraction_test.go rename x/accounts/testing/account_abstraction/{full_implementation.go => full.go} (51%) delete mode 100644 x/accounts/v1/account_abstraction.go diff --git a/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go index 63eb59fc2514..3708e80079b8 100644 --- a/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go +++ b/api/cosmos/accounts/interfaces/account_abstraction/v1/interface.pulsar.go @@ -18,8 +18,6 @@ var ( md_MsgAuthenticate protoreflect.MessageDescriptor fd_MsgAuthenticate_bundler protoreflect.FieldDescriptor fd_MsgAuthenticate_user_operation protoreflect.FieldDescriptor - fd_MsgAuthenticate_chain_id protoreflect.FieldDescriptor - fd_MsgAuthenticate_account_number protoreflect.FieldDescriptor ) func init() { @@ -27,8 +25,6 @@ func init() { md_MsgAuthenticate = File_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto.Messages().ByName("MsgAuthenticate") fd_MsgAuthenticate_bundler = md_MsgAuthenticate.Fields().ByName("bundler") fd_MsgAuthenticate_user_operation = md_MsgAuthenticate.Fields().ByName("user_operation") - fd_MsgAuthenticate_chain_id = md_MsgAuthenticate.Fields().ByName("chain_id") - fd_MsgAuthenticate_account_number = md_MsgAuthenticate.Fields().ByName("account_number") } var _ protoreflect.Message = (*fastReflection_MsgAuthenticate)(nil) @@ -108,18 +104,6 @@ func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescript return } } - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_MsgAuthenticate_chain_id, value) { - return - } - } - if x.AccountNumber != uint64(0) { - value := protoreflect.ValueOfUint64(x.AccountNumber) - if !f(fd_MsgAuthenticate_account_number, value) { - return - } - } } // Has reports whether a field is populated. @@ -139,10 +123,6 @@ func (x *fastReflection_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bo return x.Bundler != "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": return x.UserOperation != nil - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - return x.ChainId != "" - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - return x.AccountNumber != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -163,10 +143,6 @@ func (x *fastReflection_MsgAuthenticate) Clear(fd protoreflect.FieldDescriptor) x.Bundler = "" case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": x.UserOperation = nil - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - x.ChainId = "" - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - x.AccountNumber = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -189,12 +165,6 @@ func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescri case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": value := x.UserOperation return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - value := x.AccountNumber - return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -219,10 +189,6 @@ func (x *fastReflection_MsgAuthenticate) Set(fd protoreflect.FieldDescriptor, va x.Bundler = value.Interface().(string) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": x.UserOperation = value.Message().Interface().(*v1.UserOperation) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - x.ChainId = value.Interface().(string) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - x.AccountNumber = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -250,10 +216,6 @@ func (x *fastReflection_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor return protoreflect.ValueOfMessage(x.UserOperation.ProtoReflect()) case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.bundler": panic(fmt.Errorf("field bundler of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - panic(fmt.Errorf("field chain_id of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - panic(fmt.Errorf("field account_number of message cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -272,10 +234,6 @@ func (x *fastReflection_MsgAuthenticate) NewField(fd protoreflect.FieldDescripto case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.user_operation": m := new(v1.UserOperation) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.chain_id": - return protoreflect.ValueOfString("") - case "cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate.account_number": - return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.interfaces.account_abstraction.v1.MsgAuthenticate")) @@ -353,13 +311,6 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { l = options.Size(x.UserOperation) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.AccountNumber != 0 { - n += 1 + runtime.Sov(uint64(x.AccountNumber)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -389,18 +340,6 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.AccountNumber != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.AccountNumber)) - i-- - dAtA[i] = 0x20 - } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) - i-- - dAtA[i] = 0x1a - } if x.UserOperation != nil { encoded, err := options.Marshal(x.UserOperation) if err != nil { @@ -539,57 +478,6 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { 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 ChainId", 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.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) - } - x.AccountNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.AccountNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3948,10 +3836,6 @@ type MsgAuthenticate struct { // user_operation is the operation that the user is trying to perform. // it also contains authentication information. UserOperation *v1.UserOperation `protobuf:"bytes,2,opt,name=user_operation,json=userOperation,proto3" json:"user_operation,omitempty"` - // chain_id defines the network identifier. - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // account_number is the account number of the user_operation. - AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` } func (x *MsgAuthenticate) Reset() { @@ -3988,20 +3872,6 @@ func (x *MsgAuthenticate) GetUserOperation() *v1.UserOperation { return nil } -func (x *MsgAuthenticate) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *MsgAuthenticate) GetAccountNumber() uint64 { - if x != nil { - return x.AccountNumber - } - return 0 -} - // MsgAuthenticateResponse is the response to MsgAuthenticate. // The authentication either fails or succeeds, this is why // there are no auxiliary fields to the response. @@ -4290,81 +4160,77 @@ var file_cosmos_accounts_interfaces_account_abstraction_v1_interface_proto_rawDe 0x6f, 0x1a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xb7, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x48, 0x0a, - 0x0e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, - 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, - 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, - 0x78, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x21, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, - 0x03, 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, 0x1e, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, 0x0a, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x72, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x1b, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x22, 0x5b, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, - 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x42, 0x86, 0x03, - 0x0a, 0x35, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 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, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, - 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, + 0x75, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x0e, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x79, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x18, + 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x78, 0x0a, 0x15, + 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x21, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x1e, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x43, + 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x1b, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 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, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x5b, 0x0a, + 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x42, 0x86, 0x03, 0x0a, 0x35, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x49, 0x41, 0xaa, 0x02, 0x30, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x30, + 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 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, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, + 0xa2, 0x02, 0x04, 0x43, 0x41, 0x49, 0x41, 0xaa, 0x02, 0x30, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x30, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x3c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x3c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x5c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x5c, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x34, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x3a, 0x3a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x3a, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x34, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, + 0x3a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/accounts/v1/account_abstraction.pulsar.go b/api/cosmos/accounts/v1/account_abstraction.pulsar.go index b76ceccfea50..838500494cb6 100644 --- a/api/cosmos/accounts/v1/account_abstraction.pulsar.go +++ b/api/cosmos/accounts/v1/account_abstraction.pulsar.go @@ -13,105 +13,105 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_UserOperation_6_list)(nil) +var _ protoreflect.List = (*_UserOperation_5_list)(nil) -type _UserOperation_6_list struct { +type _UserOperation_5_list struct { list *[]*anypb.Any } -func (x *_UserOperation_6_list) Len() int { +func (x *_UserOperation_5_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_UserOperation_6_list) Get(i int) protoreflect.Value { +func (x *_UserOperation_5_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_UserOperation_6_list) Set(i int, value protoreflect.Value) { +func (x *_UserOperation_5_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) (*x.list)[i] = concreteValue } -func (x *_UserOperation_6_list) Append(value protoreflect.Value) { +func (x *_UserOperation_5_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) *x.list = append(*x.list, concreteValue) } -func (x *_UserOperation_6_list) AppendMutable() protoreflect.Value { +func (x *_UserOperation_5_list) AppendMutable() protoreflect.Value { v := new(anypb.Any) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_UserOperation_6_list) Truncate(n int) { +func (x *_UserOperation_5_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_UserOperation_6_list) NewElement() protoreflect.Value { +func (x *_UserOperation_5_list) NewElement() protoreflect.Value { v := new(anypb.Any) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_UserOperation_6_list) IsValid() bool { +func (x *_UserOperation_5_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_UserOperation_8_list)(nil) +var _ protoreflect.List = (*_UserOperation_7_list)(nil) -type _UserOperation_8_list struct { +type _UserOperation_7_list struct { list *[]*anypb.Any } -func (x *_UserOperation_8_list) Len() int { +func (x *_UserOperation_7_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_UserOperation_8_list) Get(i int) protoreflect.Value { +func (x *_UserOperation_7_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_UserOperation_8_list) Set(i int, value protoreflect.Value) { +func (x *_UserOperation_7_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) (*x.list)[i] = concreteValue } -func (x *_UserOperation_8_list) Append(value protoreflect.Value) { +func (x *_UserOperation_7_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*anypb.Any) *x.list = append(*x.list, concreteValue) } -func (x *_UserOperation_8_list) AppendMutable() protoreflect.Value { +func (x *_UserOperation_7_list) AppendMutable() protoreflect.Value { v := new(anypb.Any) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_UserOperation_8_list) Truncate(n int) { +func (x *_UserOperation_7_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_UserOperation_8_list) NewElement() protoreflect.Value { +func (x *_UserOperation_7_list) NewElement() protoreflect.Value { v := new(anypb.Any) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_UserOperation_8_list) IsValid() bool { +func (x *_UserOperation_7_list) IsValid() bool { return x.list != nil } @@ -120,7 +120,6 @@ var ( fd_UserOperation_sender protoreflect.FieldDescriptor fd_UserOperation_authentication_method protoreflect.FieldDescriptor fd_UserOperation_authentication_data protoreflect.FieldDescriptor - fd_UserOperation_sequence protoreflect.FieldDescriptor fd_UserOperation_authentication_gas_limit protoreflect.FieldDescriptor fd_UserOperation_bundler_payment_messages protoreflect.FieldDescriptor fd_UserOperation_bundler_payment_gas_limit protoreflect.FieldDescriptor @@ -134,7 +133,6 @@ func init() { fd_UserOperation_sender = md_UserOperation.Fields().ByName("sender") fd_UserOperation_authentication_method = md_UserOperation.Fields().ByName("authentication_method") fd_UserOperation_authentication_data = md_UserOperation.Fields().ByName("authentication_data") - fd_UserOperation_sequence = md_UserOperation.Fields().ByName("sequence") fd_UserOperation_authentication_gas_limit = md_UserOperation.Fields().ByName("authentication_gas_limit") fd_UserOperation_bundler_payment_messages = md_UserOperation.Fields().ByName("bundler_payment_messages") fd_UserOperation_bundler_payment_gas_limit = md_UserOperation.Fields().ByName("bundler_payment_gas_limit") @@ -225,12 +223,6 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor return } } - if x.Sequence != uint64(0) { - value := protoreflect.ValueOfUint64(x.Sequence) - if !f(fd_UserOperation_sequence, value) { - return - } - } if x.AuthenticationGasLimit != uint64(0) { value := protoreflect.ValueOfUint64(x.AuthenticationGasLimit) if !f(fd_UserOperation_authentication_gas_limit, value) { @@ -238,7 +230,7 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor } } if len(x.BundlerPaymentMessages) != 0 { - value := protoreflect.ValueOfList(&_UserOperation_6_list{list: &x.BundlerPaymentMessages}) + value := protoreflect.ValueOfList(&_UserOperation_5_list{list: &x.BundlerPaymentMessages}) if !f(fd_UserOperation_bundler_payment_messages, value) { return } @@ -250,7 +242,7 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor } } if len(x.ExecutionMessages) != 0 { - value := protoreflect.ValueOfList(&_UserOperation_8_list{list: &x.ExecutionMessages}) + value := protoreflect.ValueOfList(&_UserOperation_7_list{list: &x.ExecutionMessages}) if !f(fd_UserOperation_execution_messages, value) { return } @@ -282,8 +274,6 @@ func (x *fastReflection_UserOperation) Has(fd protoreflect.FieldDescriptor) bool return x.AuthenticationMethod != "" case "cosmos.accounts.v1.UserOperation.authentication_data": return len(x.AuthenticationData) != 0 - case "cosmos.accounts.v1.UserOperation.sequence": - return x.Sequence != uint64(0) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return x.AuthenticationGasLimit != uint64(0) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -316,8 +306,6 @@ func (x *fastReflection_UserOperation) Clear(fd protoreflect.FieldDescriptor) { x.AuthenticationMethod = "" case "cosmos.accounts.v1.UserOperation.authentication_data": x.AuthenticationData = nil - case "cosmos.accounts.v1.UserOperation.sequence": - x.Sequence = uint64(0) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": x.AuthenticationGasLimit = uint64(0) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -353,26 +341,23 @@ func (x *fastReflection_UserOperation) Get(descriptor protoreflect.FieldDescript case "cosmos.accounts.v1.UserOperation.authentication_data": value := x.AuthenticationData return protoreflect.ValueOfBytes(value) - case "cosmos.accounts.v1.UserOperation.sequence": - value := x.Sequence - return protoreflect.ValueOfUint64(value) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": value := x.AuthenticationGasLimit return protoreflect.ValueOfUint64(value) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": if len(x.BundlerPaymentMessages) == 0 { - return protoreflect.ValueOfList(&_UserOperation_6_list{}) + return protoreflect.ValueOfList(&_UserOperation_5_list{}) } - listValue := &_UserOperation_6_list{list: &x.BundlerPaymentMessages} + listValue := &_UserOperation_5_list{list: &x.BundlerPaymentMessages} return protoreflect.ValueOfList(listValue) case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": value := x.BundlerPaymentGasLimit return protoreflect.ValueOfUint64(value) case "cosmos.accounts.v1.UserOperation.execution_messages": if len(x.ExecutionMessages) == 0 { - return protoreflect.ValueOfList(&_UserOperation_8_list{}) + return protoreflect.ValueOfList(&_UserOperation_7_list{}) } - listValue := &_UserOperation_8_list{list: &x.ExecutionMessages} + listValue := &_UserOperation_7_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(listValue) case "cosmos.accounts.v1.UserOperation.execution_gas_limit": value := x.ExecutionGasLimit @@ -403,19 +388,17 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu x.AuthenticationMethod = value.Interface().(string) case "cosmos.accounts.v1.UserOperation.authentication_data": x.AuthenticationData = value.Bytes() - case "cosmos.accounts.v1.UserOperation.sequence": - x.Sequence = value.Uint() case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": x.AuthenticationGasLimit = value.Uint() case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": lv := value.List() - clv := lv.(*_UserOperation_6_list) + clv := lv.(*_UserOperation_5_list) x.BundlerPaymentMessages = *clv.list case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": x.BundlerPaymentGasLimit = value.Uint() case "cosmos.accounts.v1.UserOperation.execution_messages": lv := value.List() - clv := lv.(*_UserOperation_8_list) + clv := lv.(*_UserOperation_7_list) x.ExecutionMessages = *clv.list case "cosmos.accounts.v1.UserOperation.execution_gas_limit": x.ExecutionGasLimit = value.Uint() @@ -443,13 +426,13 @@ func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) if x.BundlerPaymentMessages == nil { x.BundlerPaymentMessages = []*anypb.Any{} } - value := &_UserOperation_6_list{list: &x.BundlerPaymentMessages} + value := &_UserOperation_5_list{list: &x.BundlerPaymentMessages} return protoreflect.ValueOfList(value) case "cosmos.accounts.v1.UserOperation.execution_messages": if x.ExecutionMessages == nil { x.ExecutionMessages = []*anypb.Any{} } - value := &_UserOperation_8_list{list: &x.ExecutionMessages} + value := &_UserOperation_7_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(value) case "cosmos.accounts.v1.UserOperation.sender": panic(fmt.Errorf("field sender of message cosmos.accounts.v1.UserOperation is not mutable")) @@ -457,8 +440,6 @@ func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field authentication_method of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_data": panic(fmt.Errorf("field authentication_data of message cosmos.accounts.v1.UserOperation is not mutable")) - case "cosmos.accounts.v1.UserOperation.sequence": - panic(fmt.Errorf("field sequence of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": panic(fmt.Errorf("field authentication_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": @@ -484,18 +465,16 @@ func (x *fastReflection_UserOperation) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "cosmos.accounts.v1.UserOperation.authentication_data": return protoreflect.ValueOfBytes(nil) - case "cosmos.accounts.v1.UserOperation.sequence": - return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": list := []*anypb.Any{} - return protoreflect.ValueOfList(&_UserOperation_6_list{list: &list}) + return protoreflect.ValueOfList(&_UserOperation_5_list{list: &list}) case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.UserOperation.execution_messages": list := []*anypb.Any{} - return protoreflect.ValueOfList(&_UserOperation_8_list{list: &list}) + return protoreflect.ValueOfList(&_UserOperation_7_list{list: &list}) case "cosmos.accounts.v1.UserOperation.execution_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) default: @@ -579,9 +558,6 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Sequence != 0 { - n += 1 + runtime.Sov(uint64(x.Sequence)) - } if x.AuthenticationGasLimit != 0 { n += 1 + runtime.Sov(uint64(x.AuthenticationGasLimit)) } @@ -635,7 +611,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if x.ExecutionGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecutionGasLimit)) i-- - dAtA[i] = 0x48 + dAtA[i] = 0x40 } if len(x.ExecutionMessages) > 0 { for iNdEx := len(x.ExecutionMessages) - 1; iNdEx >= 0; iNdEx-- { @@ -650,13 +626,13 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x3a } } if x.BundlerPaymentGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.BundlerPaymentGasLimit)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if len(x.BundlerPaymentMessages) > 0 { for iNdEx := len(x.BundlerPaymentMessages) - 1; iNdEx >= 0; iNdEx-- { @@ -671,17 +647,12 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } } if x.AuthenticationGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.AuthenticationGasLimit)) i-- - dAtA[i] = 0x28 - } - if x.Sequence != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) - i-- dAtA[i] = 0x20 } if len(x.AuthenticationData) > 0 { @@ -853,25 +824,6 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - x.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasLimit", wireType) } @@ -890,7 +842,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { break } } - case 6: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentMessages", wireType) } @@ -924,7 +876,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 7: + case 6: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasLimit", wireType) } @@ -943,7 +895,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { break } } - case 8: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionMessages", wireType) } @@ -977,7 +929,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 9: + case 8: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasLimit", wireType) } @@ -1900,12 +1852,9 @@ type UserOperation struct { // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` - // sequence defines the sequence number of the account, the authentication method might require this - // to ensure non-replayability. - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. - AuthenticationGasLimit uint64 `protobuf:"varint,5,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` + AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` // bundler_payment_messages expresses a list of messages that the account // executes to pay the bundler for submitting the UserOperation. // It can be empty if the bundler does not need any form of payment, @@ -1915,18 +1864,18 @@ type UserOperation struct { // - NFT payment // - IBC Token payment. // - Payment through delegations. - BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,6,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` + BundlerPaymentMessages []*anypb.Any `protobuf:"bytes,5,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. // This ensures that, since the bundler executes a list of UserOperations and there needs to // be minimal trust between bundler and UserOperation sender, the sender cannot consume // the whole bundle gas. - BundlerPaymentGasLimit uint64 `protobuf:"varint,7,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` + BundlerPaymentGasLimit uint64 `protobuf:"varint,6,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` // execution_messages expresses a list of messages that the account wants to execute. // This concretely is the intent of the transaction expressed as a UserOperation. - ExecutionMessages []*anypb.Any `protobuf:"bytes,8,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` + ExecutionMessages []*anypb.Any `protobuf:"bytes,7,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. - ExecutionGasLimit uint64 `protobuf:"varint,9,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` } func (x *UserOperation) Reset() { @@ -1970,13 +1919,6 @@ func (x *UserOperation) GetAuthenticationData() []byte { return nil } -func (x *UserOperation) GetSequence() uint64 { - if x != nil { - return x.Sequence - } - return 0 -} - func (x *UserOperation) GetAuthenticationGasLimit() uint64 { if x != nil { return x.AuthenticationGasLimit @@ -2108,7 +2050,7 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x03, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x03, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, @@ -2117,65 +2059,63 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x61, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x06, 0x20, 0x03, 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, 0x16, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x43, - 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x22, 0xe5, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, - 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x50, - 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 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, 0x17, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, - 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, - 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 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, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0xcb, 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, 0x17, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, + 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, + 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 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, + 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 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, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, + 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xe5, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, + 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x12, 0x50, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 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, 0x17, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 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, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, + 0xcb, 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, 0x17, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 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 ( diff --git a/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto index cd94ba338a7f..098448d61809 100644 --- a/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto +++ b/proto/cosmos/accounts/interfaces/account_abstraction/v1/interface.proto @@ -15,10 +15,6 @@ message MsgAuthenticate { // user_operation is the operation that the user is trying to perform. // it also contains authentication information. cosmos.accounts.v1.UserOperation user_operation = 2; - // chain_id defines the network identifier. - string chain_id = 3; - // account_number is the account number of the user_operation. - uint64 account_number = 4; } // MsgAuthenticateResponse is the response to MsgAuthenticate. diff --git a/proto/cosmos/accounts/v1/account_abstraction.proto b/proto/cosmos/accounts/v1/account_abstraction.proto index 04bbed0fafcb..01fb36436fbc 100644 --- a/proto/cosmos/accounts/v1/account_abstraction.proto +++ b/proto/cosmos/accounts/v1/account_abstraction.proto @@ -18,12 +18,9 @@ message UserOperation { // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. bytes authentication_data = 3; - // sequence defines the sequence number of the account, the authentication method might require this - // to ensure non-replayability. - uint64 sequence = 4; // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. - uint64 authentication_gas_limit = 5; + uint64 authentication_gas_limit = 4; // bundler_payment_messages expresses a list of messages that the account // executes to pay the bundler for submitting the UserOperation. // It can be empty if the bundler does not need any form of payment, @@ -33,18 +30,18 @@ message UserOperation { // - NFT payment // - IBC Token payment. // - Payment through delegations. - repeated google.protobuf.Any bundler_payment_messages = 6; + repeated google.protobuf.Any bundler_payment_messages = 5; // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. // This ensures that, since the bundler executes a list of UserOperations and there needs to // be minimal trust between bundler and UserOperation sender, the sender cannot consume // the whole bundle gas. - uint64 bundler_payment_gas_limit = 7; + uint64 bundler_payment_gas_limit = 6; // execution_messages expresses a list of messages that the account wants to execute. // This concretely is the intent of the transaction expressed as a UserOperation. - repeated google.protobuf.Any execution_messages = 8; + repeated google.protobuf.Any execution_messages = 7; // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. - uint64 execution_gas_limit = 9; + uint64 execution_gas_limit = 8; } // UserOperationResponse defines the response of a UserOperation. diff --git a/simapp/app.go b/simapp/app.go index f1566552420a..34b1be605b21 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -9,6 +9,7 @@ import ( "os" "path/filepath" + "cosmossdk.io/x/accounts/testing/account_abstraction" abci "github.com/cometbft/cometbft/abci/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" @@ -284,11 +285,13 @@ func NewSimApp( accountsKeeper, err := accounts.NewKeeper( runtime.NewKVStoreService(keys[accounts.StoreKey]), runtime.EventService{}, + runtime.BranchService{}, app.AuthKeeper.AddressCodec(), appCodec.InterfaceRegistry().SigningContext(), app.MsgServiceRouter(), app.GRPCQueryRouter(), accountstd.AddAccount("counter", counter.NewAccount), + accountstd.AddAccount("aa_full", account_abstraction.NewFullImpl), ) if err != nil { panic(err) diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go new file mode 100644 index 000000000000..0ae3fba04544 --- /dev/null +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -0,0 +1,73 @@ +package accounts + +import ( + "testing" + + rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" + accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + "cosmossdk.io/log" + "cosmossdk.io/simapp" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +var ( + privKey = secp256k1.GenPrivKey() + accCreator = []byte("creator") + bundler = "bundler" + alice = "alice" +) + +func TestAccountAbstraction(t *testing.T) { + app := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) + ak := app.AccountsKeeper + ctx := app.NewContext(false) + + _, aaAddr, err := ak.Init(ctx, "aa_full", accCreator, &rotationv1.MsgInit{ + PubKeyBytes: privKey.PubKey().Bytes(), + }) + require.NoError(t, err) + + aaAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aaAddr) + require.NoError(t, err) + + t.Run("ok", func(t *testing.T) { + resp := ak.ExecuteUserOperation(ctx, bundler, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "standard", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: nil, + BundlerPaymentGasLimit: 0, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: "", + ToAddress: "", + Amount: nil, + }), + ExecutionGasLimit: 0, + }) + t.Log(resp.String()) + }) + t.Run("ok pay bundler not implemented", func(t *testing.T) {}) + t.Run("ok exec messages not implemented", func(t *testing.T) {}) + t.Run("pay bundle impersonation", func(t *testing.T) {}) + t.Run("exec message impersonation", func(t *testing.T) {}) + t.Run("auth failure", func(t *testing.T) {}) + t.Run("pay bundle failure", func(t *testing.T) {}) + t.Run("exec message failure", func(t *testing.T) {}) +} + +func intoAny(t *testing.T, msgs ...proto.Message) (anys []*anypb.Any) { + t.Helper() + for _, msg := range msgs { + any, err := anypb.New(msg) + require.NoError(t, err) + anys = append(anys, any) + } + return +} diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index caa17f340480..0eea0618e67d 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" + "cosmossdk.io/core/branch" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/runtime/protoiface" @@ -50,9 +51,13 @@ type SignerProvider interface { GetSigners(msg proto.Message) ([][]byte, error) } +// BranchExecutor defines an interface used to execute ops in a branch. +type BranchExecutor = branch.Service + func NewKeeper( ss store.KVStoreService, es event.Service, + bs BranchExecutor, addressCodec address.Codec, signerProvider SignerProvider, execRouter MsgRouter, @@ -61,9 +66,10 @@ func NewKeeper( ) (Keeper, error) { sb := collections.NewSchemaBuilder(ss) keeper := Keeper{ - storeService: ss, - eventService: es, - addressCodec: addressCodec, + storeService: ss, + eventService: es, + branchExecutor: bs, + addressCodec: addressCodec, getSenderFunc: func(msg proto.Message) ([]byte, error) { signers, err := signerProvider.GetSigners(msg) if err != nil { @@ -93,7 +99,7 @@ func NewKeeper( } return handlers[0](ctx, req, resp) }, - msgResponseFromRequestName: execRouter.ResponseByRequestName, + msgResponseFromRequestName: func(name string) string { return execRouter.ResponseByRequestName(name) }, Schema: collections.Schema{}, AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), @@ -121,6 +127,7 @@ type Keeper struct { getSenderFunc func(msg proto.Message) ([]byte, error) execModuleFunc implementation.ModuleExecFunc queryModuleFunc implementation.ModuleQueryFunc + branchExecutor BranchExecutor msgResponseFromRequestName func(name string) string // msgResponseFromRequestName returns the response name for a given request name. accounts map[string]implementation.Implementation diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index dfd41a1d80b0..a9574ce46d95 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -15,7 +15,11 @@ import ( ) // ExecuteUserOperation handles the execution of an abstracted account UserOperation. -func (k Keeper) ExecuteUserOperation(ctx context.Context, bundler string, op *accountsv1.UserOperation) *accountsv1.UserOperationResponse { +func (k Keeper) ExecuteUserOperation( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) *accountsv1.UserOperationResponse { resp := &accountsv1.UserOperationResponse{} // authenticate @@ -56,27 +60,58 @@ func (k Keeper) Authenticate( bundler string, op *accountsv1.UserOperation, ) (gasUsed uint64, err error) { - // TODO: add branch with gas limit + // authenticate + return k.branchExecutor.ExecuteWithGasLimit(ctx, op.AuthenticationGasLimit, func(ctx context.Context) error { + return k.authenticate(ctx, bundler, op) + }) +} + +// authenticate handles the authentication flow of an abstracted account. +func (k Keeper) authenticate( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) error { senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { - return 0, err + return err } - accountNumber, err := k.AccountByNumber.Get(ctx, senderAddr) // create an isolated context in which we execute authentication // without affecting the parent context and with the authentication gas limit. _, err = k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgAuthenticate{ Bundler: bundler, UserOperation: op, - ChainId: "chain-id", // TODO how to get chain id? - AccountNumber: accountNumber, }) - return gasUsed, nil + return err } -func (k Keeper) OpExecuteMessages(ctx context.Context, bundler string, op *accountsv1.UserOperation) (gasUsed uint64, messagesResponse []*anypb.Any, err error) { +// OpExecuteMessages handles the execution of the messages in a given v1.UserOperation. +// It executes in an isolated branch, in an atomic way, if all the messages pass then +// the execution is deemed successful and the state is committed. +// An account abstraction implementer can choose to handle execution messages or not, +// if it does not expose the execution messages method, then this method will simply +// execute the provided messages on behalf of the sender and return. +func (k Keeper) OpExecuteMessages( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) (gasUsed uint64, responses []*anypb.Any, err error) { + // execute messages, the real operation intent + gasUsed, err = k.branchExecutor.ExecuteWithGasLimit(ctx, op.ExecutionGasLimit, func(ctx context.Context) error { + responses, err = k.opExecuteMessages(ctx, bundler, op) + return err + }) + return gasUsed, responses, err +} + +func (k Keeper) opExecuteMessages( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) (messagesResponse []*anypb.Any, err error) { senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { - return 0, nil, err + return nil, err } resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgExecute{ Bundler: bundler, @@ -86,12 +121,16 @@ func (k Keeper) OpExecuteMessages(ctx context.Context, bundler string, op *accou // if it does not, then we simply execute the provided messages on behalf of the sender switch { case err == nil: - // TODO get gas used. + // all is ok, so parse responses. executeResp, err := parseExecuteResponse(resp) - return gasUsed, executeResp, err + return executeResp, err case implementation.IsRoutingError(err): - // TODO get gas used. - + // if it is a routing error, it means the account does not handle execution messages, + // in this case we attempt to execute the provided messages on behalf of the op sender. + return k.sendMessages(ctx, senderAddr, op.ExecutionMessages) + default: + // some other error + return nil, err } } @@ -102,11 +141,27 @@ func (k Keeper) OpExecuteMessages(ctx context.Context, bundler string, op *accou // Since for an abstracted account the bundler payment method is optional, // if the account does not handle bundler payment messages, then this method // will simply execute the provided messages on behalf of the sender and return. -func (k Keeper) PayBundler(ctx context.Context, bundler string, op *accountsv1.UserOperation) (gasUsed uint64, paymentResponses []*anypb.Any, err error) { - // TODO add branch with gas limit +func (k Keeper) PayBundler( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) (gasUsed uint64, responses []*anypb.Any, err error) { + // pay bundler + gasUsed, err = k.branchExecutor.ExecuteWithGasLimit(ctx, op.BundlerPaymentGasLimit, func(ctx context.Context) error { + responses, err = k.payBundler(ctx, bundler, op) + return err + }) + return gasUsed, responses, err +} + +func (k Keeper) payBundler( + ctx context.Context, + bundler string, + op *accountsv1.UserOperation, +) (paymentResponses []*anypb.Any, err error) { senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { - return 0, nil, err + return nil, err } resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgPayBundler{ Bundler: bundler, @@ -116,31 +171,24 @@ func (k Keeper) PayBundler(ctx context.Context, bundler string, op *accountsv1.U // if it does not, then we simply execute the provided messages on behalf of the sender switch { case err == nil: - // TODO: get gas used + // if no error, execution went fine, so parse responses. payBundlerResp, err := parsePayBundlerResponse(resp) - return gasUsed, payBundlerResp, err - // if we get a routing message error it means the account does not handle bundler payment messages, - // in this case we attempt to execute the provided messages on behalf of the op sender. + return payBundlerResp, err case implementation.IsRoutingError(err): - // TODO: get gas used - payBundlerResp, err := k.payBundlerFallback(ctx, op) - return gasUsed, payBundlerResp, err - // some other execution error. + // if we get a routing message error it means the account does not handle bundler payment messages, + // in this case we attempt to execute the provided messages on behalf of the op sender. + return k.sendMessages(ctx, senderAddr, op.BundlerPaymentMessages) default: - // TODO: get gas used - return gasUsed, nil, err + // some other execution error. + return nil, err } } -// payBundlerFallback attempts to execute the provided messages on behalf of the op sender. -func (k Keeper) payBundlerFallback(ctx context.Context, op *accountsv1.UserOperation) ([]*anypb.Any, error) { - // TODO: execute in isolated context with gas limit - responses := make([]*anypb.Any, len(op.BundlerPaymentMessages)) - sender, err := k.addressCodec.StringToBytes(op.Sender) - if err != nil { - return nil, err - } - for i, msg := range op.BundlerPaymentMessages { +// sendMessages attempts to execute the provided messages on behalf of the op sender. +// It returns the responses of the messages in the same order as the provided messages. +func (k Keeper) sendMessages(ctx context.Context, sender []byte, messages []*anypb.Any) ([]*anypb.Any, error) { + responses := make([]*anypb.Any, len(messages)) + for i, msg := range messages { resp, err := k.untypedExecute(ctx, sender, msg) if err != nil { return nil, fmt.Errorf("failed to execute bundler payment message %d: %s", i, err.Error()) @@ -152,7 +200,7 @@ func (k Keeper) payBundlerFallback(ctx context.Context, op *accountsv1.UserOpera // untypedExecute executes a protobuf message without knowing the response type. // It will check if the sender is allowed to execute the message and then execute it. -func (k Keeper) untypedExecute(ctx context.Context, sender []byte, anyMsg *anypb.Any) (*anypb.Any, error) { +func (k Keeper) untypedExecute(ctx context.Context, gotSender []byte, anyMsg *anypb.Any) (*anypb.Any, error) { msg, err := anyMsg.UnmarshalNew() if err != nil { return nil, err @@ -162,8 +210,8 @@ func (k Keeper) untypedExecute(ctx context.Context, sender []byte, anyMsg *anypb if err != nil { return nil, err } - if !bytes.Equal(sender, wantSender) { - return nil, fmt.Errorf("sender %s is not allowed to execute message %T", sender, msg) + if !bytes.Equal(wantSender, gotSender) { + return nil, fmt.Errorf("not allowed to execute message: %s", anyMsg.TypeUrl) } // we now need to fetch the response type from the request message type. // this is because the response type is not known. diff --git a/x/accounts/keeper_test.go b/x/accounts/keeper_test.go index 11530a4c72b5..1b7311c6d8ec 100644 --- a/x/accounts/keeper_test.go +++ b/x/accounts/keeper_test.go @@ -44,7 +44,7 @@ func (e eventService) EventManager(ctx context.Context) event.Manager { return e func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Keeper, context.Context) { t.Helper() ss, ctx := colltest.MockStore() - m, err := NewKeeper(ss, eventService{}, addressCodec{}, nil, nil, nil, accounts...) + m, err := NewKeeper(ss, eventService{}, nil, addressCodec{}, nil, nil, nil, accounts...) require.NoError(t, err) return m, ctx } diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 1bfb470d6510..485b5f8b0d69 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -5,6 +5,8 @@ import ( "cosmossdk.io/core/event" v1 "cosmossdk.io/x/accounts/v1" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) var ModuleAccountAddr = []byte{0x01} @@ -120,15 +122,5 @@ func (m msgServer) Execute(ctx context.Context, execute *v1.MsgExecute) (*v1.Msg } func (m msgServer) ExecuteBundle(ctx context.Context, req *v1.MsgExecuteBundle) (*v1.MsgExecuteBundleResponse, error) { - // validate bundler addr - _, err := m.k.addressCodec.StringToBytes(req.Bundler) - if err != nil { - return nil, err - } - // execute operations - responses := make([]*v1.UserOperationResponse, len(req.Operations)) - for i, op := range req.Operations { - responses[i] = m.k.ExecuteUserOperation(ctx, req.Bundler, op) - } - return &v1.MsgExecuteBundleResponse{Responses: responses}, nil + return nil, status.Error(codes.Unimplemented, "not implemented") } diff --git a/x/accounts/testing/account_abstraction/full_implementation.go b/x/accounts/testing/account_abstraction/full.go similarity index 51% rename from x/accounts/testing/account_abstraction/full_implementation.go rename to x/accounts/testing/account_abstraction/full.go index 63d368eee097..66ec4025d896 100644 --- a/x/accounts/testing/account_abstraction/full_implementation.go +++ b/x/accounts/testing/account_abstraction/full.go @@ -18,51 +18,57 @@ var ( SequencePrefix = collections.NewPrefix(1) ) -var _ accountstd.Interface = (*PartialAccount)(nil) +var _ accountstd.Interface = (*Full)(nil) -func NewPartialAccount(d accountstd.Dependencies) (PartialAccount, error) { - return PartialAccount{ +func NewFullImpl(d accountstd.Dependencies) (Full, error) { + return Full{ PubKey: collections.NewItem(d.SchemaBuilder, PubKeyPrefix, "pubkey", codec.CollValueV2[secp256k1.PubKey]()), Sequence: collections.NewItem(d.SchemaBuilder, SequencePrefix, "sequence", collections.Uint64Value), }, nil } -// PartialAccount implements the Account interface. It also -// implements the account_abstraction interface, it only implements -// the minimum methods required to be a valid account_abstraction -// implementer. -type PartialAccount struct { +// Full implements the Account interface. It also implements +// the full account abstraction interface. +type Full struct { PubKey collections.Item[*secp256k1.PubKey] Sequence collections.Item[uint64] } -func (a PartialAccount) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { +func (a Full) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { return nil, fmt.Errorf("not implemented") } -func (a PartialAccount) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { +func (a Full) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { return nil, fmt.Errorf("not implemented") } // Authenticate authenticates the account, auth always passess. -func (a PartialAccount) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { +func (a Full) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { return &account_abstractionv1.MsgAuthenticateResponse{}, nil } +func (a Full) PayBundler(ctx context.Context, msg *account_abstractionv1.MsgPayBundler) (*account_abstractionv1.MsgPayBundlerResponse, error) { + return nil, nil +} + +func (a Full) Execute(ctx context.Context, msg *account_abstractionv1.MsgExecute) (*account_abstractionv1.MsgExecuteResponse, error) { + return nil, nil +} + // QueryAuthenticateMethods queries the authentication methods of the account. -func (a PartialAccount) QueryAuthenticateMethods(ctx context.Context, req *account_abstractionv1.QueryAuthenticationMethods) (*account_abstractionv1.QueryAuthenticationMethodsResponse, error) { +func (a Full) QueryAuthenticateMethods(ctx context.Context, req *account_abstractionv1.QueryAuthenticationMethods) (*account_abstractionv1.QueryAuthenticationMethodsResponse, error) { return nil, fmt.Errorf("not implemented") } -func (a PartialAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { +func (a Full) RegisterInitHandler(builder *accountstd.InitBuilder) { accountstd.RegisterInitHandler(builder, a.Init) } -func (a PartialAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { +func (a Full) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, a.RotatePubKey) accountstd.RegisterExecuteHandler(builder, a.Authenticate) // implements account_abstraction } -func (a PartialAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { +func (a Full) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, a.QueryAuthenticateMethods) // implements account_abstraction } diff --git a/x/accounts/v1/account_abstraction.go b/x/accounts/v1/account_abstraction.go deleted file mode 100644 index c89f40b71089..000000000000 --- a/x/accounts/v1/account_abstraction.go +++ /dev/null @@ -1,32 +0,0 @@ -package v1 - -import ( - accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "google.golang.org/protobuf/types/known/anypb" -) - -func GogoUserOpToProtoV2(op *UserOperation) *accountsv1.UserOperation { - return &accountsv1.UserOperation{ - Sender: op.Sender, - AuthenticationMethod: op.AuthenticationMethod, - AuthenticationData: op.AuthenticationData, - Sequence: op.Sequence, - AuthenticationGasLimit: op.AuthenticationGasLimit, - BundlerPaymentMessages: intoProtoV2Any(op.BundlerPaymentMessages), - BundlerPaymentGasLimit: op.BundlerPaymentGasLimit, - ExecutionMessages: intoProtoV2Any(op.ExecutionMessages), - ExecutionGasLimit: op.ExecutionGasLimit, - } -} - -func intoProtoV2Any(msgs []*codectypes.Any) []*anypb.Any { - protoMsgs := make([]*anypb.Any, len(msgs)) - for i, msg := range msgs { - protoMsgs[i] = &anypb.Any{ - TypeUrl: msg.TypeUrl, - Value: msg.Value, - } - } - return protoMsgs -} diff --git a/x/accounts/v1/account_abstraction.pb.go b/x/accounts/v1/account_abstraction.pb.go index b706f7a0e290..95ebb759fca7 100644 --- a/x/accounts/v1/account_abstraction.pb.go +++ b/x/accounts/v1/account_abstraction.pb.go @@ -35,12 +35,9 @@ type UserOperation struct { // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` - // sequence defines the sequence number of the account, the authentication method might require this - // to ensure non-replayability. - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. - AuthenticationGasLimit uint64 `protobuf:"varint,5,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` + AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` // bundler_payment_messages expresses a list of messages that the account // executes to pay the bundler for submitting the UserOperation. // It can be empty if the bundler does not need any form of payment, @@ -50,18 +47,18 @@ type UserOperation struct { // - NFT payment // - IBC Token payment. // - Payment through delegations. - BundlerPaymentMessages []*types.Any `protobuf:"bytes,6,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` + BundlerPaymentMessages []*types.Any `protobuf:"bytes,5,rep,name=bundler_payment_messages,json=bundlerPaymentMessages,proto3" json:"bundler_payment_messages,omitempty"` // bundler_payment_gas_limit defines the gas limit to be used for the bundler payment. // This ensures that, since the bundler executes a list of UserOperations and there needs to // be minimal trust between bundler and UserOperation sender, the sender cannot consume // the whole bundle gas. - BundlerPaymentGasLimit uint64 `protobuf:"varint,7,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` + BundlerPaymentGasLimit uint64 `protobuf:"varint,6,opt,name=bundler_payment_gas_limit,json=bundlerPaymentGasLimit,proto3" json:"bundler_payment_gas_limit,omitempty"` // execution_messages expresses a list of messages that the account wants to execute. // This concretely is the intent of the transaction expressed as a UserOperation. - ExecutionMessages []*types.Any `protobuf:"bytes,8,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` + ExecutionMessages []*types.Any `protobuf:"bytes,7,rep,name=execution_messages,json=executionMessages,proto3" json:"execution_messages,omitempty"` // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. - ExecutionGasLimit uint64 `protobuf:"varint,9,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` } func (m *UserOperation) Reset() { *m = UserOperation{} } @@ -118,13 +115,6 @@ func (m *UserOperation) GetAuthenticationData() []byte { return nil } -func (m *UserOperation) GetSequence() uint64 { - if m != nil { - return m.Sequence - } - return 0 -} - func (m *UserOperation) GetAuthenticationGasLimit() uint64 { if m != nil { return m.AuthenticationGasLimit @@ -267,37 +257,36 @@ func init() { } var fileDescriptor_9f9bcc910ad46d4b = []byte{ - // 471 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x49, 0x6f, 0xd3, 0x40, - 0x14, 0x8e, 0xb3, 0xd1, 0x0e, 0x20, 0xc1, 0x34, 0x49, 0xa7, 0x39, 0x58, 0x51, 0x4f, 0x39, 0x54, - 0xb6, 0x4a, 0x11, 0xcb, 0x91, 0x4d, 0x5c, 0x28, 0x54, 0x96, 0x7a, 0xe1, 0x62, 0x4d, 0xec, 0x47, - 0x6a, 0x11, 0xcf, 0x84, 0x79, 0xe3, 0xaa, 0xf9, 0x17, 0xfc, 0x2c, 0x8e, 0x3d, 0x72, 0x44, 0x89, - 0xf8, 0x1f, 0x28, 0x33, 0x5e, 0xe2, 0x04, 0xe5, 0xe6, 0xa7, 0xf7, 0x6d, 0xfe, 0x66, 0x86, 0x9c, - 0x45, 0x12, 0x53, 0x89, 0x3e, 0x8f, 0x22, 0x99, 0x09, 0x8d, 0xfe, 0xed, 0x79, 0xf1, 0x1d, 0xf2, - 0x09, 0x6a, 0xc5, 0x23, 0x9d, 0x48, 0xe1, 0xcd, 0x95, 0xd4, 0x92, 0x52, 0x8b, 0xf6, 0x0a, 0xb4, - 0x77, 0x7b, 0x3e, 0x3c, 0x99, 0x4a, 0x39, 0x9d, 0x81, 0x6f, 0x10, 0x93, 0xec, 0x9b, 0xcf, 0xc5, - 0xc2, 0xc2, 0x4f, 0x57, 0x2d, 0xf2, 0xf8, 0x1a, 0x41, 0x7d, 0x99, 0x83, 0xe2, 0x6b, 0x19, 0x3a, - 0x20, 0x5d, 0x04, 0x11, 0x83, 0x62, 0xce, 0xc8, 0x19, 0x1f, 0x06, 0xf9, 0x44, 0x2f, 0x48, 0x9f, - 0x67, 0xfa, 0x06, 0x84, 0x4e, 0x22, 0x83, 0x0c, 0x53, 0xd0, 0x37, 0x32, 0x66, 0x4d, 0x03, 0xeb, - 0xd5, 0x97, 0x97, 0x66, 0x47, 0x7d, 0x72, 0xb4, 0x45, 0x8a, 0xb9, 0xe6, 0xac, 0x35, 0x72, 0xc6, - 0x8f, 0x02, 0x5a, 0x5f, 0xbd, 0xe7, 0x9a, 0xd3, 0x21, 0x39, 0x40, 0xf8, 0x91, 0x81, 0x88, 0x80, - 0xb5, 0x47, 0xce, 0xb8, 0x1d, 0x94, 0x33, 0x7d, 0x45, 0xd8, 0x96, 0xd8, 0x94, 0x63, 0x38, 0x4b, - 0xd2, 0x44, 0xb3, 0x8e, 0xc1, 0x0e, 0xea, 0xfb, 0x8f, 0x1c, 0x3f, 0xad, 0xb7, 0xf4, 0x33, 0x61, - 0x93, 0x4c, 0xc4, 0x33, 0x50, 0xe1, 0x9c, 0x2f, 0x52, 0x10, 0x3a, 0x4c, 0x01, 0x91, 0x4f, 0x01, - 0x59, 0x77, 0xd4, 0x1a, 0x3f, 0x7c, 0xd6, 0xf3, 0x6c, 0x47, 0x5e, 0xd1, 0x91, 0xf7, 0x46, 0x2c, - 0x82, 0x41, 0xce, 0xba, 0xb2, 0xa4, 0xcb, 0x9c, 0x43, 0x5f, 0x93, 0x93, 0x6d, 0xbd, 0x2a, 0xca, - 0x03, 0x1b, 0xa5, 0x4e, 0x2d, 0xa3, 0xbc, 0x23, 0x14, 0xee, 0x20, 0xca, 0xf2, 0x06, 0xf3, 0x10, - 0x07, 0x7b, 0x42, 0x3c, 0x2d, 0xf1, 0xa5, 0xbf, 0x47, 0x8e, 0x2a, 0x91, 0xca, 0xf9, 0xd0, 0x38, - 0x57, 0xf8, 0xc2, 0xf4, 0xf4, 0x6f, 0x93, 0xf4, 0x6b, 0xa7, 0x1c, 0x00, 0xce, 0xa5, 0x40, 0xa0, - 0x2f, 0xc8, 0xf1, 0x7f, 0x3a, 0xcd, 0x10, 0x62, 0x73, 0xfc, 0xed, 0xa0, 0xbf, 0x53, 0xe9, 0x35, - 0x42, 0x4c, 0x5f, 0xee, 0x36, 0x5a, 0x12, 0x9b, 0x96, 0xb8, 0x53, 0x80, 0x21, 0x5e, 0xed, 0x56, - 0xa7, 0xf2, 0x30, 0xc8, 0x5a, 0x7b, 0x6a, 0x38, 0xae, 0xeb, 0x15, 0x7f, 0x80, 0xf4, 0x6c, 0xb3, - 0xd1, 0x32, 0x84, 0xbd, 0x3c, 0x4f, 0x36, 0xbb, 0x30, 0xfe, 0x1f, 0x36, 0xab, 0xab, 0x9c, 0x3b, - 0x7b, 0x9c, 0x2b, 0xf9, 0xca, 0xb4, 0x47, 0x3a, 0xa0, 0x94, 0x54, 0xac, 0x6b, 0x6e, 0xbf, 0x1d, - 0xde, 0x3e, 0xff, 0xb5, 0x74, 0x9d, 0xfb, 0xa5, 0xeb, 0xfc, 0x59, 0xba, 0xce, 0xcf, 0x95, 0xdb, - 0xb8, 0x5f, 0xb9, 0x8d, 0xdf, 0x2b, 0xb7, 0xf1, 0x75, 0x68, 0x9f, 0x25, 0xc6, 0xdf, 0xbd, 0x44, - 0xfa, 0x77, 0x9b, 0x8f, 0x79, 0xd2, 0x35, 0x6e, 0x17, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x37, - 0x3f, 0x89, 0xed, 0xe9, 0x03, 0x00, 0x00, + // 461 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, + 0x14, 0x85, 0xe3, 0x24, 0x0d, 0x74, 0x00, 0x09, 0xa6, 0x49, 0xea, 0x76, 0x61, 0x45, 0x5d, 0x65, + 0x51, 0x8d, 0x55, 0x8a, 0xf8, 0x59, 0xf2, 0x27, 0x36, 0x14, 0x2a, 0x4b, 0xdd, 0xb0, 0xb1, 0x26, + 0xf6, 0x25, 0xb5, 0x88, 0x67, 0xa2, 0xb9, 0xe3, 0xaa, 0x79, 0x0b, 0xde, 0x0a, 0x96, 0x5d, 0xb2, + 0x44, 0x89, 0x78, 0x0f, 0x94, 0x19, 0xff, 0xc4, 0x71, 0x95, 0x5d, 0xac, 0x7b, 0xce, 0x3d, 0x27, + 0xdf, 0xcc, 0x90, 0xd3, 0x48, 0x62, 0x2a, 0xd1, 0xe7, 0x51, 0x24, 0x33, 0xa1, 0xd1, 0xbf, 0x39, + 0x2b, 0x7e, 0x87, 0x7c, 0x82, 0x5a, 0xf1, 0x48, 0x27, 0x52, 0xb0, 0xb9, 0x92, 0x5a, 0x52, 0x6a, + 0xd5, 0xac, 0x50, 0xb3, 0x9b, 0xb3, 0xe3, 0xa3, 0xa9, 0x94, 0xd3, 0x19, 0xf8, 0x46, 0x31, 0xc9, + 0xbe, 0xfb, 0x5c, 0x2c, 0xac, 0xfc, 0xe4, 0x57, 0x87, 0x3c, 0xb9, 0x42, 0x50, 0x5f, 0xe7, 0xa0, + 0xf8, 0x7a, 0x0d, 0x1d, 0x92, 0x1e, 0x82, 0x88, 0x41, 0xb9, 0xce, 0xc8, 0x19, 0xef, 0x07, 0xf9, + 0x17, 0x3d, 0x27, 0x03, 0x9e, 0xe9, 0x6b, 0x10, 0x3a, 0x89, 0x8c, 0x32, 0x4c, 0x41, 0x5f, 0xcb, + 0xd8, 0x6d, 0x1b, 0x59, 0xbf, 0x3e, 0xbc, 0x30, 0x33, 0xea, 0x93, 0x83, 0x2d, 0x53, 0xcc, 0x35, + 0x77, 0x3b, 0x23, 0x67, 0xfc, 0x38, 0xa0, 0xf5, 0xd1, 0x07, 0xae, 0x39, 0x7d, 0x4d, 0xdc, 0x2d, + 0xc3, 0x94, 0x63, 0x38, 0x4b, 0xd2, 0x44, 0xbb, 0xdd, 0x91, 0x33, 0xee, 0x06, 0xc3, 0xfa, 0xfc, + 0x13, 0xc7, 0xcf, 0xeb, 0x29, 0xfd, 0x42, 0xdc, 0x49, 0x26, 0xe2, 0x19, 0xa8, 0x70, 0xce, 0x17, + 0x29, 0x08, 0x1d, 0xa6, 0x80, 0xc8, 0xa7, 0x80, 0xee, 0xde, 0xa8, 0x33, 0x7e, 0xf4, 0xbc, 0xcf, + 0x2c, 0x07, 0x56, 0x70, 0x60, 0x6f, 0xc5, 0x22, 0x18, 0xe6, 0xae, 0x4b, 0x6b, 0xba, 0xc8, 0x3d, + 0xf4, 0x0d, 0x39, 0xda, 0xde, 0x57, 0x55, 0xe9, 0xd9, 0x2a, 0x75, 0x6b, 0x59, 0xe5, 0x3d, 0xa1, + 0x70, 0x0b, 0x51, 0x96, 0x53, 0xca, 0x4b, 0x3c, 0xd8, 0x51, 0xe2, 0x59, 0xa9, 0x2f, 0xf3, 0x19, + 0x39, 0xa8, 0x96, 0x54, 0xc9, 0x0f, 0x4d, 0x72, 0xa5, 0x2f, 0x42, 0x4f, 0xfe, 0xb5, 0xc9, 0xa0, + 0x76, 0x92, 0x01, 0xe0, 0x5c, 0x0a, 0x04, 0xfa, 0x92, 0x1c, 0xde, 0xc3, 0x34, 0x43, 0x88, 0xcd, + 0x11, 0x77, 0x83, 0x41, 0x03, 0xe9, 0x15, 0x42, 0x4c, 0x5f, 0x35, 0x89, 0x96, 0xc6, 0xb6, 0x35, + 0x36, 0x00, 0x18, 0xe3, 0x65, 0x13, 0x9d, 0xca, 0xcb, 0xa0, 0xdb, 0xd9, 0x81, 0xe1, 0xb0, 0xbe, + 0xaf, 0xf8, 0x07, 0x48, 0x4f, 0x37, 0x89, 0x96, 0x25, 0xec, 0x85, 0x78, 0xba, 0xc9, 0xc2, 0xe4, + 0x7f, 0xdc, 0x44, 0x57, 0x25, 0xef, 0xba, 0x05, 0xd5, 0xfa, 0x2a, 0xb4, 0x4f, 0xf6, 0x40, 0x29, + 0xa9, 0xcc, 0x69, 0xef, 0x07, 0xf6, 0xe3, 0xdd, 0x8b, 0xdf, 0x4b, 0xcf, 0xb9, 0x5b, 0x7a, 0xce, + 0xdf, 0xa5, 0xe7, 0xfc, 0x5c, 0x79, 0xad, 0xbb, 0x95, 0xd7, 0xfa, 0xb3, 0xf2, 0x5a, 0xdf, 0x8e, + 0xed, 0xd3, 0xc3, 0xf8, 0x07, 0x4b, 0xa4, 0x7f, 0xbb, 0xf9, 0x60, 0x27, 0x3d, 0x93, 0x76, 0xfe, + 0x3f, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xb6, 0x1b, 0x5c, 0xcd, 0x03, 0x00, 0x00, } func (m *UserOperation) Marshal() (dAtA []byte, err error) { @@ -323,7 +312,7 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.ExecutionGasLimit != 0 { i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.ExecutionGasLimit)) i-- - dAtA[i] = 0x48 + dAtA[i] = 0x40 } if len(m.ExecutionMessages) > 0 { for iNdEx := len(m.ExecutionMessages) - 1; iNdEx >= 0; iNdEx-- { @@ -336,13 +325,13 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x3a } } if m.BundlerPaymentGasLimit != 0 { i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.BundlerPaymentGasLimit)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if len(m.BundlerPaymentMessages) > 0 { for iNdEx := len(m.BundlerPaymentMessages) - 1; iNdEx >= 0; iNdEx-- { @@ -355,17 +344,12 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } } if m.AuthenticationGasLimit != 0 { i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.AuthenticationGasLimit)) i-- - dAtA[i] = 0x28 - } - if m.Sequence != 0 { - i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.Sequence)) - i-- dAtA[i] = 0x20 } if len(m.AuthenticationData) > 0 { @@ -494,9 +478,6 @@ func (m *UserOperation) Size() (n int) { if l > 0 { n += 1 + l + sovAccountAbstraction(uint64(l)) } - if m.Sequence != 0 { - n += 1 + sovAccountAbstraction(uint64(m.Sequence)) - } if m.AuthenticationGasLimit != 0 { n += 1 + sovAccountAbstraction(uint64(m.AuthenticationGasLimit)) } @@ -689,25 +670,6 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAccountAbstraction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationGasLimit", wireType) } @@ -726,7 +688,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { break } } - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentMessages", wireType) } @@ -760,7 +722,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BundlerPaymentGasLimit", wireType) } @@ -779,7 +741,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { break } } - case 8: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExecutionMessages", wireType) } @@ -813,7 +775,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExecutionGasLimit", wireType) } From b620597470458b20fffab1432f15544c87b4a541 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Fri, 17 Nov 2023 17:30:25 +0100 Subject: [PATCH 08/19] refactors and cleanups --- .../e2e/accounts/account_abstraction_test.go | 7 +- x/accounts/accountstd/exports.go | 21 +++ x/accounts/genesis_test.go | 7 +- x/accounts/internal/implementation/context.go | 49 ++--- .../internal/implementation/context_test.go | 27 ++- x/accounts/keeper.go | 168 ++++++++++++------ x/accounts/keeper_account_abstraction.go | 67 ++----- x/accounts/keeper_test.go | 56 ++---- x/accounts/msg_server_test.go | 5 +- x/accounts/query_server_test.go | 5 +- .../testing/account_abstraction/full.go | 36 +++- x/accounts/utils_test.go | 79 ++++++++ 12 files changed, 318 insertions(+), 209 deletions(-) create mode 100644 x/accounts/utils_test.go diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index 0ae3fba04544..f3d4e8097d7d 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -11,6 +11,7 @@ import ( dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" @@ -26,7 +27,7 @@ var ( func TestAccountAbstraction(t *testing.T) { app := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) ak := app.AccountsKeeper - ctx := app.NewContext(false) + ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()) _, aaAddr, err := ak.Init(ctx, "aa_full", accCreator, &rotationv1.MsgInit{ PubKeyBytes: privKey.PubKey().Bytes(), @@ -43,13 +44,13 @@ func TestAccountAbstraction(t *testing.T) { AuthenticationData: []byte("signature"), AuthenticationGasLimit: 10000, BundlerPaymentMessages: nil, - BundlerPaymentGasLimit: 0, + BundlerPaymentGasLimit: 10000, ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ FromAddress: "", ToAddress: "", Amount: nil, }), - ExecutionGasLimit: 0, + ExecutionGasLimit: 10000, }) t.Log(resp.String()) }) diff --git a/x/accounts/accountstd/exports.go b/x/accounts/accountstd/exports.go index e2332b19ad28..a966fba8c332 100644 --- a/x/accounts/accountstd/exports.go +++ b/x/accounts/accountstd/exports.go @@ -3,8 +3,11 @@ package accountstd import ( "context" + "fmt" "cosmossdk.io/x/accounts/internal/implementation" + "github.com/cosmos/cosmos-proto/anyutil" + "google.golang.org/protobuf/types/known/anypb" ) // Interface is the exported interface of an Account. @@ -72,3 +75,21 @@ func ExecModule[Resp any, RespProto implementation.ProtoMsg[Resp], Req any, ReqP func QueryModule[Resp any, RespProto implementation.ProtoMsg[Resp], Req any, ReqProto implementation.ProtoMsg[Req]](ctx context.Context, req ReqProto) (RespProto, error) { return implementation.QueryModule[Resp, RespProto, Req, ReqProto](ctx, req) } + +// UnpackAny unpacks a protobuf Any message generically. +func UnpackAny[Msg any, ProtoMsg implementation.ProtoMsg[Msg]](any *anypb.Any) (*Msg, error) { + msg, err := any.UnmarshalNew() + if err != nil { + return nil, err + } + concrete, ok := msg.(ProtoMsg) + if !ok { + return nil, fmt.Errorf("expected %T, got %T", concrete, msg) + } + return concrete, nil +} + +// PackAny packs a protobuf Any message generically. +func PackAny[Msg any, ProtoMsg implementation.ProtoMsg[Msg]](msg *Msg) (*anypb.Any, error) { + return anyutil.New(ProtoMsg(msg)) +} diff --git a/x/accounts/genesis_test.go b/x/accounts/genesis_test.go index 7e9d0aac46ce..1edafbf5a833 100644 --- a/x/accounts/genesis_test.go +++ b/x/accounts/genesis_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/runtime/protoiface" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/wrapperspb" @@ -15,10 +15,7 @@ import ( func TestGenesis(t *testing.T) { k, ctx := newKeeper(t, implementation.AddAccount("test", NewTestAccount)) - k.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { - return nil - } - + k.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { return nil }) // we init two accounts of the same type // we set counter to 10 diff --git a/x/accounts/internal/implementation/context.go b/x/accounts/internal/implementation/context.go index 5054f210691e..4f9434ff3b7a 100644 --- a/x/accounts/internal/implementation/context.go +++ b/x/accounts/internal/implementation/context.go @@ -1,16 +1,13 @@ package implementation import ( - "bytes" "context" "errors" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" - "cosmossdk.io/collections" "cosmossdk.io/core/store" "cosmossdk.io/x/accounts/internal/prefixstore" + "google.golang.org/protobuf/proto" ) var ( @@ -19,20 +16,21 @@ var ( ) type ( - ModuleExecFunc = func(ctx context.Context, msg, msgResp protoiface.MessageV1) error - ModuleQueryFunc = ModuleExecFunc + ModuleExecUntypedFunc = func(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) + ModuleExecFunc = func(ctx context.Context, sender []byte, msg, msgResp proto.Message) error + ModuleQueryFunc = func(ctx context.Context, queryReq, queryResp proto.Message) error ) type contextKey struct{} type contextValue struct { - store store.KVStore // store is the prefixed store for the account. - sender []byte // sender is the address of the entity invoking the account action. - whoami []byte // whoami is the address of the account being invoked. - originalContext context.Context // originalContext that was used to build the account context. - getExpectedSender func(msg proto.Message) ([]byte, error) // getExpectedSender is a function that returns the expected sender for a given message. - moduleExec ModuleExecFunc // moduleExec is a function that executes a module message. - moduleQuery ModuleQueryFunc // moduleQuery is a function that queries a module. + store store.KVStore // store is the prefixed store for the account. + sender []byte // sender is the address of the entity invoking the account action. + whoami []byte // whoami is the address of the account being invoked. + originalContext context.Context // originalContext that was used to build the account context. + moduleExec ModuleExecFunc // moduleExec is a function that executes a module message, when the resp type is known. + moduleExecUntyped ModuleExecUntypedFunc // moduleExecUntyped is a function that executes a module message, when the resp type is unknown. + moduleQuery ModuleQueryFunc // moduleQuery is a function that queries a module. } // MakeAccountContext creates a new account execution context given: @@ -47,8 +45,8 @@ func MakeAccountContext( storeSvc store.KVStoreService, accountAddr, sender []byte, - getSenderFunc func(msg proto.Message) ([]byte, error), moduleExec ModuleExecFunc, + moduleExecUntyped ModuleExecUntypedFunc, moduleQuery ModuleQueryFunc, ) context.Context { return context.WithValue(ctx, contextKey{}, contextValue{ @@ -56,28 +54,33 @@ func MakeAccountContext( sender: sender, whoami: accountAddr, originalContext: ctx, - getExpectedSender: getSenderFunc, + moduleExecUntyped: moduleExecUntyped, moduleExec: moduleExec, moduleQuery: moduleQuery, }) } -// ExecModule can be used to execute a message towards a module. -func ExecModule[Resp any, RespProto ProtoMsg[Resp], Req any, ReqProto ProtoMsg[Req]](ctx context.Context, msg ReqProto) (RespProto, error) { +// ExecModuleUntyped can be used to execute a message towards a module, when the response type is unknown. +func ExecModuleUntyped(ctx context.Context, msg proto.Message) (proto.Message, error) { // get sender v := ctx.Value(contextKey{}).(contextValue) - // check sender - expectedSender, err := v.getExpectedSender(msg) + + resp, err := v.moduleExecUntyped(v.originalContext, v.whoami, msg) if err != nil { return nil, err } - if !bytes.Equal(expectedSender, v.whoami) { - return nil, errUnauthorized - } + + return resp, nil +} + +// ExecModule can be used to execute a message towards a module. +func ExecModule[Resp any, RespProto ProtoMsg[Resp], Req any, ReqProto ProtoMsg[Req]](ctx context.Context, msg ReqProto) (RespProto, error) { + // get sender + v := ctx.Value(contextKey{}).(contextValue) // execute module, unwrapping the original context. resp := RespProto(new(Resp)) - err = v.moduleExec(v.originalContext, msg, resp) + err := v.moduleExec(v.originalContext, v.whoami, msg, resp) if err != nil { return nil, err } diff --git a/x/accounts/internal/implementation/context_test.go b/x/accounts/internal/implementation/context_test.go index 563b1f3cf4f2..8b986f65ac1f 100644 --- a/x/accounts/internal/implementation/context_test.go +++ b/x/accounts/internal/implementation/context_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/wrapperspb" "cosmossdk.io/collections" @@ -44,31 +43,31 @@ func TestMakeAccountContext(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0, 0, 0, 0, 0, 0, 3, 232}, value) - // ensure getSenderAccount blocks impersonation - accountCtx = MakeAccountContext(originalContext, storeService, []byte("impersonator"), []byte("account-invoker"), func(_ proto.Message) ([]byte, error) { - return []byte("legit-exec-module"), nil - }, nil, nil) - - _, err = ExecModule[wrapperspb.StringValue](accountCtx, &wrapperspb.UInt64Value{Value: 1000}) - require.ErrorIs(t, err, errUnauthorized) - // ensure calling ExecModule works - accountCtx = MakeAccountContext(originalContext, storeService, []byte("legit-exec-module"), []byte("invoker"), func(_ proto.Message) ([]byte, error) { - return []byte("legit-exec-module"), nil - }, func(ctx context.Context, msg, msgResp protoiface.MessageV1) error { + accountCtx = MakeAccountContext(originalContext, storeService, []byte("legit-exec-module"), []byte("invoker"), func(ctx context.Context, sender []byte, msg, msgResp proto.Message) error { // ensure we unwrapped the context when invoking a module call require.Equal(t, originalContext, ctx) proto.Merge(msgResp.(proto.Message), &wrapperspb.StringValue{Value: "module exec was called"}) return nil - }, nil) + }, nil, nil) resp, err := ExecModule[wrapperspb.StringValue](accountCtx, &wrapperspb.UInt64Value{Value: 1000}) require.NoError(t, err) require.True(t, proto.Equal(wrapperspb.String("module exec was called"), resp)) + // ensure calling ExecModuleUntyped works + accountCtx = MakeAccountContext(originalContext, storeService, []byte("legit-exec-module-untyped"), []byte("invoker"), nil, func(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) { + require.Equal(t, originalContext, ctx) + return &wrapperspb.StringValue{Value: "module exec untyped was called"}, nil + }, nil) + + respUntyped, err := ExecModuleUntyped(accountCtx, &wrapperspb.UInt64Value{Value: 1000}) + require.NoError(t, err) + require.True(t, proto.Equal(wrapperspb.String("module exec untyped was called"), respUntyped)) + // ensure calling QueryModule works, also by setting everything else communication related to nil // we can guarantee that exec paths do not impact query paths. - accountCtx = MakeAccountContext(originalContext, storeService, nil, nil, nil, nil, func(ctx context.Context, req, resp protoiface.MessageV1) error { + accountCtx = MakeAccountContext(originalContext, storeService, nil, nil, nil, nil, func(ctx context.Context, req, resp proto.Message) error { require.Equal(t, originalContext, ctx) proto.Merge(resp.(proto.Message), wrapperspb.String("module query was called")) return nil diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 0eea0618e67d..f2397820ecb8 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -1,6 +1,7 @@ package accounts import ( + "bytes" "context" "crypto/sha256" "encoding/binary" @@ -8,8 +9,12 @@ import ( "fmt" "cosmossdk.io/core/branch" + "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" + "google.golang.org/protobuf/types/known/anypb" "cosmossdk.io/collections" "cosmossdk.io/core/address" @@ -66,45 +71,18 @@ func NewKeeper( ) (Keeper, error) { sb := collections.NewSchemaBuilder(ss) keeper := Keeper{ - storeService: ss, - eventService: es, - branchExecutor: bs, - addressCodec: addressCodec, - getSenderFunc: func(msg proto.Message) ([]byte, error) { - signers, err := signerProvider.GetSigners(msg) - if err != nil { - return nil, err - } - if len(signers) != 1 { - return nil, fmt.Errorf("expected 1 signer, got %d", len(signers)) - } - return signers[0], nil - }, - execModuleFunc: func(ctx context.Context, msg, msgResp protoiface.MessageV1) error { - name := getMessageName(msg) - handler := execRouter.HybridHandlerByMsgName(name) - if handler == nil { - return fmt.Errorf("no handler found for message %s", name) - } - return handler(ctx, msg, msgResp) - }, - queryModuleFunc: func(ctx context.Context, req, resp protoiface.MessageV1) error { - name := getMessageName(req) - handlers := queryRouter.HybridHandlerByRequestName(name) - if len(handlers) == 0 { - return fmt.Errorf("no handler found for query request %s", name) - } - if len(handlers) > 1 { - return fmt.Errorf("multiple handlers found for query request %s", name) - } - return handlers[0](ctx, req, resp) - }, - msgResponseFromRequestName: func(name string) string { return execRouter.ResponseByRequestName(name) }, - Schema: collections.Schema{}, - AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), - AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), - AccountByNumber: collections.NewMap(sb, AccountByNumber, "account_by_number", collections.BytesKey, collections.Uint64Value), - AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), + storeService: ss, + eventService: es, + branchExecutor: bs, + addressCodec: addressCodec, + signerProvider: signerProvider, + msgRouter: execRouter, + queryRouter: queryRouter, + Schema: collections.Schema{}, + AccountNumber: collections.NewSequence(sb, AccountNumberKey, "account_number"), + AccountsByType: collections.NewMap(sb, AccountTypeKeyPrefix, "accounts_by_type", collections.BytesKey, collections.StringValue), + AccountByNumber: collections.NewMap(sb, AccountByNumber, "account_by_number", collections.BytesKey, collections.Uint64Value), + AccountsState: collections.NewMap(sb, implementation.AccountStatePrefix, "accounts_state", collections.BytesKey, collections.BytesValue), } schema, err := sb.Build() @@ -121,14 +99,13 @@ func NewKeeper( type Keeper struct { // deps coming from the runtime - storeService store.KVStoreService - eventService event.Service - addressCodec address.Codec - getSenderFunc func(msg proto.Message) ([]byte, error) - execModuleFunc implementation.ModuleExecFunc - queryModuleFunc implementation.ModuleQueryFunc - branchExecutor BranchExecutor - msgResponseFromRequestName func(name string) string // msgResponseFromRequestName returns the response name for a given request name. + storeService store.KVStoreService + eventService event.Service + addressCodec address.Codec + branchExecutor BranchExecutor + msgRouter MsgRouter + signerProvider SignerProvider + queryRouter QueryRouter accounts map[string]implementation.Implementation @@ -266,9 +243,9 @@ func (k Keeper) makeAccountContext(ctx context.Context, accountAddr, sender []by k.storeService, accountAddr, sender, - k.getSenderFunc, - k.execModuleFunc, - k.queryModuleFunc, + k.sendModuleMessage, + k.sendModuleMessageUntyped, + k.queryModule, ) } @@ -279,16 +256,97 @@ func (k Keeper) makeAccountContext(ctx context.Context, accountAddr, sender []by k.storeService, accountAddr, nil, - func(_ proto.Message) ([]byte, error) { - return nil, fmt.Errorf("cannot get sender from query") + func(ctx context.Context, sender []byte, msg, msgResp proto.Message) error { + return fmt.Errorf("cannot execute in query context") }, - func(ctx context.Context, msg, msgResp protoiface.MessageV1) error { - return fmt.Errorf("cannot execute module from a query execution context") + func(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) { + return nil, fmt.Errorf("cannot execute in query context") }, - k.queryModuleFunc, + k.queryModule, ) } +// sendAnyMessages it a helper function that executes untyped anypb.Any messages +// The messages must all belong to a module. +func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages []*anypb.Any) ([]*anypb.Any, error) { + anyResponses := make([]*anypb.Any, len(anyMessages)) + for i := range anyMessages { + msg, err := anyMessages[i].UnmarshalNew() + if err != nil { + return nil, err + } + resp, err := k.sendModuleMessageUntyped(ctx, sender, msg) + if err != nil { + return nil, fmt.Errorf("failed to execute message %d: %s", i, err.Error()) + } + anyResp, err := anyutil.New(resp) + if err != nil { + return nil, err + } + anyResponses[i] = anyResp + } + return anyResponses, nil +} + +// sendModuleMessageUntyped can be used to send a message towards a module. +// It should be used when the response type is not known by the caller. +func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) { + // we need to fetch the response type from the request message type. + // this is because the response type is not known. + respName := k.msgRouter.ResponseByRequestName(string(msg.ProtoReflect().Descriptor().FullName())) + if respName == "" { + return nil, fmt.Errorf("could not find response type for message %T", msg) + } + // get response type + respType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(respName)) + if err != nil { + return nil, err + } + resp := respType.New().Interface() + // send the message + return resp, k.sendModuleMessage(ctx, sender, msg, resp) +} + +// sendModuleMessage can be used to send a message towards a module. It expects the +// response type to be known by the caller. It will also assert the sender has the right +// is not trying to impersonate another account. +func (k Keeper) sendModuleMessage(ctx context.Context, sender []byte, msg, msgResp proto.Message) error { + // do sender assertions. + wantSenders, err := k.signerProvider.GetSigners(msg) + if err != nil { + return fmt.Errorf("cannot get signers: %w", err) + } + if len(wantSenders) != 1 { + return fmt.Errorf("expected only one signer, got %d", len(wantSenders)) + } + if !bytes.Equal(sender, wantSenders[0]) { + return fmt.Errorf("sender is not authorized to send this message") + } + msgV1, msgRespV1 := msg.(protoiface.MessageV1), msgResp.(protoiface.MessageV1) + messageName := getMessageName(msgV1) + handler := k.msgRouter.HybridHandlerByMsgName(messageName) + if handler == nil { + return fmt.Errorf("unknown message: %s", messageName) + } + return handler(ctx, msgV1, msgRespV1) +} + +// queryModule is the entrypoint for an account to query a module. +// It will try to find the query handler for the given query and execute it. +// If multiple query handlers are found, it will return an error. +func (k Keeper) queryModule(ctx context.Context, queryReq, queryResp proto.Message) error { + queryReqV1, queryRespV1 := queryReq.(protoiface.MessageV1), queryResp.(protoiface.MessageV1) + queryName := getMessageName(queryReqV1) + handlers := k.queryRouter.HybridHandlerByRequestName(queryName) + if len(handlers) == 0 { + return fmt.Errorf("unknown query: %s", queryName) + } + if len(handlers) > 1 { + return fmt.Errorf("multiple handlers for query: %s", queryName) + } + return handlers[0](ctx, queryReqV1, queryRespV1) +} + func getMessageName(msg protoiface.MessageV1) string { return codectypes.MsgTypeURL(msg)[1:] } diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index a9574ce46d95..17f4d423e898 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -1,16 +1,12 @@ package accounts import ( - "bytes" "context" "fmt" account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" "cosmossdk.io/x/accounts/internal/implementation" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/anypb" ) @@ -127,7 +123,7 @@ func (k Keeper) opExecuteMessages( case implementation.IsRoutingError(err): // if it is a routing error, it means the account does not handle execution messages, // in this case we attempt to execute the provided messages on behalf of the op sender. - return k.sendMessages(ctx, senderAddr, op.ExecutionMessages) + return k.sendAnyMessages(ctx, senderAddr, op.ExecutionMessages) default: // some other error return nil, err @@ -159,6 +155,11 @@ func (k Keeper) payBundler( bundler string, op *accountsv1.UserOperation, ) (paymentResponses []*anypb.Any, err error) { + // if messages are empty, then there is nothing to do + if len(op.BundlerPaymentMessages) == 0 { + return nil, nil + } + // pay bundler senderAddr, err := k.addressCodec.StringToBytes(op.Sender) if err != nil { return nil, err @@ -177,66 +178,21 @@ func (k Keeper) payBundler( case implementation.IsRoutingError(err): // if we get a routing message error it means the account does not handle bundler payment messages, // in this case we attempt to execute the provided messages on behalf of the op sender. - return k.sendMessages(ctx, senderAddr, op.BundlerPaymentMessages) + return k.sendAnyMessages(ctx, senderAddr, op.BundlerPaymentMessages) default: // some other execution error. return nil, err } } -// sendMessages attempts to execute the provided messages on behalf of the op sender. -// It returns the responses of the messages in the same order as the provided messages. -func (k Keeper) sendMessages(ctx context.Context, sender []byte, messages []*anypb.Any) ([]*anypb.Any, error) { - responses := make([]*anypb.Any, len(messages)) - for i, msg := range messages { - resp, err := k.untypedExecute(ctx, sender, msg) - if err != nil { - return nil, fmt.Errorf("failed to execute bundler payment message %d: %s", i, err.Error()) - } - responses[i] = resp - } - return responses, nil -} - -// untypedExecute executes a protobuf message without knowing the response type. -// It will check if the sender is allowed to execute the message and then execute it. -func (k Keeper) untypedExecute(ctx context.Context, gotSender []byte, anyMsg *anypb.Any) (*anypb.Any, error) { - msg, err := anyMsg.UnmarshalNew() - if err != nil { - return nil, err - } - // we check if the sender is allowed to execute the message. - wantSender, err := k.getSenderFunc(msg) - if err != nil { - return nil, err - } - if !bytes.Equal(wantSender, gotSender) { - return nil, fmt.Errorf("not allowed to execute message: %s", anyMsg.TypeUrl) - } - // we now need to fetch the response type from the request message type. - // this is because the response type is not known. - respName := k.msgResponseFromRequestName(string(msg.ProtoReflect().Descriptor().FullName())) - if respName == "" { - return nil, fmt.Errorf("could not find response type for message %T", msg) - } - // get response type - respType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(respName)) - if err != nil { - return nil, err - } - resp := respType.New().Interface() - err = k.execModuleFunc(ctx, msg.(protoiface.MessageV1), resp.(protoiface.MessageV1)) - if err != nil { - return nil, err - } - return anypb.New(resp) -} - // parsePayBundlerResponse parses the bundler response as any into a slice of // responses on payment messages. func parsePayBundlerResponse(resp any) ([]*anypb.Any, error) { payBundlerResp, ok := resp.(*account_abstractionv1.MsgPayBundlerResponse) // this means the account does not properly implement account abstraction. + if payBundlerResp == nil { + return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got nil", &account_abstractionv1.MsgPayBundlerResponse{}) + } if !ok { return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got %T", &account_abstractionv1.MsgPayBundlerResponse{}, resp) } @@ -248,6 +204,9 @@ func parsePayBundlerResponse(resp any) ([]*anypb.Any, error) { func parseExecuteResponse(resp any) ([]*anypb.Any, error) { executeResp, ok := resp.(*account_abstractionv1.MsgExecuteResponse) // this means the account does not properly implement account abstraction. + if executeResp == nil { + return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got nil", &account_abstractionv1.MsgExecuteResponse{}) + } if !ok { return nil, fmt.Errorf("account does not implement account abstraction correctly: wanted %T, got %T", &account_abstractionv1.MsgExecuteResponse{}, resp) } diff --git a/x/accounts/keeper_test.go b/x/accounts/keeper_test.go index 1b7311c6d8ec..8f75926cf318 100644 --- a/x/accounts/keeper_test.go +++ b/x/accounts/keeper_test.go @@ -6,58 +6,24 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/wrapperspb" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/collections" - "cosmossdk.io/collections/colltest" - "cosmossdk.io/core/address" - "cosmossdk.io/core/event" "cosmossdk.io/x/accounts/accountstd" - "cosmossdk.io/x/accounts/internal/implementation" ) -var _ address.Codec = (*addressCodec)(nil) - -type addressCodec struct{} - -func (a addressCodec) StringToBytes(text string) ([]byte, error) { return []byte(text), nil } -func (a addressCodec) BytesToString(bz []byte) (string, error) { return string(bz), nil } - -type eventService struct{} - -func (e eventService) Emit(ctx context.Context, event protoiface.MessageV1) error { return nil } - -func (e eventService) EmitKV(ctx context.Context, eventType string, attrs ...event.Attribute) error { - return nil -} - -func (e eventService) EmitNonConsensus(ctx context.Context, event protoiface.MessageV1) error { - return nil -} - -func (e eventService) EventManager(ctx context.Context) event.Manager { return e } - -func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Keeper, context.Context) { - t.Helper() - ss, ctx := colltest.MockStore() - m, err := NewKeeper(ss, eventService{}, nil, addressCodec{}, nil, nil, nil, accounts...) - require.NoError(t, err) - return m, ctx -} - func TestKeeper_Init(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { + m.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { _, ok := req.(*bankv1beta1.QueryBalanceRequest) require.True(t, ok) _, ok = resp.(*bankv1beta1.QueryBalanceResponse) require.True(t, ok) return nil - } + }) t.Run("ok", func(t *testing.T) { sender := []byte("sender") @@ -86,7 +52,7 @@ func TestKeeper_Init(t *testing.T) { func TestKeeper_Execute(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { return nil } + m.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { return nil }) // create account sender := []byte("sender") @@ -105,19 +71,19 @@ func TestKeeper_Execute(t *testing.T) { }) t.Run("exec module", func(t *testing.T) { - m.execModuleFunc = func(ctx context.Context, msg, msgResp protoiface.MessageV1) error { + m.msgRouter = mockExec(func(ctx context.Context, msg, msgResp proto.Message) error { concrete, ok := msg.(*bankv1beta1.MsgSend) require.True(t, ok) require.Equal(t, concrete.ToAddress, "recipient") _, ok = msgResp.(*bankv1beta1.MsgSendResponse) require.True(t, ok) return nil - } + }) - m.getSenderFunc = func(msg proto.Message) ([]byte, error) { + m.signerProvider = mockSigner(func(msg proto.Message) ([]byte, error) { require.Equal(t, msg.(*bankv1beta1.MsgSend).FromAddress, string(accAddr)) return accAddr, nil - } + }) resp, err := m.Execute(ctx, accAddr, sender, &wrapperspb.Int64Value{Value: 1000}) require.NoError(t, err) @@ -127,9 +93,9 @@ func TestKeeper_Execute(t *testing.T) { func TestKeeper_Query(t *testing.T) { m, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - m.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { + m.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { return nil - } + }) // create account sender := []byte("sender") @@ -150,7 +116,7 @@ func TestKeeper_Query(t *testing.T) { t.Run("query module", func(t *testing.T) { // we inject the module query function, which accepts only a specific type of message // we force the response - m.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { + m.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { concrete, ok := req.(*bankv1beta1.QueryBalanceRequest) require.True(t, ok) require.Equal(t, string(accAddr), concrete.Address) @@ -161,7 +127,7 @@ func TestKeeper_Query(t *testing.T) { }} proto.Merge(resp.(proto.Message), copyResp) return nil - } + }) resp, err := m.Query(ctx, accAddr, wrapperspb.String("atom")) require.NoError(t, err) diff --git a/x/accounts/msg_server_test.go b/x/accounts/msg_server_test.go index 925670ccfa45..0194b0105a69 100644 --- a/x/accounts/msg_server_test.go +++ b/x/accounts/msg_server_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/wrapperspb" @@ -18,12 +17,12 @@ import ( func TestMsgServer(t *testing.T) { k, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - k.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { + k.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { _, ok := req.(*bankv1beta1.QueryBalanceRequest) require.True(t, ok) proto.Merge(resp.(proto.Message), &bankv1beta1.QueryBalanceResponse{}) return nil - } + }) s := NewMsgServer(k) diff --git a/x/accounts/query_server_test.go b/x/accounts/query_server_test.go index 6aff2def1c11..6b091918cede 100644 --- a/x/accounts/query_server_test.go +++ b/x/accounts/query_server_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/wrapperspb" @@ -17,9 +16,9 @@ import ( func TestQueryServer(t *testing.T) { k, ctx := newKeeper(t, accountstd.AddAccount("test", NewTestAccount)) - k.queryModuleFunc = func(ctx context.Context, req, resp protoiface.MessageV1) error { + k.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { return nil - } + }) ms := NewMsgServer(k) qs := NewQueryServer(k) diff --git a/x/accounts/testing/account_abstraction/full.go b/x/accounts/testing/account_abstraction/full.go index 66ec4025d896..4fb974fc7750 100644 --- a/x/accounts/testing/account_abstraction/full.go +++ b/x/accounts/testing/account_abstraction/full.go @@ -6,9 +6,11 @@ import ( account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "cosmossdk.io/api/cosmos/crypto/secp256k1" "cosmossdk.io/collections" "cosmossdk.io/x/accounts/accountstd" + "google.golang.org/protobuf/types/known/anypb" "github.com/cosmos/cosmos-sdk/codec" ) @@ -23,7 +25,7 @@ var _ accountstd.Interface = (*Full)(nil) func NewFullImpl(d accountstd.Dependencies) (Full, error) { return Full{ PubKey: collections.NewItem(d.SchemaBuilder, PubKeyPrefix, "pubkey", codec.CollValueV2[secp256k1.PubKey]()), - Sequence: collections.NewItem(d.SchemaBuilder, SequencePrefix, "sequence", collections.Uint64Value), + Sequence: collections.NewSequence(d.SchemaBuilder, SequencePrefix, "sequence"), }, nil } @@ -31,11 +33,11 @@ func NewFullImpl(d accountstd.Dependencies) (Full, error) { // the full account abstraction interface. type Full struct { PubKey collections.Item[*secp256k1.PubKey] - Sequence collections.Item[uint64] + Sequence collections.Sequence } func (a Full) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { - return nil, fmt.Errorf("not implemented") + return nil, a.PubKey.Set(ctx, &secp256k1.PubKey{Key: msg.PubKeyBytes}) } func (a Full) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { @@ -48,10 +50,34 @@ func (a Full) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthen } func (a Full) PayBundler(ctx context.Context, msg *account_abstractionv1.MsgPayBundler) (*account_abstractionv1.MsgPayBundlerResponse, error) { - return nil, nil + // we force this account to pay the bundler only using a bank send. + if len(msg.BundlerPaymentMessages) != 1 { + return nil, fmt.Errorf("expected one bundler payment message") + } + bankSend, err := accountstd.UnpackAny[bankv1beta1.MsgSend](msg.BundlerPaymentMessages[0]) + if err != nil { + return nil, err + } + if bankSend.FromAddress == "" { + bankSend.FromAddress = msg.Bundler + } + + resp, err := accountstd.ExecModule[bankv1beta1.MsgSendResponse](ctx, bankSend) + if err != nil { + return nil, err + } + + anyResp, err := accountstd.PackAny[bankv1beta1.MsgSendResponse](resp) + if err != nil { + return nil, err + } + return &account_abstractionv1.MsgPayBundlerResponse{ + BundlerPaymentMessagesResponse: []*anypb.Any{anyResp}, + }, nil } func (a Full) Execute(ctx context.Context, msg *account_abstractionv1.MsgExecute) (*account_abstractionv1.MsgExecuteResponse, error) { + // the execute method does ... nothing, just proxies back the requests return nil, nil } @@ -67,6 +93,8 @@ func (a Full) RegisterInitHandler(builder *accountstd.InitBuilder) { func (a Full) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, a.RotatePubKey) accountstd.RegisterExecuteHandler(builder, a.Authenticate) // implements account_abstraction + accountstd.RegisterExecuteHandler(builder, a.PayBundler) // implements account_abstraction + accountstd.RegisterExecuteHandler(builder, a.Execute) // implements account_abstraction } func (a Full) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go new file mode 100644 index 000000000000..847f7060c1d7 --- /dev/null +++ b/x/accounts/utils_test.go @@ -0,0 +1,79 @@ +package accounts + +import ( + "context" + "testing" + + "cosmossdk.io/collections/colltest" + "cosmossdk.io/core/address" + "cosmossdk.io/core/event" + "cosmossdk.io/x/accounts/internal/implementation" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoiface" +) + +var _ address.Codec = (*addressCodec)(nil) + +type addressCodec struct{} + +func (a addressCodec) StringToBytes(text string) ([]byte, error) { return []byte(text), nil } +func (a addressCodec) BytesToString(bz []byte) (string, error) { return string(bz), nil } + +type eventService struct{} + +func (e eventService) Emit(ctx context.Context, event protoiface.MessageV1) error { return nil } + +func (e eventService) EmitKV(ctx context.Context, eventType string, attrs ...event.Attribute) error { + return nil +} + +func (e eventService) EmitNonConsensus(ctx context.Context, event protoiface.MessageV1) error { + return nil +} + +func (e eventService) EventManager(ctx context.Context) event.Manager { return e } + +func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Keeper, context.Context) { + t.Helper() + ss, ctx := colltest.MockStore() + m, err := NewKeeper(ss, eventService{}, nil, addressCodec{}, nil, nil, nil, accounts...) + require.NoError(t, err) + return m, ctx +} + +var _ QueryRouter = (*mockQuery)(nil) + +type mockQuery func(ctx context.Context, req, resp proto.Message) error + +func (m mockQuery) HybridHandlerByRequestName(_ string) []func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { + return []func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error{func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { + return m(ctx, req.(proto.Message), resp.(proto.Message)) + }} +} + +var _ SignerProvider = (*mockSigner)(nil) + +type mockSigner func(msg proto.Message) ([]byte, error) + +func (m mockSigner) GetSigners(msg proto.Message) ([][]byte, error) { + s, err := m(msg) + if err != nil { + return nil, err + } + return [][]byte{s}, nil +} + +var _ MsgRouter = (*mockExec)(nil) + +type mockExec func(ctx context.Context, msg proto.Message, msgResp proto.Message) error + +func (m mockExec) HybridHandlerByMsgName(_ string) func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { + return func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { + return m(ctx, req.(proto.Message), resp.(proto.Message)) + } +} + +func (m mockExec) ResponseByRequestName(name string) string { + return name + "Response" +} From 4fc24a73d1d313e5cf9cd6c7f1eba28ffb227aa1 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Fri, 17 Nov 2023 17:49:17 +0100 Subject: [PATCH 09/19] full=>minimal --- simapp/app.go | 2 +- .../testing/account_abstraction/full.go | 102 ------------------ .../testing/account_abstraction/minimal.go | 65 +++++++++++ 3 files changed, 66 insertions(+), 103 deletions(-) delete mode 100644 x/accounts/testing/account_abstraction/full.go create mode 100644 x/accounts/testing/account_abstraction/minimal.go diff --git a/simapp/app.go b/simapp/app.go index 34b1be605b21..b4d45e948b24 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -291,7 +291,7 @@ func NewSimApp( app.MsgServiceRouter(), app.GRPCQueryRouter(), accountstd.AddAccount("counter", counter.NewAccount), - accountstd.AddAccount("aa_full", account_abstraction.NewFullImpl), + accountstd.AddAccount("aa_full", account_abstraction.NewMinimalAbstractedAccount), ) if err != nil { panic(err) diff --git a/x/accounts/testing/account_abstraction/full.go b/x/accounts/testing/account_abstraction/full.go deleted file mode 100644 index 4fb974fc7750..000000000000 --- a/x/accounts/testing/account_abstraction/full.go +++ /dev/null @@ -1,102 +0,0 @@ -package account_abstraction - -import ( - "context" - "fmt" - - account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" - rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - "cosmossdk.io/api/cosmos/crypto/secp256k1" - "cosmossdk.io/collections" - "cosmossdk.io/x/accounts/accountstd" - "google.golang.org/protobuf/types/known/anypb" - - "github.com/cosmos/cosmos-sdk/codec" -) - -var ( - PubKeyPrefix = collections.NewPrefix(0) - SequencePrefix = collections.NewPrefix(1) -) - -var _ accountstd.Interface = (*Full)(nil) - -func NewFullImpl(d accountstd.Dependencies) (Full, error) { - return Full{ - PubKey: collections.NewItem(d.SchemaBuilder, PubKeyPrefix, "pubkey", codec.CollValueV2[secp256k1.PubKey]()), - Sequence: collections.NewSequence(d.SchemaBuilder, SequencePrefix, "sequence"), - }, nil -} - -// Full implements the Account interface. It also implements -// the full account abstraction interface. -type Full struct { - PubKey collections.Item[*secp256k1.PubKey] - Sequence collections.Sequence -} - -func (a Full) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { - return nil, a.PubKey.Set(ctx, &secp256k1.PubKey{Key: msg.PubKeyBytes}) -} - -func (a Full) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { - return nil, fmt.Errorf("not implemented") -} - -// Authenticate authenticates the account, auth always passess. -func (a Full) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { - return &account_abstractionv1.MsgAuthenticateResponse{}, nil -} - -func (a Full) PayBundler(ctx context.Context, msg *account_abstractionv1.MsgPayBundler) (*account_abstractionv1.MsgPayBundlerResponse, error) { - // we force this account to pay the bundler only using a bank send. - if len(msg.BundlerPaymentMessages) != 1 { - return nil, fmt.Errorf("expected one bundler payment message") - } - bankSend, err := accountstd.UnpackAny[bankv1beta1.MsgSend](msg.BundlerPaymentMessages[0]) - if err != nil { - return nil, err - } - if bankSend.FromAddress == "" { - bankSend.FromAddress = msg.Bundler - } - - resp, err := accountstd.ExecModule[bankv1beta1.MsgSendResponse](ctx, bankSend) - if err != nil { - return nil, err - } - - anyResp, err := accountstd.PackAny[bankv1beta1.MsgSendResponse](resp) - if err != nil { - return nil, err - } - return &account_abstractionv1.MsgPayBundlerResponse{ - BundlerPaymentMessagesResponse: []*anypb.Any{anyResp}, - }, nil -} - -func (a Full) Execute(ctx context.Context, msg *account_abstractionv1.MsgExecute) (*account_abstractionv1.MsgExecuteResponse, error) { - // the execute method does ... nothing, just proxies back the requests - return nil, nil -} - -// QueryAuthenticateMethods queries the authentication methods of the account. -func (a Full) QueryAuthenticateMethods(ctx context.Context, req *account_abstractionv1.QueryAuthenticationMethods) (*account_abstractionv1.QueryAuthenticationMethodsResponse, error) { - return nil, fmt.Errorf("not implemented") -} - -func (a Full) RegisterInitHandler(builder *accountstd.InitBuilder) { - accountstd.RegisterInitHandler(builder, a.Init) -} - -func (a Full) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { - accountstd.RegisterExecuteHandler(builder, a.RotatePubKey) - accountstd.RegisterExecuteHandler(builder, a.Authenticate) // implements account_abstraction - accountstd.RegisterExecuteHandler(builder, a.PayBundler) // implements account_abstraction - accountstd.RegisterExecuteHandler(builder, a.Execute) // implements account_abstraction -} - -func (a Full) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { - accountstd.RegisterQueryHandler(builder, a.QueryAuthenticateMethods) // implements account_abstraction -} diff --git a/x/accounts/testing/account_abstraction/minimal.go b/x/accounts/testing/account_abstraction/minimal.go new file mode 100644 index 000000000000..2dac1e6316a8 --- /dev/null +++ b/x/accounts/testing/account_abstraction/minimal.go @@ -0,0 +1,65 @@ +package account_abstraction + +import ( + "context" + "fmt" + + account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" + rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + "cosmossdk.io/collections" + "cosmossdk.io/x/accounts/accountstd" + "github.com/cosmos/cosmos-sdk/codec" +) + +var ( + PubKeyPrefix = collections.NewPrefix(0) + SequencePrefix = collections.NewPrefix(1) +) + +var _ accountstd.Interface = (*MinimalAbstractedAccount)(nil) + +func NewMinimalAbstractedAccount(d accountstd.Dependencies) (MinimalAbstractedAccount, error) { + return MinimalAbstractedAccount{ + PubKey: collections.NewItem(d.SchemaBuilder, PubKeyPrefix, "pubkey", codec.CollValueV2[secp256k1.PubKey]()), + Sequence: collections.NewSequence(d.SchemaBuilder, SequencePrefix, "sequence"), + }, nil +} + +// MinimalAbstractedAccount implements the Account interface. +// It implements the minimum required methods. +type MinimalAbstractedAccount struct { + PubKey collections.Item[*secp256k1.PubKey] + Sequence collections.Sequence +} + +func (a MinimalAbstractedAccount) Init(ctx context.Context, msg *rotationv1.MsgInit) (*rotationv1.MsgInitResponse, error) { + return nil, a.PubKey.Set(ctx, &secp256k1.PubKey{Key: msg.PubKeyBytes}) +} + +func (a MinimalAbstractedAccount) RotatePubKey(ctx context.Context, msg *rotationv1.MsgRotatePubKey) (*rotationv1.MsgRotatePubKeyResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +// Authenticate authenticates the account, auth always passess. +func (a MinimalAbstractedAccount) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { + return &account_abstractionv1.MsgAuthenticateResponse{}, nil +} + +// QueryAuthenticateMethods queries the authentication methods of the account. +func (a MinimalAbstractedAccount) QueryAuthenticateMethods(ctx context.Context, req *account_abstractionv1.QueryAuthenticationMethods) (*account_abstractionv1.QueryAuthenticationMethodsResponse, error) { + return nil, fmt.Errorf("not implemented") +} + +func (a MinimalAbstractedAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { + accountstd.RegisterInitHandler(builder, a.Init) +} + +func (a MinimalAbstractedAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { + accountstd.RegisterExecuteHandler(builder, a.RotatePubKey) + accountstd.RegisterExecuteHandler(builder, a.Authenticate) // implements account_abstraction +} + +func (a MinimalAbstractedAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { + accountstd.RegisterQueryHandler(builder, a.QueryAuthenticateMethods) // implements account_abstraction +} From 20cc6e320b73d20f724679723855b57677efb3cd Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 20 Nov 2023 14:49:44 +0100 Subject: [PATCH 10/19] add abstracted account flows testing --- .../e2e/accounts/account_abstraction_test.go | 229 ++++++++++++++++-- tests/e2e/accounts/setup_test.go | 12 + x/accounts/keeper.go | 8 +- x/accounts/keeper_account_abstraction.go | 36 ++- .../testing/account_abstraction/minimal.go | 8 +- 5 files changed, 256 insertions(+), 37 deletions(-) create mode 100644 tests/e2e/accounts/setup_test.go diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index f3d4e8097d7d..61ca6feae4a3 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -1,16 +1,19 @@ +//go:build app_v1 + package accounts import ( + "context" "testing" rotationv1 "cosmossdk.io/api/cosmos/accounts/testing/rotation/v1" accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - "cosmossdk.io/log" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/simapp" - dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/x/accounts" + "cosmossdk.io/x/bank/testutil" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" @@ -18,14 +21,14 @@ import ( ) var ( - privKey = secp256k1.GenPrivKey() - accCreator = []byte("creator") - bundler = "bundler" - alice = "alice" + privKey = secp256k1.GenPrivKey() + accCreator = []byte("creator") + bundlerAddr = secp256k1.GenPrivKey().PubKey().Address() + aliceAddr = secp256k1.GenPrivKey().PubKey().Address() ) func TestAccountAbstraction(t *testing.T) { - app := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) + app := setupApp(t) ak := app.AccountsKeeper ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()) @@ -37,30 +40,186 @@ func TestAccountAbstraction(t *testing.T) { aaAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aaAddr) require.NoError(t, err) - t.Run("ok", func(t *testing.T) { - resp := ak.ExecuteUserOperation(ctx, bundler, &accountsv1.UserOperation{ + // let's give aa some coins. + require.NoError(t, testutil.FundAccount(ctx, app.BankKeeper, aaAddr, sdk.NewCoins(sdk.NewInt64Coin("stake", 100000000000)))) + + bundlerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(bundlerAddr) + require.NoError(t, err) + + aliceAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aliceAddr) + require.NoError(t, err) + + t.Run("ok - pay bundler and exec not implemented", func(t *testing.T) { + // we simulate executing an user operation in an abstracted account + // which only implements the authentication. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), // the sender is the AA, so it has the coins and wants to pay the bundler for the gas + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: aliceAddrStr, + Amount: coins(t, "2000stake"), // as the real action the sender wants to send coins to alice + }), + ExecutionGasLimit: 36000, + }) + // todo assertions + require.Empty(t, resp.Error) // no error + // aa changed state + // funds were sent from aa to bundler + // funds were sent from aa to alice + }) + t.Run("pay bundle impersonation", func(t *testing.T) { + // we simulate the execution of an abstracted account + // which only implements authentication and tries in the pay + // bundler messages the account tries to impersonate another one. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, - AuthenticationMethod: "standard", + AuthenticationMethod: "secp256k1", AuthenticationData: []byte("signature"), AuthenticationGasLimit: 10000, - BundlerPaymentMessages: nil, - BundlerPaymentGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: bundlerAddrStr, // abstracted account tries to send money from bundler to itself. + ToAddress: aaAddrStr, + Amount: coins(t, "1stake"), + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: aliceAddrStr, + Amount: coins(t, "2000stake"), // as the real action the sender wants to send coins to alice + }), + ExecutionGasLimit: 36000, + }) + require.Contains(t, resp.Error, accounts.ErrUnauthorized.Error()) // error is unauthorized + require.Empty(t, resp.BundlerPaymentResponses) // no bundler payment responses, since the atomic exec failed + require.Empty(t, resp.ExecutionResponses) // no execution responses, since the atomic exec failed + require.Zero(t, resp.ExecutionGasUsed) // no execution gas used, since the atomic exec failed + require.NotZero(t, resp.BundlerPaymentGasUsed) // bundler payment gas used, even if the atomic exec failed + }) + t.Run("exec message impersonation", func(t *testing.T) { + // we simulate a case in which the abstracted account tries to impersonate + // someone else in the execution of messages. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), + }), + BundlerPaymentGasLimit: 50000, ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ - FromAddress: "", - ToAddress: "", - Amount: nil, + FromAddress: aliceAddrStr, // abstracted account attempts to send money from alice to itself + ToAddress: aaAddrStr, + Amount: coins(t, "2000stake"), }), - ExecutionGasLimit: 10000, + ExecutionGasLimit: 36000, }) - t.Log(resp.String()) + require.Contains(t, resp.Error, accounts.ErrUnauthorized.Error()) // error is unauthorized + require.NotEmpty(t, resp.BundlerPaymentResponses) // bundler payment responses, since the bundler payment succeeded + require.Empty(t, resp.ExecutionResponses) // no execution responses, since the atomic exec failed + require.NotZero(t, resp.ExecutionGasUsed) // execution gas used, even if the atomic exec failed + require.NotZero(t, resp.BundlerPaymentGasUsed) // bundler payment gas used, even if the atomic exec failed + }) + t.Run("auth failure", func(t *testing.T) { + // if auth fails nothing more should be attempted, the authentication + // should have spent gas and the error should be returned. + // we simulate a case in which the abstracted account tries to impersonate + // someone else in the execution of messages. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "invalid", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aliceAddrStr, // abstracted account attempts to send money from alice to itself + ToAddress: aaAddrStr, + Amount: coins(t, "2000stake"), + }), + ExecutionGasLimit: 36000, + }) + require.Contains(t, resp.Error, accounts.ErrAuthentication.Error()) // error is authentication + require.Empty(t, resp.BundlerPaymentResponses) // no bundler payment responses, since the atomic exec failed + require.Empty(t, resp.ExecutionResponses) // no execution responses, since the atomic exec failed + require.Zero(t, resp.ExecutionGasUsed) // no execution gas used, since the atomic exec failed + require.Zero(t, resp.BundlerPaymentGasUsed) // no bundler payment gas used, since the atomic exec failed + require.NotZero(t, resp.AuthenticationGasUsed) // authentication gas used, even if the atomic exec failed + }) + t.Run("pay bundle failure", func(t *testing.T) { + // pay bundler fails, nothing more should be attempted, the authentication + // succeeded. We expect gas used in auth and pay bundler step. + // we simulate a case in which the abstracted account tries to impersonate + // someone else in the execution of messages. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1atom"), // abstracted account does not have enough money to pay the bundler, since it does not hold atom + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aliceAddrStr, // abstracted account attempts to send money from alice to itself + ToAddress: aaAddrStr, + Amount: coins(t, "2000stake"), + }), + ExecutionGasLimit: 36000, + }) + require.Contains(t, resp.Error, accounts.ErrBundlerPayment.Error()) // error is bundler payment + require.Empty(t, resp.BundlerPaymentResponses) // no bundler payment responses, since the atomic exec failed + require.Empty(t, resp.ExecutionResponses) // no execution responses, since the atomic exec failed + require.Zero(t, resp.ExecutionGasUsed) // no execution gas used, since the atomic exec failed + require.NotZero(t, resp.BundlerPaymentGasUsed) // bundler payment gas used, even if the atomic exec failed + require.NotZero(t, resp.AuthenticationGasUsed) // authentication gas used, even if the atomic exec failed + }) + t.Run("exec message failure", func(t *testing.T) { + // execution message fails, nothing more should be attempted, the authentication + // and pay bundler succeeded. We expect gas used in auth, pay bundler and + // execution step. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: aliceAddrStr, + Amount: coins(t, "2000atom"), // abstracted account does not have enough money to pay alice, since it does not hold atom + }), + ExecutionGasLimit: 36000, + }) + require.Contains(t, resp.Error, accounts.ErrExecution.Error()) // error is execution + require.Len(t, resp.BundlerPaymentResponses, 1) // bundler payment response, since the pay bundler succeeded + require.Empty(t, resp.ExecutionResponses) // no execution responses, since the atomic exec failed + require.NotZero(t, resp.ExecutionGasUsed) // execution gas used, even if the atomic exec failed + require.NotZero(t, resp.BundlerPaymentGasUsed) // bundler payment gas used, even if the atomic exec failed + require.NotZero(t, resp.AuthenticationGasUsed) // authentication gas used, even if the atomic exec failed }) - t.Run("ok pay bundler not implemented", func(t *testing.T) {}) - t.Run("ok exec messages not implemented", func(t *testing.T) {}) - t.Run("pay bundle impersonation", func(t *testing.T) {}) - t.Run("exec message impersonation", func(t *testing.T) {}) - t.Run("auth failure", func(t *testing.T) {}) - t.Run("pay bundle failure", func(t *testing.T) {}) - t.Run("exec message failure", func(t *testing.T) {}) } func intoAny(t *testing.T, msgs ...proto.Message) (anys []*anypb.Any) { @@ -72,3 +231,23 @@ func intoAny(t *testing.T, msgs ...proto.Message) (anys []*anypb.Any) { } return } + +func coins(t *testing.T, s string) []*v1beta1.Coin { + t.Helper() + coins, err := sdk.ParseCoinsNormalized(s) + require.NoError(t, err) + coinsv2 := make([]*v1beta1.Coin, len(coins)) + for i, coin := range coins { + coinsv2[i] = &v1beta1.Coin{ + Denom: coin.Denom, + Amount: coin.Amount.String(), + } + } + return coinsv2 +} + +func balanceIs(t *testing.T, ctx context.Context, app *simapp.SimApp, addr sdk.AccAddress, s string) { + t.Helper() + balance := app.BankKeeper.GetAllBalances(ctx, addr) + require.Equal(t, s, balance.String()) +} diff --git a/tests/e2e/accounts/setup_test.go b/tests/e2e/accounts/setup_test.go new file mode 100644 index 000000000000..62475be96236 --- /dev/null +++ b/tests/e2e/accounts/setup_test.go @@ -0,0 +1,12 @@ +package accounts + +import ( + "testing" + + "cosmossdk.io/simapp" +) + +func setupApp(t *testing.T) *simapp.SimApp { + app := simapp.Setup(t, false) + return app +} diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index f2397820ecb8..ff13cbd38d0e 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -26,7 +26,11 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) -var errAccountTypeNotFound = errors.New("account type not found") +var ( + errAccountTypeNotFound = errors.New("account type not found") + // ErrUnauthorized is returned when a message sender is not allowed to perform the operation. + ErrUnauthorized = errors.New("unauthorized") +) var ( // AccountTypeKeyPrefix is the prefix for the account type key. @@ -320,7 +324,7 @@ func (k Keeper) sendModuleMessage(ctx context.Context, sender []byte, msg, msgRe return fmt.Errorf("expected only one signer, got %d", len(wantSenders)) } if !bytes.Equal(sender, wantSenders[0]) { - return fmt.Errorf("sender is not authorized to send this message") + return fmt.Errorf("%w: sender does not match expected sender", ErrUnauthorized) } msgV1, msgRespV1 := msg.(protoiface.MessageV1), msgResp.(protoiface.MessageV1) messageName := getMessageName(msgV1) diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 17f4d423e898..b4d9b0b4c0dc 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -10,6 +10,15 @@ import ( "google.golang.org/protobuf/types/known/anypb" ) +var ( + // ErrAuthentication is returned when the authentication fails. + ErrAuthentication = fmt.Errorf("authentication failed") + // ErrBundlerPayment is returned when the bundler payment fails. + ErrBundlerPayment = fmt.Errorf("bundler payment failed") + // ErrExecution is returned when the execution fails. + ErrExecution = fmt.Errorf("execution failed") +) + // ExecuteUserOperation handles the execution of an abstracted account UserOperation. func (k Keeper) ExecuteUserOperation( ctx context.Context, @@ -20,28 +29,29 @@ func (k Keeper) ExecuteUserOperation( // authenticate authGas, err := k.Authenticate(ctx, bundler, op) + resp.AuthenticationGasUsed = authGas if err != nil { - resp.Error = fmt.Sprintf("authentication failed: %s", err.Error()) + resp.Error = err.Error() return resp } resp.AuthenticationGasUsed = authGas // pay bundler bundlerPayGas, bundlerPayResp, err := k.PayBundler(ctx, bundler, op) + resp.BundlerPaymentGasUsed = bundlerPayGas if err != nil { - resp.Error = fmt.Sprintf("bundler payment failed: %s", err.Error()) + resp.Error = err.Error() return resp } - resp.BundlerPaymentGasUsed = bundlerPayGas resp.BundlerPaymentResponses = bundlerPayResp // execute messages, the real operation intent executeGas, executeResp, err := k.OpExecuteMessages(ctx, bundler, op) + resp.ExecutionGasUsed = executeGas if err != nil { - resp.Error = fmt.Sprintf("execution failed: %s", err.Error()) + resp.Error = err.Error() return resp } - resp.ExecutionGasUsed = executeGas resp.ExecutionResponses = executeResp // done! @@ -57,9 +67,13 @@ func (k Keeper) Authenticate( op *accountsv1.UserOperation, ) (gasUsed uint64, err error) { // authenticate - return k.branchExecutor.ExecuteWithGasLimit(ctx, op.AuthenticationGasLimit, func(ctx context.Context) error { + gasUsed, err = k.branchExecutor.ExecuteWithGasLimit(ctx, op.AuthenticationGasLimit, func(ctx context.Context) error { return k.authenticate(ctx, bundler, op) }) + if err != nil { + return gasUsed, fmt.Errorf("%w: %w", ErrAuthentication, err) + } + return gasUsed, nil } // authenticate handles the authentication flow of an abstracted account. @@ -97,7 +111,10 @@ func (k Keeper) OpExecuteMessages( responses, err = k.opExecuteMessages(ctx, bundler, op) return err }) - return gasUsed, responses, err + if err != nil { + return gasUsed, nil, fmt.Errorf("%w: %w", ErrExecution, err) + } + return gasUsed, responses, nil } func (k Keeper) opExecuteMessages( @@ -147,7 +164,10 @@ func (k Keeper) PayBundler( responses, err = k.payBundler(ctx, bundler, op) return err }) - return gasUsed, responses, err + if err != nil { + return gasUsed, nil, fmt.Errorf("%w: %w", ErrBundlerPayment, err) + } + return gasUsed, responses, nil } func (k Keeper) payBundler( diff --git a/x/accounts/testing/account_abstraction/minimal.go b/x/accounts/testing/account_abstraction/minimal.go index 2dac1e6316a8..bc45a6903431 100644 --- a/x/accounts/testing/account_abstraction/minimal.go +++ b/x/accounts/testing/account_abstraction/minimal.go @@ -42,8 +42,12 @@ func (a MinimalAbstractedAccount) RotatePubKey(ctx context.Context, msg *rotatio } // Authenticate authenticates the account, auth always passess. -func (a MinimalAbstractedAccount) Authenticate(_ context.Context, _ *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { - return &account_abstractionv1.MsgAuthenticateResponse{}, nil +func (a MinimalAbstractedAccount) Authenticate(ctx context.Context, msg *account_abstractionv1.MsgAuthenticate) (*account_abstractionv1.MsgAuthenticateResponse, error) { + if msg.UserOperation.AuthenticationMethod != "secp256k1" { + return nil, fmt.Errorf("authentication method not supported") + } + _, err := a.Sequence.Next(ctx) + return &account_abstractionv1.MsgAuthenticateResponse{}, err } // QueryAuthenticateMethods queries the authentication methods of the account. From 5b2f957a152f89ccc2d68dc3b51acaf231375903 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 20 Nov 2023 15:15:05 +0100 Subject: [PATCH 11/19] refine testing --- tests/e2e/accounts/account_abstraction_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index 61ca6feae4a3..99fdad5d9d11 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -70,11 +70,16 @@ func TestAccountAbstraction(t *testing.T) { }), ExecutionGasLimit: 36000, }) - // todo assertions require.Empty(t, resp.Error) // no error - // aa changed state - // funds were sent from aa to bundler - // funds were sent from aa to alice + require.Len(t, resp.BundlerPaymentResponses, 1) + require.Len(t, resp.ExecutionResponses, 1) + require.NotZero(t, resp.ExecutionGasUsed) + require.NotZero(t, resp.BundlerPaymentGasUsed) + require.NotZero(t, resp.AuthenticationGasUsed) + // assert there were state changes + balanceIs(t, ctx, app, bundlerAddr.Bytes(), "1stake") // pay bundler state change + balanceIs(t, ctx, app, aliceAddr.Bytes(), "2000stake") // execute messages state change. + }) t.Run("pay bundle impersonation", func(t *testing.T) { // we simulate the execution of an abstracted account From 0c0c4df3f8a801182b2e50d7d91dcac8f942f2fa Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 20 Nov 2023 19:09:59 +0100 Subject: [PATCH 12/19] maybe finish testing --- simapp/app.go | 3 +- .../e2e/accounts/account_abstraction_test.go | 95 ++++++++++++++++++- x/accounts/accountstd/exports.go | 53 ++++++++--- x/accounts/internal/implementation/context.go | 2 - .../internal/implementation/proto_util.go | 31 ++++++ x/accounts/keeper.go | 3 +- x/accounts/keeper_account_abstraction.go | 6 +- x/accounts/module.go | 4 + x/accounts/msg_server.go | 2 - .../testing/account_abstraction/full.go | 77 +++++++++++++++ 10 files changed, 252 insertions(+), 24 deletions(-) create mode 100644 x/accounts/internal/implementation/proto_util.go create mode 100644 x/accounts/testing/account_abstraction/full.go diff --git a/simapp/app.go b/simapp/app.go index b4d45e948b24..24c6b13fdc39 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -291,7 +291,8 @@ func NewSimApp( app.MsgServiceRouter(), app.GRPCQueryRouter(), accountstd.AddAccount("counter", counter.NewAccount), - accountstd.AddAccount("aa_full", account_abstraction.NewMinimalAbstractedAccount), + accountstd.AddAccount("aa_minimal", account_abstraction.NewMinimalAbstractedAccount), + accountstd.AddAccount("aa_full", account_abstraction.NewFullAbstractedAccount), ) if err != nil { panic(err) diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index 99fdad5d9d11..0b0802ffb551 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -10,9 +10,13 @@ import ( accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + nftv1beta1 "cosmossdk.io/api/cosmos/nft/v1beta1" + stakingv1beta1 "cosmossdk.io/api/cosmos/staking/v1beta1" "cosmossdk.io/simapp" "cosmossdk.io/x/accounts" "cosmossdk.io/x/bank/testutil" + "cosmossdk.io/x/nft" + "github.com/cosmos/cosmos-proto/anyutil" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -32,7 +36,12 @@ func TestAccountAbstraction(t *testing.T) { ak := app.AccountsKeeper ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()) - _, aaAddr, err := ak.Init(ctx, "aa_full", accCreator, &rotationv1.MsgInit{ + _, aaAddr, err := ak.Init(ctx, "aa_minimal", accCreator, &rotationv1.MsgInit{ + PubKeyBytes: privKey.PubKey().Bytes(), + }) + require.NoError(t, err) + + _, aaFullAddr, err := ak.Init(ctx, "aa_full", accCreator, &rotationv1.MsgInit{ PubKeyBytes: privKey.PubKey().Bytes(), }) require.NoError(t, err) @@ -40,8 +49,12 @@ func TestAccountAbstraction(t *testing.T) { aaAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aaAddr) require.NoError(t, err) + aaFullAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aaFullAddr) + require.NoError(t, err) + // let's give aa some coins. require.NoError(t, testutil.FundAccount(ctx, app.BankKeeper, aaAddr, sdk.NewCoins(sdk.NewInt64Coin("stake", 100000000000)))) + require.NoError(t, testutil.FundAccount(ctx, app.BankKeeper, aaFullAddr, sdk.NewCoins(sdk.NewInt64Coin("stake", 100000000000)))) bundlerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(bundlerAddr) require.NoError(t, err) @@ -225,12 +238,90 @@ func TestAccountAbstraction(t *testing.T) { require.NotZero(t, resp.BundlerPaymentGasUsed) // bundler payment gas used, even if the atomic exec failed require.NotZero(t, resp.AuthenticationGasUsed) // authentication gas used, even if the atomic exec failed }) + + t.Run("implements bundler payment - fail ", func(t *testing.T) { + // we assert that if an aa implements the bundler payment interface, then + // that is called. + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaFullAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaFullAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), // we expect this to fail since the account is implement in such a way not to allow bank sends. + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaFullAddrStr, + ToAddress: aliceAddrStr, + Amount: coins(t, "2000stake"), + }), + ExecutionGasLimit: 36000, + }) + // in order to assert the call we expect an error to be returned. + require.Contains(t, resp.Error, accounts.ErrBundlerPayment.Error()) // error is bundler payment + require.Contains(t, resp.Error, "this account does not allow bank send messages") // error is bundler payment + }) + + t.Run("implements execution - fail", func(t *testing.T) { + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaFullAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: nil, + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &stakingv1beta1.MsgDelegate{ + DelegatorAddress: aaFullAddrStr, + ValidatorAddress: "some-validator", + Amount: coins(t, "2000stake")[0], + }), + ExecutionGasLimit: 36000, + }) + // in order to assert the call we expect an error to be returned. + require.Contains(t, resp.Error, accounts.ErrExecution.Error()) // error is in execution + require.Contains(t, resp.Error, "this account does not allow delegation messages") + }) + + t.Run("implements bundler payment and execution - success", func(t *testing.T) { + // we simulate the abstracted account pays the bundler using an NFT. + require.NoError(t, app.NFTKeeper.SaveClass(ctx, nft.Class{ + Id: "omega-rare", + })) + require.NoError(t, app.NFTKeeper.Mint(ctx, nft.NFT{ + ClassId: "omega-rare", + Id: "the-most-rare", + }, aaFullAddr)) + + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaFullAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: []byte("signature"), + AuthenticationGasLimit: 10000, + BundlerPaymentMessages: intoAny(t, &nftv1beta1.MsgSend{ + ClassId: "omega-rare", + Id: "the-most-rare", + Sender: aaFullAddrStr, + Receiver: bundlerAddrStr, + }), + BundlerPaymentGasLimit: 50000, + ExecutionMessages: intoAny(t, &bankv1beta1.MsgSend{ + FromAddress: aaFullAddrStr, + ToAddress: aliceAddrStr, + Amount: coins(t, "2000stake"), + }), + ExecutionGasLimit: 36000, + }) + require.Empty(t, resp.Error) // no error + }) } func intoAny(t *testing.T, msgs ...proto.Message) (anys []*anypb.Any) { t.Helper() for _, msg := range msgs { - any, err := anypb.New(msg) + any, err := anyutil.New(msg) require.NoError(t, err) anys = append(anys, any) } diff --git a/x/accounts/accountstd/exports.go b/x/accounts/accountstd/exports.go index a966fba8c332..215a86ce21f7 100644 --- a/x/accounts/accountstd/exports.go +++ b/x/accounts/accountstd/exports.go @@ -2,14 +2,18 @@ package accountstd import ( + "bytes" "context" "fmt" "cosmossdk.io/x/accounts/internal/implementation" - "github.com/cosmos/cosmos-proto/anyutil" + "github.com/cosmos/cosmos-sdk/types/address" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) +var accountsModuleAddress = address.Module("accounts") + // Interface is the exported interface of an Account. type Interface = implementation.Account @@ -66,11 +70,20 @@ func Sender(ctx context.Context) []byte { return implementation.Sender(ctx) } +// SenderIsAccountsModule returns true if the sender of the execution request is the accounts module. +func SenderIsAccountsModule(ctx context.Context) bool { + return bytes.Equal(Sender(ctx), accountsModuleAddress) +} + // ExecModule can be used to execute a message towards a module. func ExecModule[Resp any, RespProto implementation.ProtoMsg[Resp], Req any, ReqProto implementation.ProtoMsg[Req]](ctx context.Context, msg ReqProto) (RespProto, error) { return implementation.ExecModule[Resp, RespProto, Req, ReqProto](ctx, msg) } +func ExecModuleUntyped(ctx context.Context, msg proto.Message) (proto.Message, error) { + return implementation.ExecModuleUntyped(ctx, msg) +} + // QueryModule can be used by an account to execute a module query. func QueryModule[Resp any, RespProto implementation.ProtoMsg[Resp], Req any, ReqProto implementation.ProtoMsg[Req]](ctx context.Context, req ReqProto) (RespProto, error) { return implementation.QueryModule[Resp, RespProto, Req, ReqProto](ctx, req) @@ -78,18 +91,34 @@ func QueryModule[Resp any, RespProto implementation.ProtoMsg[Resp], Req any, Req // UnpackAny unpacks a protobuf Any message generically. func UnpackAny[Msg any, ProtoMsg implementation.ProtoMsg[Msg]](any *anypb.Any) (*Msg, error) { - msg, err := any.UnmarshalNew() - if err != nil { - return nil, err - } - concrete, ok := msg.(ProtoMsg) - if !ok { - return nil, fmt.Errorf("expected %T, got %T", concrete, msg) - } - return concrete, nil + return implementation.UnpackAny[Msg, ProtoMsg](any) } // PackAny packs a protobuf Any message generically. -func PackAny[Msg any, ProtoMsg implementation.ProtoMsg[Msg]](msg *Msg) (*anypb.Any, error) { - return anyutil.New(ProtoMsg(msg)) +func PackAny(msg proto.Message) (*anypb.Any, error) { + return implementation.PackAny(msg) +} + +// ExecModuleAnys can be used to execute a list of messages towards a module +// when those messages are packed in Any messages. The function returns a list +// of responses packed in Any messages. +func ExecModuleAnys(ctx context.Context, msgs []*anypb.Any) ([]*anypb.Any, error) { + responses := make([]*anypb.Any, len(msgs)) + for i, msg := range msgs { + concreteMessage, err := implementation.UnpackAnyRaw(msg) + if err != nil { + return nil, fmt.Errorf("error unpacking message %d: %w", i, err) + } + resp, err := ExecModuleUntyped(ctx, concreteMessage) + if err != nil { + return nil, fmt.Errorf("error executing message %d: %w", i, err) + } + // pack again + respAnyPB, err := implementation.PackAny(resp) + if err != nil { + return nil, fmt.Errorf("error packing response %d: %w", i, err) + } + responses[i] = respAnyPB + } + return responses, nil } diff --git a/x/accounts/internal/implementation/context.go b/x/accounts/internal/implementation/context.go index 4f9434ff3b7a..f86510eeb28a 100644 --- a/x/accounts/internal/implementation/context.go +++ b/x/accounts/internal/implementation/context.go @@ -2,7 +2,6 @@ package implementation import ( "context" - "errors" "cosmossdk.io/collections" "cosmossdk.io/core/store" @@ -11,7 +10,6 @@ import ( ) var ( - errUnauthorized = errors.New("unauthorized") AccountStatePrefix = collections.NewPrefix(255) ) diff --git a/x/accounts/internal/implementation/proto_util.go b/x/accounts/internal/implementation/proto_util.go new file mode 100644 index 000000000000..caf89a4af2dc --- /dev/null +++ b/x/accounts/internal/implementation/proto_util.go @@ -0,0 +1,31 @@ +package implementation + +import ( + "github.com/cosmos/cosmos-proto/anyutil" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +// PackAny packs a proto message into an anypb.Any. +func PackAny(msg proto.Message) (*anypb.Any, error) { + anyPB := new(anypb.Any) + return anyPB, anyutil.MarshalFrom(anyPB, msg, proto.MarshalOptions{Deterministic: true}) +} + +// UnpackAny unpacks an anypb.Any into a proto message. +func UnpackAny[T any, PT ProtoMsg[T]](anyPB *anypb.Any) (PT, error) { + to := new(T) + return to, UnpackAnyTo(anyPB, PT(to)) +} + +func UnpackAnyTo(anyPB *anypb.Any, to proto.Message) error { + return anypb.UnmarshalTo(anyPB, to, proto.UnmarshalOptions{ + DiscardUnknown: true, + }) +} + +func UnpackAnyRaw(anyPB *anypb.Any) (proto.Message, error) { + return anypb.UnmarshalNew(anyPB, proto.UnmarshalOptions{ + DiscardUnknown: true, + }) +} diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index ff13cbd38d0e..16cd5bb32019 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -9,7 +9,6 @@ import ( "fmt" "cosmossdk.io/core/branch" - "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -283,7 +282,7 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages if err != nil { return nil, fmt.Errorf("failed to execute message %d: %s", i, err.Error()) } - anyResp, err := anyutil.New(resp) + anyResp, err := implementation.PackAny(resp) if err != nil { return nil, err } diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index b4d9b0b4c0dc..1ae3d5775be8 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -88,7 +88,7 @@ func (k Keeper) authenticate( } // create an isolated context in which we execute authentication // without affecting the parent context and with the authentication gas limit. - _, err = k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgAuthenticate{ + _, err = k.Execute(ctx, senderAddr, ModuleAccountAddress, &account_abstractionv1.MsgAuthenticate{ Bundler: bundler, UserOperation: op, }) @@ -126,7 +126,7 @@ func (k Keeper) opExecuteMessages( if err != nil { return nil, err } - resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgExecute{ + resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddress, &account_abstractionv1.MsgExecute{ Bundler: bundler, ExecutionMessages: op.ExecutionMessages, }) @@ -184,7 +184,7 @@ func (k Keeper) payBundler( if err != nil { return nil, err } - resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddr, &account_abstractionv1.MsgPayBundler{ + resp, err := k.Execute(ctx, senderAddr, ModuleAccountAddress, &account_abstractionv1.MsgPayBundler{ Bundler: bundler, BundlerPaymentMessages: op.BundlerPaymentMessages, }) diff --git a/x/accounts/module.go b/x/accounts/module.go index 22b049623e03..38d1fe264866 100644 --- a/x/accounts/module.go +++ b/x/accounts/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -23,6 +24,9 @@ const ( StoreKey = "_" + ModuleName // unfortunately accounts collides with auth store key ) +// ModuleAccountAddress defines the x/accounts module address. +var ModuleAccountAddress = address.Module(ModuleName) + const ( ConsensusVersion = 1 ) diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 485b5f8b0d69..0e34306eed70 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -9,8 +9,6 @@ import ( "google.golang.org/grpc/status" ) -var ModuleAccountAddr = []byte{0x01} - var _ v1.MsgServer = msgServer{} func NewMsgServer(k Keeper) v1.MsgServer { diff --git a/x/accounts/testing/account_abstraction/full.go b/x/accounts/testing/account_abstraction/full.go new file mode 100644 index 000000000000..64d61874770f --- /dev/null +++ b/x/accounts/testing/account_abstraction/full.go @@ -0,0 +1,77 @@ +package account_abstraction + +import ( + "context" + "fmt" + + account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" + "cosmossdk.io/x/accounts/accountstd" +) + +// FullAbstractedAccount is an account abstraction that implements +// the account abstraction interface fully. It is used for testing. +type FullAbstractedAccount struct { + m *MinimalAbstractedAccount +} + +func NewFullAbstractedAccount(d accountstd.Dependencies) (FullAbstractedAccount, error) { + m, err := NewMinimalAbstractedAccount(d) + if err != nil { + return FullAbstractedAccount{}, err + } + return FullAbstractedAccount{m: &m}, nil +} + +func (a FullAbstractedAccount) ExecuteMessages(ctx context.Context, msg *account_abstractionv1.MsgExecute) (*account_abstractionv1.MsgExecuteResponse, error) { + // we always want to ensure that this is called by the x/accounts module, it's the only trusted entrypoint. + // if we do not do this check then someone could call this method directly and bypass the authentication. + if !accountstd.SenderIsAccountsModule(ctx) { + return nil, fmt.Errorf("sender is not the x/accounts module") + } + // we simulate this account does not allow delegation messages to be executed. + for _, m := range msg.ExecutionMessages { + if m.TypeUrl == "/cosmos.staking.v1beta1.MsgDelegate" { // NOTE: this is not a safe way to check the typeUrl, it's just for testing. + return nil, fmt.Errorf("this account does not allow delegation messages") + } + } + // execute messages + responses, err := accountstd.ExecModuleAnys(ctx, msg.ExecutionMessages) + if err != nil { + return nil, err + } + return &account_abstractionv1.MsgExecuteResponse{ExecutionMessagesResponse: responses}, nil +} + +func (a FullAbstractedAccount) PayBundler(ctx context.Context, msg *account_abstractionv1.MsgPayBundler) (*account_abstractionv1.MsgPayBundlerResponse, error) { + // we always want to ensure that this is called by the x/accounts module, it's the only trusted entrypoint. + // if we do not do this check then someone could call this method directly and bypass the authentication. + if !accountstd.SenderIsAccountsModule(ctx) { + return nil, fmt.Errorf("sender is not the x/accounts module") + } + // we check if it's a bank send, if it is we reject it. + for _, m := range msg.BundlerPaymentMessages { + if m.TypeUrl == "/cosmos.bank.v1beta1.MsgSend" { // NOTE: this is not a safe way to check the typeUrl, it's just for testing. + return nil, fmt.Errorf("this account does not allow bank send messages") + } + } + // execute messages + responses, err := accountstd.ExecModuleAnys(ctx, msg.BundlerPaymentMessages) + if err != nil { + return nil, err + } + return &account_abstractionv1.MsgPayBundlerResponse{BundlerPaymentMessagesResponse: responses}, nil +} + +func (a FullAbstractedAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { + a.m.RegisterInitHandler(builder) // registers same init message as MinimalAbstractedAccount +} + +func (a FullAbstractedAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { + accountstd.RegisterExecuteHandler(builder, a.ExecuteMessages) // implements accounts_abstraction + accountstd.RegisterExecuteHandler(builder, a.PayBundler) // implements account_abstraction + a.m.RegisterExecuteHandlers(builder) // note: MinimalAbstractedAccount implements account_abstraction, and we're calling its RegisterExecuteHandlers +} + +func (a FullAbstractedAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { + a.m.RegisterQueryHandlers(builder) +} From b3076782d33dc6f311259371963204b25d105654 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 20 Nov 2023 19:15:35 +0100 Subject: [PATCH 13/19] lint --- simapp/app.go | 2 +- tests/e2e/accounts/setup_test.go | 1 + x/accounts/accountstd/exports.go | 6 ++++-- x/accounts/internal/implementation/context.go | 7 +++---- .../internal/implementation/context_test.go | 4 ++-- x/accounts/keeper.go | 2 +- x/accounts/keeper_account_abstraction.go | 3 ++- x/accounts/keeper_test.go | 2 +- x/accounts/module.go | 2 +- x/accounts/msg_server.go | 5 +++-- x/accounts/msg_server_test.go | 2 +- .../testing/account_abstraction/minimal.go | 1 + x/accounts/utils_test.go | 17 +++++++++-------- x/auth/client/cli/tx_sign.go | 2 +- x/gov/keeper/proposal.go | 7 +++---- x/mint/autocli.go | 1 + x/staking/keeper/cons_pubkey.go | 1 - 17 files changed, 35 insertions(+), 30 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 24c6b13fdc39..b791ae0cda1f 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -9,7 +9,6 @@ import ( "os" "path/filepath" - "cosmossdk.io/x/accounts/testing/account_abstraction" abci "github.com/cometbft/cometbft/abci/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" @@ -23,6 +22,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/accounts" "cosmossdk.io/x/accounts/accountstd" + "cosmossdk.io/x/accounts/testing/account_abstraction" "cosmossdk.io/x/accounts/testing/counter" "cosmossdk.io/x/auth" "cosmossdk.io/x/auth/ante" diff --git a/tests/e2e/accounts/setup_test.go b/tests/e2e/accounts/setup_test.go index 62475be96236..d0588f6825b1 100644 --- a/tests/e2e/accounts/setup_test.go +++ b/tests/e2e/accounts/setup_test.go @@ -7,6 +7,7 @@ import ( ) func setupApp(t *testing.T) *simapp.SimApp { + t.Helper() app := simapp.Setup(t, false) return app } diff --git a/x/accounts/accountstd/exports.go b/x/accounts/accountstd/exports.go index 215a86ce21f7..f05191bf8ed5 100644 --- a/x/accounts/accountstd/exports.go +++ b/x/accounts/accountstd/exports.go @@ -6,10 +6,12 @@ import ( "context" "fmt" - "cosmossdk.io/x/accounts/internal/implementation" - "github.com/cosmos/cosmos-sdk/types/address" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" + + "cosmossdk.io/x/accounts/internal/implementation" + + "github.com/cosmos/cosmos-sdk/types/address" ) var accountsModuleAddress = address.Module("accounts") diff --git a/x/accounts/internal/implementation/context.go b/x/accounts/internal/implementation/context.go index f86510eeb28a..7f14a73d04ce 100644 --- a/x/accounts/internal/implementation/context.go +++ b/x/accounts/internal/implementation/context.go @@ -3,15 +3,14 @@ package implementation import ( "context" + "google.golang.org/protobuf/proto" + "cosmossdk.io/collections" "cosmossdk.io/core/store" "cosmossdk.io/x/accounts/internal/prefixstore" - "google.golang.org/protobuf/proto" ) -var ( - AccountStatePrefix = collections.NewPrefix(255) -) +var AccountStatePrefix = collections.NewPrefix(255) type ( ModuleExecUntypedFunc = func(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) diff --git a/x/accounts/internal/implementation/context_test.go b/x/accounts/internal/implementation/context_test.go index 8b986f65ac1f..327445fb7623 100644 --- a/x/accounts/internal/implementation/context_test.go +++ b/x/accounts/internal/implementation/context_test.go @@ -47,7 +47,7 @@ func TestMakeAccountContext(t *testing.T) { accountCtx = MakeAccountContext(originalContext, storeService, []byte("legit-exec-module"), []byte("invoker"), func(ctx context.Context, sender []byte, msg, msgResp proto.Message) error { // ensure we unwrapped the context when invoking a module call require.Equal(t, originalContext, ctx) - proto.Merge(msgResp.(proto.Message), &wrapperspb.StringValue{Value: "module exec was called"}) + proto.Merge(msgResp, &wrapperspb.StringValue{Value: "module exec was called"}) return nil }, nil, nil) @@ -69,7 +69,7 @@ func TestMakeAccountContext(t *testing.T) { // we can guarantee that exec paths do not impact query paths. accountCtx = MakeAccountContext(originalContext, storeService, nil, nil, nil, nil, func(ctx context.Context, req, resp proto.Message) error { require.Equal(t, originalContext, ctx) - proto.Merge(resp.(proto.Message), wrapperspb.String("module query was called")) + proto.Merge(resp, wrapperspb.String("module query was called")) return nil }) diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 16cd5bb32019..312bd362681c 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" - "cosmossdk.io/core/branch" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -17,6 +16,7 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/address" + "cosmossdk.io/core/branch" "cosmossdk.io/core/event" "cosmossdk.io/core/store" "cosmossdk.io/x/accounts/accountstd" diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 1ae3d5775be8..a6cf50c19de6 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -4,10 +4,11 @@ import ( "context" "fmt" + "google.golang.org/protobuf/types/known/anypb" + account_abstractionv1 "cosmossdk.io/api/cosmos/accounts/interfaces/account_abstraction/v1" accountsv1 "cosmossdk.io/api/cosmos/accounts/v1" "cosmossdk.io/x/accounts/internal/implementation" - "google.golang.org/protobuf/types/known/anypb" ) var ( diff --git a/x/accounts/keeper_test.go b/x/accounts/keeper_test.go index 8f75926cf318..6535d99a9783 100644 --- a/x/accounts/keeper_test.go +++ b/x/accounts/keeper_test.go @@ -125,7 +125,7 @@ func TestKeeper_Query(t *testing.T) { Denom: "atom", Amount: "1000", }} - proto.Merge(resp.(proto.Message), copyResp) + proto.Merge(resp, copyResp) return nil }) diff --git a/x/accounts/module.go b/x/accounts/module.go index 38d1fe264866..4d00f15ed345 100644 --- a/x/accounts/module.go +++ b/x/accounts/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" - "github.com/cosmos/cosmos-sdk/types/address" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -15,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/msgservice" ) diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 0e34306eed70..04cf4963c42e 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -3,10 +3,11 @@ package accounts import ( "context" - "cosmossdk.io/core/event" - v1 "cosmossdk.io/x/accounts/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "cosmossdk.io/core/event" + v1 "cosmossdk.io/x/accounts/v1" ) var _ v1.MsgServer = msgServer{} diff --git a/x/accounts/msg_server_test.go b/x/accounts/msg_server_test.go index 0194b0105a69..a55536b900a4 100644 --- a/x/accounts/msg_server_test.go +++ b/x/accounts/msg_server_test.go @@ -20,7 +20,7 @@ func TestMsgServer(t *testing.T) { k.queryRouter = mockQuery(func(ctx context.Context, req, resp proto.Message) error { _, ok := req.(*bankv1beta1.QueryBalanceRequest) require.True(t, ok) - proto.Merge(resp.(proto.Message), &bankv1beta1.QueryBalanceResponse{}) + proto.Merge(resp, &bankv1beta1.QueryBalanceResponse{}) return nil }) diff --git a/x/accounts/testing/account_abstraction/minimal.go b/x/accounts/testing/account_abstraction/minimal.go index bc45a6903431..7be41619f6be 100644 --- a/x/accounts/testing/account_abstraction/minimal.go +++ b/x/accounts/testing/account_abstraction/minimal.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/api/cosmos/crypto/secp256k1" "cosmossdk.io/collections" "cosmossdk.io/x/accounts/accountstd" + "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go index 847f7060c1d7..4f5597de750e 100644 --- a/x/accounts/utils_test.go +++ b/x/accounts/utils_test.go @@ -4,13 +4,14 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoiface" + "cosmossdk.io/collections/colltest" "cosmossdk.io/core/address" "cosmossdk.io/core/event" "cosmossdk.io/x/accounts/internal/implementation" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" ) var _ address.Codec = (*addressCodec)(nil) @@ -46,8 +47,8 @@ var _ QueryRouter = (*mockQuery)(nil) type mockQuery func(ctx context.Context, req, resp proto.Message) error -func (m mockQuery) HybridHandlerByRequestName(_ string) []func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { - return []func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error{func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { +func (m mockQuery) HybridHandlerByRequestName(_ string) []func(ctx context.Context, req, resp protoiface.MessageV1) error { + return []func(ctx context.Context, req, resp protoiface.MessageV1) error{func(ctx context.Context, req, resp protoiface.MessageV1) error { return m(ctx, req.(proto.Message), resp.(proto.Message)) }} } @@ -66,10 +67,10 @@ func (m mockSigner) GetSigners(msg proto.Message) ([][]byte, error) { var _ MsgRouter = (*mockExec)(nil) -type mockExec func(ctx context.Context, msg proto.Message, msgResp proto.Message) error +type mockExec func(ctx context.Context, msg, msgResp proto.Message) error -func (m mockExec) HybridHandlerByMsgName(_ string) func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { - return func(ctx context.Context, req protoiface.MessageV1, resp protoiface.MessageV1) error { +func (m mockExec) HybridHandlerByMsgName(_ string) func(ctx context.Context, req, resp protoiface.MessageV1) error { + return func(ctx context.Context, req, resp protoiface.MessageV1) error { return m(ctx, req.(proto.Message), resp.(proto.Message)) } } diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index eac15934e29d..0ef11524c564 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -185,7 +185,7 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { } } -func sigTxOrMultisig(clientCtx client.Context, txBuilder client.TxBuilder, txFactory tx.Factory, from string, multisigKey string) (err error) { +func sigTxOrMultisig(clientCtx client.Context, txBuilder client.TxBuilder, txFactory tx.Factory, from, multisigKey string) (err error) { if multisigKey == "" { err = sign(clientCtx, txBuilder, txFactory, from) } else { diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 0d2cfdac8786..6750c5dea802 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -19,12 +19,11 @@ import ( // SubmitProposal creates a new proposal given an array of messages func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, expedited bool) (v1.Proposal, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - -// This method checks that all message metadata, summary and title -// has te expected length defined in the module configuration. + // This method checks that all message metadata, summary and title + // has te expected length defined in the module configuration. if err := keeper.validateProposalLengths(metadata, title, summary); err != nil { - return v1.Proposal{}, err + return v1.Proposal{}, err } // Will hold a string slice of all Msg type URLs. diff --git a/x/mint/autocli.go b/x/mint/autocli.go index bb97ea525899..9b096043b5e3 100644 --- a/x/mint/autocli.go +++ b/x/mint/autocli.go @@ -5,6 +5,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" mintv1beta1 "cosmossdk.io/api/cosmos/mint/v1beta1" + "github.com/cosmos/cosmos-sdk/version" ) diff --git a/x/staking/keeper/cons_pubkey.go b/x/staking/keeper/cons_pubkey.go index 6c4a92618481..690fcedbf196 100644 --- a/x/staking/keeper/cons_pubkey.go +++ b/x/staking/keeper/cons_pubkey.go @@ -20,7 +20,6 @@ func (k Keeper) setConsPubKeyRotationHistory( ctx context.Context, valAddr sdk.ValAddress, oldPubKey, newPubKey *codectypes.Any, fee sdk.Coin, ) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) height := uint64(sdkCtx.BlockHeight()) history := types.ConsPubKeyRotationHistory{ From 31cd9e341a19f712fa9ddbda44d84869e0bbe9e6 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Mon, 20 Nov 2023 19:20:55 +0100 Subject: [PATCH 14/19] chore: CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ba42414dff..cd9a404ffa6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth/vesting) [#17810](https://github.com/cosmos/cosmos-sdk/pull/17810) Add the ability to specify a start time for continuous vesting accounts. * (runtime) [#18475](https://github.com/cosmos/cosmos-sdk/pull/18475) Adds an implementation for core.branch.Service. * (server) [#18478](https://github.com/cosmos/cosmos-sdk/pull/18478) CMD flag to disable colored logs. +* (baseapp) [#18499](https://github.com/cosmos/cosmos-sdk/pull/18499) Add `MsgRouter` response type from message name function. ### Improvements From 8d8b75a7a1fd43dff1591393560e2c44bd898b27 Mon Sep 17 00:00:00 2001 From: testinginprod <98415576+testinginprod@users.noreply.github.com> Date: Mon, 20 Nov 2023 19:30:56 +0100 Subject: [PATCH 15/19] Update x/accounts/internal/implementation/api_builder.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- x/accounts/internal/implementation/api_builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/accounts/internal/implementation/api_builder.go b/x/accounts/internal/implementation/api_builder.go index 2828a50c6676..ee8344b86c1a 100644 --- a/x/accounts/internal/implementation/api_builder.go +++ b/x/accounts/internal/implementation/api_builder.go @@ -153,8 +153,8 @@ func (r *QueryBuilder) makeHandler() (func(ctx context.Context, queryRequest any return r.er.makeHandler() } -// IsRoutingError returns true if the error is a routing error. -// which means that it was impossible to route the message to a handler. +// IsRoutingError returns true if the error is a routing error, +// which typically occurs when a message cannot be matched to a handler. func IsRoutingError(err error) bool { if err == nil { return false From 32a58f0b182b87fbceb58fe7ab2642f1955b1d12 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 21 Nov 2023 12:23:35 +0100 Subject: [PATCH 16/19] rename for clarity --- baseapp/msg_service_router.go | 2 +- x/accounts/keeper.go | 4 ++-- x/accounts/utils_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index e27f938b053f..f2857affcead 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -90,7 +90,7 @@ func (msr *MsgServiceRouter) HybridHandlerByMsgName(msgName string) func(ctx con return msr.hybridHandlers[msgName] } -func (msr *MsgServiceRouter) ResponseByRequestName(msgName string) string { +func (msr *MsgServiceRouter) ResponseNameByRequestName(msgName string) string { return msr.responseByRequest[msgName] } diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 312bd362681c..913f4d5fd549 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -50,7 +50,7 @@ type QueryRouter interface { // MsgRouter represents a router which can be used to route messages to the correct module. type MsgRouter interface { HybridHandlerByMsgName(msgName string) func(ctx context.Context, req, resp protoiface.MessageV1) error - ResponseByRequestName(name string) string + ResponseNameByRequestName(name string) string } // SignerProvider defines an interface used to get the expected sender from a message. @@ -296,7 +296,7 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg proto.Message) (proto.Message, error) { // we need to fetch the response type from the request message type. // this is because the response type is not known. - respName := k.msgRouter.ResponseByRequestName(string(msg.ProtoReflect().Descriptor().FullName())) + respName := k.msgRouter.ResponseNameByRequestName(string(msg.ProtoReflect().Descriptor().FullName())) if respName == "" { return nil, fmt.Errorf("could not find response type for message %T", msg) } diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go index 4f5597de750e..fa8655431ec4 100644 --- a/x/accounts/utils_test.go +++ b/x/accounts/utils_test.go @@ -75,6 +75,6 @@ func (m mockExec) HybridHandlerByMsgName(_ string) func(ctx context.Context, req } } -func (m mockExec) ResponseByRequestName(name string) string { +func (m mockExec) ResponseNameByRequestName(name string) string { return name + "Response" } From d8e1c9455b13a2f0b4384a8144e5daeee6038e9f Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 21 Nov 2023 12:35:54 +0100 Subject: [PATCH 17/19] address review --- x/accounts/keeper_account_abstraction.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index a6cf50c19de6..0861136699a9 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -2,6 +2,7 @@ package accounts import ( "context" + "errors" "fmt" "google.golang.org/protobuf/types/known/anypb" @@ -13,11 +14,11 @@ import ( var ( // ErrAuthentication is returned when the authentication fails. - ErrAuthentication = fmt.Errorf("authentication failed") + ErrAuthentication = errors.New("authentication failed") // ErrBundlerPayment is returned when the bundler payment fails. - ErrBundlerPayment = fmt.Errorf("bundler payment failed") + ErrBundlerPayment = errors.New("bundler payment failed") // ErrExecution is returned when the execution fails. - ErrExecution = fmt.Errorf("execution failed") + ErrExecution = errors.New("execution failed") ) // ExecuteUserOperation handles the execution of an abstracted account UserOperation. From c79813059b15721cab1b0d8ef81980143a0bd9cc Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 21 Nov 2023 13:04:10 +0100 Subject: [PATCH 18/19] address review 2 --- x/accounts/keeper_account_abstraction.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 0861136699a9..5971a24fc5a2 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -73,7 +73,7 @@ func (k Keeper) Authenticate( return k.authenticate(ctx, bundler, op) }) if err != nil { - return gasUsed, fmt.Errorf("%w: %w", ErrAuthentication, err) + return gasUsed, fmt.Errorf("%v: %w", ErrAuthentication, err) } return gasUsed, nil } @@ -114,7 +114,7 @@ func (k Keeper) OpExecuteMessages( return err }) if err != nil { - return gasUsed, nil, fmt.Errorf("%w: %w", ErrExecution, err) + return gasUsed, nil, fmt.Errorf("%v: %w", ErrExecution, err) } return gasUsed, responses, nil } @@ -167,7 +167,7 @@ func (k Keeper) PayBundler( return err }) if err != nil { - return gasUsed, nil, fmt.Errorf("%w: %w", ErrBundlerPayment, err) + return gasUsed, nil, fmt.Errorf("%v: %w", ErrBundlerPayment, err) } return gasUsed, responses, nil } From 02c2b8aa408e852c7b909f09cfcfc5375f03290a Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Wed, 29 Nov 2023 12:08:48 +0100 Subject: [PATCH 19/19] more docs --- baseapp/internal/protocompat/protocompat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/baseapp/internal/protocompat/protocompat.go b/baseapp/internal/protocompat/protocompat.go index a60c145b74a6..8e85ea6cede0 100644 --- a/baseapp/internal/protocompat/protocompat.go +++ b/baseapp/internal/protocompat/protocompat.go @@ -23,6 +23,8 @@ var ( type Handler = func(ctx context.Context, request, response protoiface.MessageV1) error +// MakeHybridHandler returns a handler that can handle both gogo and protov2 messages, no matter +// if the handler is a gogo or protov2 handler. func MakeHybridHandler(cdc codec.BinaryCodec, sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) (Handler, error) { methodFullName := protoreflect.FullName(fmt.Sprintf("%s.%s", sd.ServiceName, method.MethodName)) desc, err := gogoproto.HybridResolver.FindDescriptorByName(methodFullName) @@ -222,6 +224,7 @@ func RequestFullNameFromMethodDesc(sd *grpc.ServiceDesc, method grpc.MethodDesc) return methodDesc.Input().FullName(), nil } +// ResponseFullNameFromMethodDesc returns the fully-qualified name of the response message of the provided service's method. func ResponseFullNameFromMethodDesc(sd *grpc.ServiceDesc, method grpc.MethodDesc) (protoreflect.FullName, error) { methodFullName := protoreflect.FullName(fmt.Sprintf("%s.%s", sd.ServiceName, method.MethodName)) desc, err := gogoproto.HybridResolver.FindDescriptorByName(methodFullName)