From e340e8155240db76783907f16112a2f5b3b22b25 Mon Sep 17 00:00:00 2001 From: Brian Luk Date: Sat, 3 May 2025 22:06:11 -0700 Subject: [PATCH] port bank metadata command --- api/cosmos/bank/v1beta1/tx.pulsar.go | 1102 ++++++++++++++++++-- api/cosmos/bank/v1beta1/tx_grpc.pb.go | 45 + proto/cosmos/bank/v1beta1/tx.proto | 22 + simapp/app_config.go | 1 + x/authz/testutil/bank_helpers.go | 4 + x/bank/client/cli/tx.go | 1 + x/bank/client/cli/tx_saga.go | 67 ++ x/bank/keeper/msg_server_saga.go | 25 + x/bank/types/codec.go | 2 + x/bank/types/msg_saga.go | 51 + x/bank/types/tx.pb.go | 486 ++++++++- x/group/testutil/expected_keepers_mocks.go | 16 + 12 files changed, 1716 insertions(+), 106 deletions(-) create mode 100644 x/bank/client/cli/tx_saga.go create mode 100644 x/bank/keeper/msg_server_saga.go create mode 100644 x/bank/types/msg_saga.go diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index 64c6508750b6..a67123898edf 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -3876,6 +3876,861 @@ func (x *fastReflection_MsgSetSendEnabledResponse) ProtoMethods() *protoiface.Me } } +var ( + md_MsgSetMetadata protoreflect.MessageDescriptor + fd_MsgSetMetadata_authority protoreflect.FieldDescriptor + fd_MsgSetMetadata_metadata protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgSetMetadata = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetMetadata") + fd_MsgSetMetadata_authority = md_MsgSetMetadata.Fields().ByName("authority") + fd_MsgSetMetadata_metadata = md_MsgSetMetadata.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetMetadata)(nil) + +type fastReflection_MsgSetMetadata MsgSetMetadata + +func (x *MsgSetMetadata) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetMetadata)(x) +} + +func (x *MsgSetMetadata) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[8] + 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_MsgSetMetadata_messageType fastReflection_MsgSetMetadata_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetMetadata_messageType{} + +type fastReflection_MsgSetMetadata_messageType struct{} + +func (x fastReflection_MsgSetMetadata_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetMetadata)(nil) +} +func (x fastReflection_MsgSetMetadata_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetMetadata) +} +func (x fastReflection_MsgSetMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetMetadata +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetMetadata) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetMetadata +} + +// 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_MsgSetMetadata) Type() protoreflect.MessageType { + return _fastReflection_MsgSetMetadata_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetMetadata) New() protoreflect.Message { + return new(fastReflection_MsgSetMetadata) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetMetadata) Interface() protoreflect.ProtoMessage { + return (*MsgSetMetadata)(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_MsgSetMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgSetMetadata_authority, value) { + return + } + } + if x.Metadata != nil { + value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + if !f(fd_MsgSetMetadata_metadata, 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_MsgSetMetadata) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + return x.Authority != "" + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + return x.Metadata != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + x.Authority = "" + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + value := x.Metadata + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + x.Authority = value.Interface().(string) + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + x.Metadata = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + if x.Metadata == nil { + x.Metadata = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetMetadata is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetMetadata.authority": + return protoreflect.ValueOfString("") + case "cosmos.bank.v1beta1.MsgSetMetadata.metadata": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadata")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadata 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_MsgSetMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetMetadata", 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_MsgSetMetadata) 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_MsgSetMetadata) 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_MsgSetMetadata) 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_MsgSetMetadata) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetMetadata) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Metadata != nil { + l = options.Size(x.Metadata) + 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().(*MsgSetMetadata) + 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.Metadata != nil { + encoded, err := options.Marshal(x.Metadata) + 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.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgSetMetadata) + 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: MsgSetMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetMetadata: 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 Authority", 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.Authority = 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 Metadata", 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.Metadata == nil { + x.Metadata = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata); 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_MsgSetMetadataResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgSetMetadataResponse = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetMetadataResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetMetadataResponse)(nil) + +type fastReflection_MsgSetMetadataResponse MsgSetMetadataResponse + +func (x *MsgSetMetadataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetMetadataResponse)(x) +} + +func (x *MsgSetMetadataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[9] + 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_MsgSetMetadataResponse_messageType fastReflection_MsgSetMetadataResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetMetadataResponse_messageType{} + +type fastReflection_MsgSetMetadataResponse_messageType struct{} + +func (x fastReflection_MsgSetMetadataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetMetadataResponse)(nil) +} +func (x fastReflection_MsgSetMetadataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetMetadataResponse) +} +func (x fastReflection_MsgSetMetadataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetMetadataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetMetadataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetMetadataResponse +} + +// 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_MsgSetMetadataResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSetMetadataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetMetadataResponse) New() protoreflect.Message { + return new(fastReflection_MsgSetMetadataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetMetadataResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSetMetadataResponse)(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_MsgSetMetadataResponse) 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_MsgSetMetadataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) 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.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetMetadataResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetMetadataResponse 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_MsgSetMetadataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetMetadataResponse", 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_MsgSetMetadataResponse) 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_MsgSetMetadataResponse) 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_MsgSetMetadataResponse) 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_MsgSetMetadataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetMetadataResponse) + 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().(*MsgSetMetadataResponse) + 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().(*MsgSetMetadataResponse) + 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: MsgSetMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetMetadataResponse: 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 @@ -4214,6 +5069,81 @@ func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{7} } +// MsgSetMetadata is the Msg/MsgSetMetadata request type. +// +// Since: cosmos-sdk 0.47-saga.2 +type MsgSetMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *MsgSetMetadata) Reset() { + *x = MsgSetMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetMetadata) ProtoMessage() {} + +// Deprecated: Use MsgSetMetadata.ProtoReflect.Descriptor instead. +func (*MsgSetMetadata) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgSetMetadata) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgSetMetadata) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// SetMetadataResponse defines the Msg/MsgSetMetadata response type. +// +// Since: cosmos-sdk 0.47-saga.2 +type MsgSetMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgSetMetadataResponse) Reset() { + *x = MsgSetMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetMetadataResponse) ProtoMessage() {} + +// Deprecated: Use MsgSetMetadataResponse.ProtoReflect.Descriptor instead. +func (*MsgSetMetadataResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{9} +} + var File_cosmos_bank_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ @@ -4293,44 +5223,64 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x81, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, - 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xbc, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x3a, 0x2c, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x8a, 0xe7, 0xb0, 0x2a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, + 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x18, + 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe2, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, + 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, - 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, - 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, - 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, - 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, + 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, + 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, - 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x6e, 0x6b, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4345,7 +5295,7 @@ func file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_bank_v1beta1_tx_proto_rawDescData } -var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse @@ -4355,31 +5305,37 @@ var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParamsResponse)(nil), // 5: cosmos.bank.v1beta1.MsgUpdateParamsResponse (*MsgSetSendEnabled)(nil), // 6: cosmos.bank.v1beta1.MsgSetSendEnabled (*MsgSetSendEnabledResponse)(nil), // 7: cosmos.bank.v1beta1.MsgSetSendEnabledResponse - (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin - (*Input)(nil), // 9: cosmos.bank.v1beta1.Input - (*Output)(nil), // 10: cosmos.bank.v1beta1.Output - (*Params)(nil), // 11: cosmos.bank.v1beta1.Params - (*SendEnabled)(nil), // 12: cosmos.bank.v1beta1.SendEnabled + (*MsgSetMetadata)(nil), // 8: cosmos.bank.v1beta1.MsgSetMetadata + (*MsgSetMetadataResponse)(nil), // 9: cosmos.bank.v1beta1.MsgSetMetadataResponse + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*Input)(nil), // 11: cosmos.bank.v1beta1.Input + (*Output)(nil), // 12: cosmos.bank.v1beta1.Output + (*Params)(nil), // 13: cosmos.bank.v1beta1.Params + (*SendEnabled)(nil), // 14: cosmos.bank.v1beta1.SendEnabled + (*Metadata)(nil), // 15: cosmos.bank.v1beta1.Metadata } var file_cosmos_bank_v1beta1_tx_proto_depIdxs = []int32{ - 8, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 9, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input - 10, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output - 11, // 3: cosmos.bank.v1beta1.MsgUpdateParams.params:type_name -> cosmos.bank.v1beta1.Params - 12, // 4: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled - 0, // 5: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend - 2, // 6: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend - 4, // 7: cosmos.bank.v1beta1.Msg.UpdateParams:input_type -> cosmos.bank.v1beta1.MsgUpdateParams - 6, // 8: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled - 1, // 9: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse - 3, // 10: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse - 5, // 11: cosmos.bank.v1beta1.Msg.UpdateParams:output_type -> cosmos.bank.v1beta1.MsgUpdateParamsResponse - 7, // 12: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input + 12, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output + 13, // 3: cosmos.bank.v1beta1.MsgUpdateParams.params:type_name -> cosmos.bank.v1beta1.Params + 14, // 4: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 15, // 5: cosmos.bank.v1beta1.MsgSetMetadata.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 0, // 6: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend + 2, // 7: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend + 4, // 8: cosmos.bank.v1beta1.Msg.UpdateParams:input_type -> cosmos.bank.v1beta1.MsgUpdateParams + 6, // 9: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled + 8, // 10: cosmos.bank.v1beta1.Msg.SetMetadata:input_type -> cosmos.bank.v1beta1.MsgSetMetadata + 1, // 11: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse + 3, // 12: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse + 5, // 13: cosmos.bank.v1beta1.Msg.UpdateParams:output_type -> cosmos.bank.v1beta1.MsgUpdateParamsResponse + 7, // 14: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse + 9, // 15: cosmos.bank.v1beta1.Msg.SetMetadata:output_type -> cosmos.bank.v1beta1.MsgSetMetadataResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_tx_proto_init() } @@ -4485,6 +5441,30 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { return nil } } + file_cosmos_bank_v1beta1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetMetadataResponse); 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{ @@ -4492,7 +5472,7 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_bank_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index 7cdb833695c7..87c8d13e1d11 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -23,6 +23,7 @@ const ( Msg_MultiSend_FullMethodName = "/cosmos.bank.v1beta1.Msg/MultiSend" Msg_UpdateParams_FullMethodName = "/cosmos.bank.v1beta1.Msg/UpdateParams" Msg_SetSendEnabled_FullMethodName = "/cosmos.bank.v1beta1.Msg/SetSendEnabled" + Msg_SetMetadata_FullMethodName = "/cosmos.bank.v1beta1.Msg/SetMetadata" ) // MsgClient is the client API for Msg service. @@ -45,6 +46,11 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) + // SetMetadata is an admin operation for setting the Metadata for + // a given denom. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + SetMetadata(ctx context.Context, in *MsgSetMetadata, opts ...grpc.CallOption) (*MsgSetMetadataResponse, error) } type msgClient struct { @@ -91,6 +97,15 @@ func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, o return out, nil } +func (c *msgClient) SetMetadata(ctx context.Context, in *MsgSetMetadata, opts ...grpc.CallOption) (*MsgSetMetadataResponse, error) { + out := new(MsgSetMetadataResponse) + err := c.cc.Invoke(ctx, Msg_SetMetadata_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 @@ -111,6 +126,11 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) + // SetMetadata is an admin operation for setting the Metadata for + // a given denom. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + SetMetadata(context.Context, *MsgSetMetadata) (*MsgSetMetadataResponse, error) mustEmbedUnimplementedMsgServer() } @@ -130,6 +150,9 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* func (UnimplementedMsgServer) SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") } +func (UnimplementedMsgServer) SetMetadata(context.Context, *MsgSetMetadata) (*MsgSetMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMetadata not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -215,6 +238,24 @@ func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_SetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetMetadata) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SetMetadata_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMetadata(ctx, req.(*MsgSetMetadata)) + } + 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) @@ -238,6 +279,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "SetSendEnabled", Handler: _Msg_SetSendEnabled_Handler, }, + { + MethodName: "SetMetadata", + Handler: _Msg_SetMetadata_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index a4e8fae41f84..ac027c08602e 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -33,6 +33,11 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); + // SetMetadata is an admin operation for setting the Metadata for + // a given denom. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc SetMetadata(MsgSetMetadata) returns (MsgSetMetadataResponse); } // MsgSend represents a message to send coins from one account to another. @@ -122,3 +127,20 @@ message MsgSetSendEnabled { // // Since: cosmos-sdk 0.47 message MsgSetSendEnabledResponse {} + +// MsgSetMetadata is the Msg/MsgSetMetadata request type. +// +// +// Since: cosmos-sdk 0.47-saga.2 +message MsgSetMetadata { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSetMetadata"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + Metadata metadata = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// SetMetadataResponse defines the Msg/MsgSetMetadata response type. +// +// Since: cosmos-sdk 0.47-saga.2 +message MsgSetMetadataResponse {} \ No newline at end of file diff --git a/simapp/app_config.go b/simapp/app_config.go index 2b11313e60dd..ad3d1d61e2d5 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -182,6 +182,7 @@ var ( Name: banktypes.ModuleName, Config: appconfig.WrapAny(&bankmodulev1.Module{ BlockedModuleAccountsOverride: blockAccAddrs, + Authority: "cosmos1f707nyjehspmlajxnm3zjnm2h0ssqqp3h070pu", }), }, { diff --git a/x/authz/testutil/bank_helpers.go b/x/authz/testutil/bank_helpers.go index 24928118343d..0f468576a31b 100644 --- a/x/authz/testutil/bank_helpers.go +++ b/x/authz/testutil/bank_helpers.go @@ -23,3 +23,7 @@ func (k MockBankKeeper) UpdateParams(goCtx context.Context, req *bank.MsgUpdateP func (k MockBankKeeper) SetSendEnabled(goCtx context.Context, req *bank.MsgSetSendEnabled) (*bank.MsgSetSendEnabledResponse, error) { return nil, nil } + +func (k MockBankKeeper) SetMetadata(goCtx context.Context, req *bank.MsgSetMetadata) (*bank.MsgSetMetadataResponse, error) { + return nil, nil +} diff --git a/x/bank/client/cli/tx.go b/x/bank/client/cli/tx.go index 6b7e40554a06..9c748c427c9e 100644 --- a/x/bank/client/cli/tx.go +++ b/x/bank/client/cli/tx.go @@ -31,6 +31,7 @@ func NewTxCmd(ac address.Codec) *cobra.Command { txCmd.AddCommand( NewSendTxCmd(ac), NewMultiSendTxCmd(ac), + NewSetMetadataCmd(ac), ) return txCmd diff --git a/x/bank/client/cli/tx_saga.go b/x/bank/client/cli/tx_saga.go new file mode 100644 index 000000000000..4c5e86727bf6 --- /dev/null +++ b/x/bank/client/cli/tx_saga.go @@ -0,0 +1,67 @@ +package cli + +import ( + "fmt" + "os" + + "cosmossdk.io/core/address" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +func NewSetMetadataCmd(ac address.Codec) *cobra.Command { + cmd := &cobra.Command{ + Use: "set-metadata [metadata-file | metadata-json]", + Short: "Set metadata for a bank denomination", + Long: `Set metadata for a bank denomination. Metadata can be provided either as a JSON file or as a JSON string. +Example: + # From a file + $ simd tx bank set-metadata metadata.json +metadata.json: +{ + "description": "The native staking token of an arbitrary cosmos sdk chain.", + "denom_units": [{ "denom": "stake", "exponent": 0, "aliases": ["stake"] }], + "base": "stake", + "display": "stake", + "name": "stake", + "symbol": "stake" +} +`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + var metadataBytes []byte + input := args[0] + + if _, err := os.Stat(input); err == nil { + metadataBytes, err = os.ReadFile(input) + if err != nil { + return fmt.Errorf("failed to read metadata file: %w", err) + } + } else { + metadataBytes = []byte(input) + } + + var metadata types.Metadata + if err := clientCtx.Codec.UnmarshalJSON(metadataBytes, &metadata); err != nil { + return fmt.Errorf("failed to parse metadata JSON: %w", err) + } + + msg := types.NewMsgSetMetadata(clientCtx.GetFromAddress(), metadata) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/bank/keeper/msg_server_saga.go b/x/bank/keeper/msg_server_saga.go new file mode 100644 index 000000000000..a47b32a8aa78 --- /dev/null +++ b/x/bank/keeper/msg_server_saga.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +func (k msgServer) SetMetadata(goCtx context.Context, msg *types.MsgSetMetadata) (*types.MsgSetMetadataResponse, error) { + if k.GetAuthority() != msg.Authority { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + err := msg.Metadata.Validate() + if err != nil { + return nil, err + } + + k.SetDenomMetaData(ctx, msg.Metadata) + + return &types.MsgSetMetadataResponse{}, nil +} diff --git a/x/bank/types/codec.go b/x/bank/types/codec.go index 72780f9d69c2..1b5c30c3e2ab 100644 --- a/x/bank/types/codec.go +++ b/x/bank/types/codec.go @@ -16,6 +16,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgMultiSend{}, "cosmos-sdk/MsgMultiSend") legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/bank/MsgUpdateParams") legacy.RegisterAminoMsg(cdc, &MsgSetSendEnabled{}, "cosmos-sdk/MsgSetSendEnabled") + legacy.RegisterAminoMsg(cdc, &MsgSetMetadata{}, "cosmos-sdk/MsgSetMetadata") cdc.RegisterConcrete(&SendAuthorization{}, "cosmos-sdk/SendAuthorization", nil) cdc.RegisterConcrete(&Params{}, "cosmos-sdk/x/bank/Params", nil) @@ -26,6 +27,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgSend{}, &MsgMultiSend{}, &MsgUpdateParams{}, + &MsgSetMetadata{}, ) registry.RegisterImplementations( (*authz.Authorization)(nil), diff --git a/x/bank/types/msg_saga.go b/x/bank/types/msg_saga.go new file mode 100644 index 000000000000..5910332be6ee --- /dev/null +++ b/x/bank/types/msg_saga.go @@ -0,0 +1,51 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// bank message types +// const ( +// TypeMsgSetMetadata = "set_metadata" +// ) + +var ( + _ sdk.Msg = &MsgSetMetadata{} +) + +// NewMsgSetMetadata - construct a msg to send coins from one account to another. +// +//nolint:interfacer +func NewMsgSetMetadata(authority sdk.AccAddress, metadata Metadata) *MsgSetMetadata { + return &MsgSetMetadata{Authority: authority.String(), Metadata: metadata} +} + +// // Route Implements Msg. +// func (msg MsgSetMetadata) Route() string { return RouterKey } + +// // Type Implements Msg. +// func (msg MsgSetMetadata) Type() string { return TypeMsgSetMetadata } + +// // ValidateBasic Implements Msg. +// func (msg MsgSetMetadata) ValidateBasic() error { +// if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { +// return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) +// } + +// if err := msg.Metadata.Validate(); err != nil { +// return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid metadata: %v", err) +// } + +// return nil +// } + +// // GetSignBytes Implements Msg. +// func (msg MsgSetMetadata) GetSignBytes() []byte { +// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +// } + +// // GetSigners Implements Msg. +// func (msg MsgSetMetadata) GetSigners() []sdk.AccAddress { +// signer, _ := sdk.AccAddressFromBech32(msg.Authority) +// return []sdk.AccAddress{signer} +// } diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 74171878e69b..bab2e609e6ce 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -413,6 +413,100 @@ func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo +// MsgSetMetadata is the Msg/MsgSetMetadata request type. +// +// Since: cosmos-sdk 0.47-saga.2 +type MsgSetMetadata struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Metadata Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *MsgSetMetadata) Reset() { *m = MsgSetMetadata{} } +func (m *MsgSetMetadata) String() string { return proto.CompactTextString(m) } +func (*MsgSetMetadata) ProtoMessage() {} +func (*MsgSetMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{8} +} +func (m *MsgSetMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMetadata.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 *MsgSetMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMetadata.Merge(m, src) +} +func (m *MsgSetMetadata) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMetadata proto.InternalMessageInfo + +func (m *MsgSetMetadata) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSetMetadata) GetMetadata() Metadata { + if m != nil { + return m.Metadata + } + return Metadata{} +} + +// SetMetadataResponse defines the Msg/MsgSetMetadata response type. +// +// Since: cosmos-sdk 0.47-saga.2 +type MsgSetMetadataResponse struct { +} + +func (m *MsgSetMetadataResponse) Reset() { *m = MsgSetMetadataResponse{} } +func (m *MsgSetMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetMetadataResponse) ProtoMessage() {} +func (*MsgSetMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{9} +} +func (m *MsgSetMetadataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMetadataResponse.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 *MsgSetMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMetadataResponse.Merge(m, src) +} +func (m *MsgSetMetadataResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMetadataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMetadataResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") @@ -422,56 +516,62 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.bank.v1beta1.MsgUpdateParamsResponse") proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") + proto.RegisterType((*MsgSetMetadata)(nil), "cosmos.bank.v1beta1.MsgSetMetadata") + proto.RegisterType((*MsgSetMetadataResponse)(nil), "cosmos.bank.v1beta1.MsgSetMetadataResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 700 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4f, 0xd3, 0x50, - 0x1c, 0x5f, 0x99, 0x8e, 0xec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0x31, 0x6e, 0xc4, 0xd2, 0xeb, 0x2c, 0xc8, - 0xd6, 0x88, 0xa3, 0x3e, 0x01, 0xe7, 0xf8, 0xec, 0x4e, 0x76, 0xdd, 0xb4, 0x1c, 0x79, 0xed, 0xca, - 0x69, 0x68, 0xec, 0xa9, 0xbe, 0x00, 0xf9, 0xa3, 0xc3, 0x30, 0xdd, 0x4b, 0x92, 0x50, 0xb4, 0xb9, - 0xbe, 0x94, 0xc4, 0xda, 0x02, 0x85, 0x63, 0x03, 0xd9, 0x73, 0x43, 0x69, 0x96, 0x76, 0xed, 0x2c, - 0xac, 0xa4, 0xc6, 0x3a, 0xb8, 0xd8, 0x31, 0x17, 0x33, 0xbd, 0x63, 0xa7, 0x79, 0x9a, 0x71, 0x36, - 0x5e, 0x5c, 0x49, 0x3b, 0xff, 0x8a, 0x4d, 0x79, 0x75, 0x79, 0x77, 0x5f, 0x57, 0xf6, 0xf6, 0x75, - 0xe5, 0xf7, 0xbe, 0xae, 0xbc, 0x3f, 0xd0, 0x33, 0x7b, 0x07, 0x7a, 0xe6, 0xc7, 0x81, 0x9e, 0x79, - 0x39, 0x77, 0xea, 0x3d, 0x27, 0xc7, 0x9e, 0x5f, 0x77, 0x56, 0x8e, 0x5f, 0xe7, 0x37, 0xfe, 0x05, - 0x00, 0x00, 0xff, 0xff, 0x5b, 0x5b, 0x43, 0xa9, 0xa0, 0x06, 0x00, 0x00, + // 765 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x4f, 0x13, 0x4b, + 0x1c, 0xef, 0xd2, 0xf7, 0xca, 0xeb, 0xb4, 0x0f, 0xc2, 0x3e, 0x02, 0xed, 0xc2, 0x6b, 0xa1, 0xef, + 0x85, 0xf0, 0x73, 0x57, 0xd0, 0x68, 0x52, 0xa3, 0xd1, 0x82, 0x24, 0x9a, 0x34, 0x9a, 0x12, 0x0f, + 0x7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f, 0xbe, 0x1d, 0x08, 0x0a, 0x45, 0x0f, 0x3a, 0x54, 0x16, 0x97, 0x7b, 0xe3, 0x65, + 0x7b, 0xe2, 0x05, 0x16, 0x85, 0x0c, 0x98, 0xe8, 0x5c, 0x09, 0x82, 0xad, 0xb5, 0xe3, 0x20, 0x5e, + 0x26, 0x96, 0xfa, 0x08, 0xfc, 0xc1, 0x2f, 0xe5, 0x74, 0xff, 0xbd, 0x88, 0xbb, 0xac, 0xfd, 0x7f, + 0x1e, 0x1a, 0x78, 0xaa, 0xcf, 0x40, 0xf2, 0xec, 0x96, 0xcf, 0x0e, 0x92, 0x84, 0x14, 0x6d, 0xe1, + 0x42, 0x4a, 0x68, 0x5d, 0x03, 0xe9, 0x8e, 0x9b, 0x36, 0x70, 0x43, 0x51, 0x96, 0xb6, 0x7c, 0x19, + 0x56, 0x58, 0x63, 0x07, 0x8c, 0x74, 0x0d, 0xfc, 0xdc, 0xe0, 0xd8, 0x51, 0x9e, 0xa6, 0x5f, 0x8e, + 0x17, 0x56, 0xaa, 0x82, 0x54, 0x74, 0xa2, 0xfe, 0x3b, 0x47, 0x1e, 0x90, 0xb4, 0xa5, 0x4b, 0x90, + 0x82, 0x02, 0xda, 0x9f, 0x2f, 0xd8, 0xd8, 0x94, 0xd6, 0x8f, 0xda, 0x39, 0xe5, 0xb8, 0x9d, 0x53, + 0x7e, 0xb4, 0x73, 0xca, 0x9b, 0x93, 0x5c, 0xec, 0xf8, 0x24, 0x17, 0xfb, 0x7a, 0x92, 0x8b, 0x3d, + 0x5f, 0x38, 0xf7, 0x0b, 0x21, 0x7f, 0x30, 0xf8, 0x87, 0xa2, 0x96, 0xe0, 0x1f, 0xc2, 0xeb, 0xbf, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xad, 0x6b, 0xe0, 0xe9, 0xda, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -502,6 +602,11 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) + // SetMetadata is an admin operation for setting the Metadata for + // a given denom. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + SetMetadata(ctx context.Context, in *MsgSetMetadata, opts ...grpc.CallOption) (*MsgSetMetadataResponse, error) } type msgClient struct { @@ -548,6 +653,15 @@ func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, o return out, nil } +func (c *msgClient) SetMetadata(ctx context.Context, in *MsgSetMetadata, opts ...grpc.CallOption) (*MsgSetMetadataResponse, error) { + out := new(MsgSetMetadataResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Send defines a method for sending coins from one account to another account. @@ -566,6 +680,11 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) + // SetMetadata is an admin operation for setting the Metadata for + // a given denom. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + SetMetadata(context.Context, *MsgSetMetadata) (*MsgSetMetadataResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -584,6 +703,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) SetSendEnabled(ctx context.Context, req *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") } +func (*UnimplementedMsgServer) SetMetadata(ctx context.Context, req *MsgSetMetadata) (*MsgSetMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMetadata not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -661,6 +783,24 @@ func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_SetMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetMetadata) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/SetMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMetadata(ctx, req.(*MsgSetMetadata)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -681,6 +821,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetSendEnabled", Handler: _Msg_SetSendEnabled_Handler, }, + { + MethodName: "SetMetadata", + Handler: _Msg_SetMetadata_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", @@ -973,6 +1117,69 @@ func (m *MsgSetSendEnabledResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *MsgSetMetadata) 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 *MsgSetMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetMetadataResponse) 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 *MsgSetMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1104,6 +1311,30 @@ func (m *MsgSetSendEnabledResponse) Size() (n int) { return n } +func (m *MsgSetMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSetMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1839,6 +2070,171 @@ func (m *MsgSetSendEnabledResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetMetadata) 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: MsgSetMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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 + } + if err := m.Metadata.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 *MsgSetMetadataResponse) 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: MsgSetMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 diff --git a/x/group/testutil/expected_keepers_mocks.go b/x/group/testutil/expected_keepers_mocks.go index 75d4c12f92ba..08fd86a6def6 100644 --- a/x/group/testutil/expected_keepers_mocks.go +++ b/x/group/testutil/expected_keepers_mocks.go @@ -241,3 +241,19 @@ func (mr *MockBankKeeperMockRecorder) UpdateParams(arg0, arg1 interface{}) *gomo mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateParams", reflect.TypeOf((*MockBankKeeper)(nil).UpdateParams), arg0, arg1) } + + +// SetMetadata mocks base method. +func (m *MockBankKeeper) SetMetadata(arg0 context.Context, arg1 *types1.MsgSetMetadata) (*types1.MsgSetMetadataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetMetadata", arg0, arg1) + ret0, _ := ret[0].(*types1.MsgSetMetadataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetMetadata indicates an expected call of SetMetadata. +func (mr *MockBankKeeperMockRecorder) SetMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetMetadata", reflect.TypeOf((*MockBankKeeper)(nil).SetMetadata), arg0, arg1) +} \ No newline at end of file