diff --git a/api/cosmos/crosschain/v1/crosschain.pulsar.go b/api/cosmos/crosschain/v1/crosschain.pulsar.go index f8164c6055..fd08a8c021 100644 --- a/api/cosmos/crosschain/v1/crosschain.pulsar.go +++ b/api/cosmos/crosschain/v1/crosschain.pulsar.go @@ -435,6 +435,506 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } +var ( + md_ChannelPermission protoreflect.MessageDescriptor + fd_ChannelPermission_dest_chain_id protoreflect.FieldDescriptor + fd_ChannelPermission_channel_id protoreflect.FieldDescriptor + fd_ChannelPermission_permission protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_crosschain_v1_crosschain_proto_init() + md_ChannelPermission = File_cosmos_crosschain_v1_crosschain_proto.Messages().ByName("ChannelPermission") + fd_ChannelPermission_dest_chain_id = md_ChannelPermission.Fields().ByName("dest_chain_id") + fd_ChannelPermission_channel_id = md_ChannelPermission.Fields().ByName("channel_id") + fd_ChannelPermission_permission = md_ChannelPermission.Fields().ByName("permission") +} + +var _ protoreflect.Message = (*fastReflection_ChannelPermission)(nil) + +type fastReflection_ChannelPermission ChannelPermission + +func (x *ChannelPermission) ProtoReflect() protoreflect.Message { + return (*fastReflection_ChannelPermission)(x) +} + +func (x *ChannelPermission) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_crosschain_v1_crosschain_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_ChannelPermission_messageType fastReflection_ChannelPermission_messageType +var _ protoreflect.MessageType = fastReflection_ChannelPermission_messageType{} + +type fastReflection_ChannelPermission_messageType struct{} + +func (x fastReflection_ChannelPermission_messageType) Zero() protoreflect.Message { + return (*fastReflection_ChannelPermission)(nil) +} +func (x fastReflection_ChannelPermission_messageType) New() protoreflect.Message { + return new(fastReflection_ChannelPermission) +} +func (x fastReflection_ChannelPermission_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ChannelPermission +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ChannelPermission) Descriptor() protoreflect.MessageDescriptor { + return md_ChannelPermission +} + +// 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_ChannelPermission) Type() protoreflect.MessageType { + return _fastReflection_ChannelPermission_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ChannelPermission) New() protoreflect.Message { + return new(fastReflection_ChannelPermission) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ChannelPermission) Interface() protoreflect.ProtoMessage { + return (*ChannelPermission)(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_ChannelPermission) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DestChainId != uint32(0) { + value := protoreflect.ValueOfUint32(x.DestChainId) + if !f(fd_ChannelPermission_dest_chain_id, value) { + return + } + } + if x.ChannelId != uint32(0) { + value := protoreflect.ValueOfUint32(x.ChannelId) + if !f(fd_ChannelPermission_channel_id, value) { + return + } + } + if x.Permission != uint32(0) { + value := protoreflect.ValueOfUint32(x.Permission) + if !f(fd_ChannelPermission_permission, 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_ChannelPermission) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + return x.DestChainId != uint32(0) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + return x.ChannelId != uint32(0) + case "cosmos.crosschain.v1.ChannelPermission.permission": + return x.Permission != uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + x.DestChainId = uint32(0) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + x.ChannelId = uint32(0) + case "cosmos.crosschain.v1.ChannelPermission.permission": + x.Permission = uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + value := x.DestChainId + return protoreflect.ValueOfUint32(value) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + value := x.ChannelId + return protoreflect.ValueOfUint32(value) + case "cosmos.crosschain.v1.ChannelPermission.permission": + value := x.Permission + return protoreflect.ValueOfUint32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + x.DestChainId = uint32(value.Uint()) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + x.ChannelId = uint32(value.Uint()) + case "cosmos.crosschain.v1.ChannelPermission.permission": + x.Permission = uint32(value.Uint()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + panic(fmt.Errorf("field dest_chain_id of message cosmos.crosschain.v1.ChannelPermission is not mutable")) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + panic(fmt.Errorf("field channel_id of message cosmos.crosschain.v1.ChannelPermission is not mutable")) + case "cosmos.crosschain.v1.ChannelPermission.permission": + panic(fmt.Errorf("field permission of message cosmos.crosschain.v1.ChannelPermission is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.crosschain.v1.ChannelPermission.dest_chain_id": + return protoreflect.ValueOfUint32(uint32(0)) + case "cosmos.crosschain.v1.ChannelPermission.channel_id": + return protoreflect.ValueOfUint32(uint32(0)) + case "cosmos.crosschain.v1.ChannelPermission.permission": + return protoreflect.ValueOfUint32(uint32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.ChannelPermission")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.ChannelPermission 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_ChannelPermission) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.crosschain.v1.ChannelPermission", 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_ChannelPermission) 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_ChannelPermission) 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_ChannelPermission) 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_ChannelPermission) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ChannelPermission) + 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.DestChainId != 0 { + n += 1 + runtime.Sov(uint64(x.DestChainId)) + } + if x.ChannelId != 0 { + n += 1 + runtime.Sov(uint64(x.ChannelId)) + } + if x.Permission != 0 { + n += 1 + runtime.Sov(uint64(x.Permission)) + } + 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().(*ChannelPermission) + 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.Permission != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Permission)) + i-- + dAtA[i] = 0x18 + } + if x.ChannelId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ChannelId)) + i-- + dAtA[i] = 0x10 + } + if x.DestChainId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DestChainId)) + 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().(*ChannelPermission) + 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: ChannelPermission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChannelPermission: 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 DestChainId", wireType) + } + x.DestChainId = 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.DestChainId |= uint32(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 ChannelId", wireType) + } + x.ChannelId = 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.ChannelId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + x.Permission = 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.Permission |= uint32(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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -485,6 +985,61 @@ func (x *Params) GetInitModuleBalance() string { return "" } +// ChannelPermission defines the fields of the channel permission +type ChannelPermission struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // destination chain id + DestChainId uint32 `protobuf:"varint,1,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` + // channel id + ChannelId uint32 `protobuf:"varint,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // permission status, 1 for allow, 0 for forbidden + Permission uint32 `protobuf:"varint,3,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (x *ChannelPermission) Reset() { + *x = ChannelPermission{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_crosschain_v1_crosschain_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelPermission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelPermission) ProtoMessage() {} + +// Deprecated: Use ChannelPermission.ProtoReflect.Descriptor instead. +func (*ChannelPermission) Descriptor() ([]byte, []int) { + return file_cosmos_crosschain_v1_crosschain_proto_rawDescGZIP(), []int{1} +} + +func (x *ChannelPermission) GetDestChainId() uint32 { + if x != nil { + return x.DestChainId + } + return 0 +} + +func (x *ChannelPermission) GetChannelId() uint32 { + if x != nil { + return x.ChannelId + } + return 0 +} + +func (x *ChannelPermission) GetPermission() uint32 { + if x != nil { + return x.Permission + } + return 0 +} + var File_cosmos_crosschain_v1_crosschain_proto protoreflect.FileDescriptor var file_cosmos_crosschain_v1_crosschain_proto_rawDesc = []byte{ @@ -505,21 +1060,29 @@ var file_cosmos_crosschain_v1_crosschain_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x11, 0x69, 0x6e, 0x69, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x23, 0x8a, 0xe7, 0xb0, 0x2a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x72, - 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0xd1, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, - 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x43, 0x72, - 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x76, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xd1, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, + 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, + 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x6f, + 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -534,9 +1097,10 @@ func file_cosmos_crosschain_v1_crosschain_proto_rawDescGZIP() []byte { return file_cosmos_crosschain_v1_crosschain_proto_rawDescData } -var file_cosmos_crosschain_v1_crosschain_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_crosschain_v1_crosschain_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_crosschain_v1_crosschain_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: cosmos.crosschain.v1.Params + (*Params)(nil), // 0: cosmos.crosschain.v1.Params + (*ChannelPermission)(nil), // 1: cosmos.crosschain.v1.ChannelPermission } var file_cosmos_crosschain_v1_crosschain_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -564,6 +1128,18 @@ func file_cosmos_crosschain_v1_crosschain_proto_init() { return nil } } + file_cosmos_crosschain_v1_crosschain_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelPermission); 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{ @@ -571,7 +1147,7 @@ func file_cosmos_crosschain_v1_crosschain_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_crosschain_v1_crosschain_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/crosschain/v1/tx.pulsar.go b/api/cosmos/crosschain/v1/tx.pulsar.go index 7e84ed33a3..1c6f24e4a3 100644 --- a/api/cosmos/crosschain/v1/tx.pulsar.go +++ b/api/cosmos/crosschain/v1/tx.pulsar.go @@ -871,6 +871,920 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var _ protoreflect.List = (*_MsgUpdateChannelPermissions_2_list)(nil) + +type _MsgUpdateChannelPermissions_2_list struct { + list *[]*ChannelPermission +} + +func (x *_MsgUpdateChannelPermissions_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateChannelPermissions_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgUpdateChannelPermissions_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ChannelPermission) + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateChannelPermissions_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ChannelPermission) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateChannelPermissions_2_list) AppendMutable() protoreflect.Value { + v := new(ChannelPermission) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateChannelPermissions_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateChannelPermissions_2_list) NewElement() protoreflect.Value { + v := new(ChannelPermission) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateChannelPermissions_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgUpdateChannelPermissions protoreflect.MessageDescriptor + fd_MsgUpdateChannelPermissions_authority protoreflect.FieldDescriptor + fd_MsgUpdateChannelPermissions_channel_permissions protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_crosschain_v1_tx_proto_init() + md_MsgUpdateChannelPermissions = File_cosmos_crosschain_v1_tx_proto.Messages().ByName("MsgUpdateChannelPermissions") + fd_MsgUpdateChannelPermissions_authority = md_MsgUpdateChannelPermissions.Fields().ByName("authority") + fd_MsgUpdateChannelPermissions_channel_permissions = md_MsgUpdateChannelPermissions.Fields().ByName("channel_permissions") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateChannelPermissions)(nil) + +type fastReflection_MsgUpdateChannelPermissions MsgUpdateChannelPermissions + +func (x *MsgUpdateChannelPermissions) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateChannelPermissions)(x) +} + +func (x *MsgUpdateChannelPermissions) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_crosschain_v1_tx_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_MsgUpdateChannelPermissions_messageType fastReflection_MsgUpdateChannelPermissions_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateChannelPermissions_messageType{} + +type fastReflection_MsgUpdateChannelPermissions_messageType struct{} + +func (x fastReflection_MsgUpdateChannelPermissions_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateChannelPermissions)(nil) +} +func (x fastReflection_MsgUpdateChannelPermissions_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateChannelPermissions) +} +func (x fastReflection_MsgUpdateChannelPermissions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateChannelPermissions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateChannelPermissions) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateChannelPermissions +} + +// 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_MsgUpdateChannelPermissions) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateChannelPermissions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateChannelPermissions) New() protoreflect.Message { + return new(fastReflection_MsgUpdateChannelPermissions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateChannelPermissions) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateChannelPermissions)(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_MsgUpdateChannelPermissions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateChannelPermissions_authority, value) { + return + } + } + if len(x.ChannelPermissions) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateChannelPermissions_2_list{list: &x.ChannelPermissions}) + if !f(fd_MsgUpdateChannelPermissions_channel_permissions, 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_MsgUpdateChannelPermissions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + return x.Authority != "" + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + return len(x.ChannelPermissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + x.Authority = "" + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + x.ChannelPermissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + if len(x.ChannelPermissions) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateChannelPermissions_2_list{}) + } + listValue := &_MsgUpdateChannelPermissions_2_list{list: &x.ChannelPermissions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + x.Authority = value.Interface().(string) + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + lv := value.List() + clv := lv.(*_MsgUpdateChannelPermissions_2_list) + x.ChannelPermissions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + if x.ChannelPermissions == nil { + x.ChannelPermissions = []*ChannelPermission{} + } + value := &_MsgUpdateChannelPermissions_2_list{list: &x.ChannelPermissions} + return protoreflect.ValueOfList(value) + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + panic(fmt.Errorf("field authority of message cosmos.crosschain.v1.MsgUpdateChannelPermissions is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.authority": + return protoreflect.ValueOfString("") + case "cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions": + list := []*ChannelPermission{} + return protoreflect.ValueOfList(&_MsgUpdateChannelPermissions_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissions")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissions 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_MsgUpdateChannelPermissions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.crosschain.v1.MsgUpdateChannelPermissions", 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_MsgUpdateChannelPermissions) 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_MsgUpdateChannelPermissions) 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_MsgUpdateChannelPermissions) 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_MsgUpdateChannelPermissions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateChannelPermissions) + 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 len(x.ChannelPermissions) > 0 { + for _, e := range x.ChannelPermissions { + 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().(*MsgUpdateChannelPermissions) + 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.ChannelPermissions) > 0 { + for iNdEx := len(x.ChannelPermissions) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ChannelPermissions[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.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().(*MsgUpdateChannelPermissions) + 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: MsgUpdateChannelPermissions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateChannelPermissions: 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 ChannelPermissions", 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.ChannelPermissions = append(x.ChannelPermissions, &ChannelPermission{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ChannelPermissions[len(x.ChannelPermissions)-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_MsgUpdateChannelPermissionsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_crosschain_v1_tx_proto_init() + md_MsgUpdateChannelPermissionsResponse = File_cosmos_crosschain_v1_tx_proto.Messages().ByName("MsgUpdateChannelPermissionsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateChannelPermissionsResponse)(nil) + +type fastReflection_MsgUpdateChannelPermissionsResponse MsgUpdateChannelPermissionsResponse + +func (x *MsgUpdateChannelPermissionsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateChannelPermissionsResponse)(x) +} + +func (x *MsgUpdateChannelPermissionsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_crosschain_v1_tx_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_MsgUpdateChannelPermissionsResponse_messageType fastReflection_MsgUpdateChannelPermissionsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateChannelPermissionsResponse_messageType{} + +type fastReflection_MsgUpdateChannelPermissionsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateChannelPermissionsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateChannelPermissionsResponse)(nil) +} +func (x fastReflection_MsgUpdateChannelPermissionsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateChannelPermissionsResponse) +} +func (x fastReflection_MsgUpdateChannelPermissionsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateChannelPermissionsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateChannelPermissionsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateChannelPermissionsResponse +} + +// 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_MsgUpdateChannelPermissionsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateChannelPermissionsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateChannelPermissionsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateChannelPermissionsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateChannelPermissionsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateChannelPermissionsResponse)(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_MsgUpdateChannelPermissionsResponse) 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_MsgUpdateChannelPermissionsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) 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.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse")) + } + panic(fmt.Errorf("message cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse 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_MsgUpdateChannelPermissionsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse", 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_MsgUpdateChannelPermissionsResponse) 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_MsgUpdateChannelPermissionsResponse) 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_MsgUpdateChannelPermissionsResponse) 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_MsgUpdateChannelPermissionsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateChannelPermissionsResponse) + 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().(*MsgUpdateChannelPermissionsResponse) + 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().(*MsgUpdateChannelPermissionsResponse) + 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: MsgUpdateChannelPermissionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateChannelPermissionsResponse: 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, + } +} + // Since: cosmos-sdk 0.47 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -962,6 +1876,80 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_crosschain_v1_tx_proto_rawDescGZIP(), []int{1} } +// MsgUpdateChannelPermissions is the Msg/MsgUpdateChannelPermissions request type. +type MsgUpdateChannelPermissions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // channel_permissions defines the channel permissions to update + ChannelPermissions []*ChannelPermission `protobuf:"bytes,2,rep,name=channel_permissions,json=channelPermissions,proto3" json:"channel_permissions,omitempty"` +} + +func (x *MsgUpdateChannelPermissions) Reset() { + *x = MsgUpdateChannelPermissions{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_crosschain_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateChannelPermissions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateChannelPermissions) ProtoMessage() {} + +// Deprecated: Use MsgUpdateChannelPermissions.ProtoReflect.Descriptor instead. +func (*MsgUpdateChannelPermissions) Descriptor() ([]byte, []int) { + return file_cosmos_crosschain_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgUpdateChannelPermissions) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateChannelPermissions) GetChannelPermissions() []*ChannelPermission { + if x != nil { + return x.ChannelPermissions + } + return nil +} + +// MsgUpdateChannelPermissionsResponse defines the response structure for executing a +// MsgUpdateChannelPermissions message. +type MsgUpdateChannelPermissionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateChannelPermissionsResponse) Reset() { + *x = MsgUpdateChannelPermissionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_crosschain_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateChannelPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateChannelPermissionsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateChannelPermissionsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateChannelPermissionsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_crosschain_v1_tx_proto_rawDescGZIP(), []int{3} +} + var File_cosmos_crosschain_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_crosschain_v1_tx_proto_rawDesc = []byte{ @@ -988,27 +1976,50 @@ var file_cosmos_crosschain_v1_tx_proto_rawDesc = []byte{ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0x72, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 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, 0x58, 0x0a, 0x13, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x12, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x25, 0x0a, 0x23, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfd, 0x01, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, + 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 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, 0x88, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, + 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x2e, 0x76, 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, 0x1a, 0x05, - 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc9, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, - 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, - 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc9, 0x01, 0x0a, 0x18, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x6f, 0x73, + 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x14, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x6f, + 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1023,21 +2034,27 @@ func file_cosmos_crosschain_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_crosschain_v1_tx_proto_rawDescData } -var file_cosmos_crosschain_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_crosschain_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cosmos_crosschain_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: cosmos.crosschain.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: cosmos.crosschain.v1.MsgUpdateParamsResponse - (*Params)(nil), // 2: cosmos.crosschain.v1.Params + (*MsgUpdateParams)(nil), // 0: cosmos.crosschain.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.crosschain.v1.MsgUpdateParamsResponse + (*MsgUpdateChannelPermissions)(nil), // 2: cosmos.crosschain.v1.MsgUpdateChannelPermissions + (*MsgUpdateChannelPermissionsResponse)(nil), // 3: cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse + (*Params)(nil), // 4: cosmos.crosschain.v1.Params + (*ChannelPermission)(nil), // 5: cosmos.crosschain.v1.ChannelPermission } var file_cosmos_crosschain_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.crosschain.v1.MsgUpdateParams.params:type_name -> cosmos.crosschain.v1.Params - 0, // 1: cosmos.crosschain.v1.Msg.UpdateParams:input_type -> cosmos.crosschain.v1.MsgUpdateParams - 1, // 2: cosmos.crosschain.v1.Msg.UpdateParams:output_type -> cosmos.crosschain.v1.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: cosmos.crosschain.v1.MsgUpdateParams.params:type_name -> cosmos.crosschain.v1.Params + 5, // 1: cosmos.crosschain.v1.MsgUpdateChannelPermissions.channel_permissions:type_name -> cosmos.crosschain.v1.ChannelPermission + 0, // 2: cosmos.crosschain.v1.Msg.UpdateParams:input_type -> cosmos.crosschain.v1.MsgUpdateParams + 2, // 3: cosmos.crosschain.v1.Msg.UpdateChannelPermissions:input_type -> cosmos.crosschain.v1.MsgUpdateChannelPermissions + 1, // 4: cosmos.crosschain.v1.Msg.UpdateParams:output_type -> cosmos.crosschain.v1.MsgUpdateParamsResponse + 3, // 5: cosmos.crosschain.v1.Msg.UpdateChannelPermissions:output_type -> cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] 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_crosschain_v1_tx_proto_init() } @@ -1071,6 +2088,30 @@ func file_cosmos_crosschain_v1_tx_proto_init() { return nil } } + file_cosmos_crosschain_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateChannelPermissions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_crosschain_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateChannelPermissionsResponse); 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{ @@ -1078,7 +2119,7 @@ func file_cosmos_crosschain_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_crosschain_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/crosschain/v1/tx_grpc.pb.go b/api/cosmos/crosschain/v1/tx_grpc.pb.go index 2e72497ec5..b057fc59a1 100644 --- a/api/cosmos/crosschain/v1/tx_grpc.pb.go +++ b/api/cosmos/crosschain/v1/tx_grpc.pb.go @@ -21,7 +21,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/cosmos.crosschain.v1.Msg/UpdateParams" + Msg_UpdateParams_FullMethodName = "/cosmos.crosschain.v1.Msg/UpdateParams" + Msg_UpdateChannelPermissions_FullMethodName = "/cosmos.crosschain.v1.Msg/UpdateChannelPermissions" ) // MsgClient is the client API for Msg service. @@ -33,6 +34,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // UpdateChannelPermissions defines a governance operation for updating the channel permissions. + // The authority is defined in the keeper. + UpdateChannelPermissions(ctx context.Context, in *MsgUpdateChannelPermissions, opts ...grpc.CallOption) (*MsgUpdateChannelPermissionsResponse, error) } type msgClient struct { @@ -52,6 +56,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) UpdateChannelPermissions(ctx context.Context, in *MsgUpdateChannelPermissions, opts ...grpc.CallOption) (*MsgUpdateChannelPermissionsResponse, error) { + out := new(MsgUpdateChannelPermissionsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateChannelPermissions_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 @@ -61,6 +74,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // UpdateChannelPermissions defines a governance operation for updating the channel permissions. + // The authority is defined in the keeper. + UpdateChannelPermissions(context.Context, *MsgUpdateChannelPermissions) (*MsgUpdateChannelPermissionsResponse, error) mustEmbedUnimplementedMsgServer() } @@ -71,6 +87,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) UpdateChannelPermissions(context.Context, *MsgUpdateChannelPermissions) (*MsgUpdateChannelPermissionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelPermissions not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -102,6 +121,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UpdateChannelPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateChannelPermissions) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateChannelPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateChannelPermissions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateChannelPermissions(ctx, req.(*MsgUpdateChannelPermissions)) + } + 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) @@ -113,6 +150,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "UpdateChannelPermissions", + Handler: _Msg_UpdateChannelPermissions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/crosschain/v1/tx.proto", diff --git a/proto/cosmos/crosschain/v1/crosschain.proto b/proto/cosmos/crosschain/v1/crosschain.proto index e29a1ca935..641f3ace6e 100644 --- a/proto/cosmos/crosschain/v1/crosschain.proto +++ b/proto/cosmos/crosschain/v1/crosschain.proto @@ -18,3 +18,13 @@ message Params { (gogoproto.nullable) = false ]; } + +// ChannelPermission defines the fields of the channel permission +message ChannelPermission { + // destination chain id + uint32 dest_chain_id = 1; + // channel id + uint32 channel_id = 2; + // permission status, 1 for allow, 0 for forbidden + uint32 permission = 3; +} \ No newline at end of file diff --git a/proto/cosmos/crosschain/v1/tx.proto b/proto/cosmos/crosschain/v1/tx.proto index c65b2cc889..5b352858d2 100644 --- a/proto/cosmos/crosschain/v1/tx.proto +++ b/proto/cosmos/crosschain/v1/tx.proto @@ -19,6 +19,10 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // UpdateChannelPermissions defines a governance operation for updating the channel permissions. + // The authority is defined in the keeper. + rpc UpdateChannelPermissions(MsgUpdateChannelPermissions) returns (MsgUpdateChannelPermissionsResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -37,3 +41,18 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. message MsgUpdateParamsResponse {} + +// MsgUpdateChannelPermissions is the Msg/MsgUpdateChannelPermissions request type. +message MsgUpdateChannelPermissions { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // channel_permissions defines the channel permissions to update + repeated ChannelPermission channel_permissions = 2; +} + +// MsgUpdateChannelPermissionsResponse defines the response structure for executing a +// MsgUpdateChannelPermissions message. +message MsgUpdateChannelPermissionsResponse {} \ No newline at end of file diff --git a/x/crosschain/keeper/keeper.go b/x/crosschain/keeper/keeper.go index 419d43b1b6..49689cba68 100644 --- a/x/crosschain/keeper/keeper.go +++ b/x/crosschain/keeper/keeper.go @@ -91,6 +91,24 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { return nil } +// UpdatePermissions updates the permission of channels +func (k Keeper) UpdatePermissions(ctx sdk.Context, permissions []*types.ChannelPermission) error { + for _, permission := range permissions { + if !k.IsDestChainSupported(sdk.ChainID(permission.DestChainId)) { + return fmt.Errorf("dest chain %d is not supported", permission.DestChainId) + } + if !k.IsChannelSupported(sdk.ChannelID(permission.ChannelId)) { + return fmt.Errorf("channel %d is not supported", permission.ChannelId) + } + if sdk.ChannelPermission(permission.Permission) != sdk.ChannelAllow && sdk.ChannelPermission(permission.Permission) != sdk.ChannelForbidden { + return fmt.Errorf("permission %d is not supported", permission.Permission) + } + + k.SetChannelSendPermission(ctx, sdk.ChainID(permission.DestChainId), sdk.ChannelID(permission.ChannelId), sdk.ChannelPermission(permission.Permission)) + } + return nil +} + // CreateRawIBCPackageWithFee creates a cross chain package with given cross chain fee func (k Keeper) CreateRawIBCPackageWithFee(ctx sdk.Context, destChainId sdk.ChainID, channelID sdk.ChannelID, packageType sdk.CrossChainPackageType, packageLoad []byte, relayerFee, ackRelayerFee *big.Int, @@ -160,6 +178,12 @@ func (k Keeper) IsDestChainSupported(chainID sdk.ChainID) bool { return chainID == k.cfg.destBscChainId } +// IsChannelSupported returns the support status of a channel +func (k Keeper) IsChannelSupported(channelId sdk.ChannelID) bool { + _, ok := k.cfg.channelIDToName[channelId] + return ok +} + // SetChannelSendPermission sets the channel send permission func (k Keeper) SetChannelSendPermission(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID, permission sdk.ChannelPermission) { kvStore := ctx.KVStore(k.storeKey) diff --git a/x/crosschain/keeper/keeper_test.go b/x/crosschain/keeper/keeper_test.go index 7345a9d286..7f77ad1887 100644 --- a/x/crosschain/keeper/keeper_test.go +++ b/x/crosschain/keeper/keeper_test.go @@ -102,3 +102,23 @@ func (s *TestSuite) TestSetChannelSendPermission() { permission := s.crossChainKeeper.GetChannelSendPermission(s.ctx, sdk.ChainID(1), sdk.ChannelID(1)) s.Require().EqualValues(sdk.ChannelAllow, permission) } + +func (s *TestSuite) TestUpdateChannelPermission() { + s.crossChainKeeper.RegisterChannel("test", 1, &testutil2.MockCrossChainApplication{}) + s.crossChainKeeper.SetDestChainID(1) + + s.crossChainKeeper.SetChannelSendPermission(s.ctx, sdk.ChainID(1), sdk.ChannelID(1), sdk.ChannelAllow) + + permissions := []*types.ChannelPermission{ + &types.ChannelPermission{ + DestChainId: 1, + ChannelId: 1, + Permission: 0, + }, + } + err := s.crossChainKeeper.UpdatePermissions(s.ctx, permissions) + s.Require().NoError(err) + + permission := s.crossChainKeeper.GetChannelSendPermission(s.ctx, sdk.ChainID(1), sdk.ChannelID(1)) + s.Require().EqualValues(sdk.ChannelForbidden, permission) +} diff --git a/x/crosschain/keeper/msg_server.go b/x/crosschain/keeper/msg_server.go index 862577f5d1..695a9ff36a 100644 --- a/x/crosschain/keeper/msg_server.go +++ b/x/crosschain/keeper/msg_server.go @@ -33,3 +33,16 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam return &types.MsgUpdateParamsResponse{}, nil } + +func (k msgServer) UpdateChannelPermissions(goCtx context.Context, req *types.MsgUpdateChannelPermissions) (*types.MsgUpdateChannelPermissionsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.UpdatePermissions(ctx, req.ChannelPermissions); err != nil { + return nil, err + } + + return &types.MsgUpdateChannelPermissionsResponse{}, nil +} diff --git a/x/crosschain/module.go b/x/crosschain/module.go index 6361f1ef02..c6d152c2a2 100644 --- a/x/crosschain/module.go +++ b/x/crosschain/module.go @@ -74,7 +74,9 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.NewQueryCmd() } -func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {} +func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} // AppModule implements an application module for the distribution module. type AppModule struct { @@ -117,6 +119,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) {} // RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/crosschain/types/codec.go b/x/crosschain/types/codec.go index 14877b9f71..416fb765a6 100644 --- a/x/crosschain/types/codec.go +++ b/x/crosschain/types/codec.go @@ -16,6 +16,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, + &MsgUpdateChannelPermissions{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/crosschain/types/crosschain.pb.go b/x/crosschain/types/crosschain.pb.go index 063e1af114..7433445ca1 100644 --- a/x/crosschain/types/crosschain.pb.go +++ b/x/crosschain/types/crosschain.pb.go @@ -65,8 +65,73 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +// ChannelPermission defines the fields of the channel permission +type ChannelPermission struct { + // destination chain id + DestChainId uint32 `protobuf:"varint,1,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` + // channel id + ChannelId uint32 `protobuf:"varint,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // permission status, 1 for allow, 0 for forbidden + Permission uint32 `protobuf:"varint,3,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *ChannelPermission) Reset() { *m = ChannelPermission{} } +func (m *ChannelPermission) String() string { return proto.CompactTextString(m) } +func (*ChannelPermission) ProtoMessage() {} +func (*ChannelPermission) Descriptor() ([]byte, []int) { + return fileDescriptor_d7b94a7254cf916a, []int{1} +} +func (m *ChannelPermission) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChannelPermission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChannelPermission.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 *ChannelPermission) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelPermission.Merge(m, src) +} +func (m *ChannelPermission) XXX_Size() int { + return m.Size() +} +func (m *ChannelPermission) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelPermission.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelPermission proto.InternalMessageInfo + +func (m *ChannelPermission) GetDestChainId() uint32 { + if m != nil { + return m.DestChainId + } + return 0 +} + +func (m *ChannelPermission) GetChannelId() uint32 { + if m != nil { + return m.ChannelId + } + return 0 +} + +func (m *ChannelPermission) GetPermission() uint32 { + if m != nil { + return m.Permission + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "cosmos.crosschain.v1.Params") + proto.RegisterType((*ChannelPermission)(nil), "cosmos.crosschain.v1.ChannelPermission") } func init() { @@ -74,7 +139,7 @@ func init() { } var fileDescriptor_d7b94a7254cf916a = []byte{ - // 253 bytes of a gzipped FileDescriptorProto + // 330 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2f, 0x2e, 0x4e, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x33, 0x44, 0xe2, 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x89, 0x40, 0x94, 0xe9, 0x21, 0x49, 0x94, @@ -87,10 +152,15 @@ var fileDescriptor_d7b94a7254cf916a = []byte{ 0x0f, 0x73, 0x3b, 0x98, 0xd2, 0x2d, 0x4e, 0xc9, 0xd6, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0xf3, 0xcc, 0x2b, 0xb9, 0xb4, 0x45, 0x97, 0x0b, 0xea, 0x20, 0xcf, 0xbc, 0x92, 0x20, 0x41, 0x90, 0xc1, 0xbe, 0x60, 0x73, 0x9d, 0x20, 0xc6, 0x5a, 0x29, 0x77, 0x3d, 0xdf, 0xa0, 0x25, 0x87, 0xa4, 0xb7, - 0x02, 0x39, 0x10, 0x20, 0x4e, 0x72, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, - 0x86, 0x28, 0x7d, 0xbc, 0xee, 0x40, 0x31, 0x0b, 0xec, 0xa8, 0x24, 0x36, 0xb0, 0x7f, 0x8d, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x39, 0xd6, 0x62, 0x72, 0x01, 0x00, 0x00, + 0x02, 0x39, 0x10, 0x20, 0x4e, 0x52, 0x2a, 0xe3, 0x12, 0x74, 0xce, 0x48, 0xcc, 0xcb, 0x4b, 0xcd, + 0x09, 0x48, 0x2d, 0xca, 0xcd, 0x2c, 0x2e, 0xce, 0xcc, 0xcf, 0x13, 0x52, 0xe2, 0xe2, 0x4d, 0x49, + 0x2d, 0x2e, 0x89, 0x07, 0xab, 0x8c, 0xcf, 0x4c, 0x01, 0xbb, 0x90, 0x37, 0x88, 0x1b, 0x24, 0xe8, + 0x0c, 0x12, 0xf3, 0x4c, 0x11, 0x92, 0xe5, 0xe2, 0x4a, 0x86, 0x68, 0x04, 0x29, 0x60, 0x02, 0x2b, + 0xe0, 0x84, 0x8a, 0x78, 0xa6, 0x08, 0xc9, 0x71, 0x71, 0x15, 0xc0, 0x0d, 0x94, 0x60, 0x06, 0x4b, + 0x23, 0x89, 0x38, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, + 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x3e, + 0x5e, 0xff, 0xa3, 0xf8, 0x01, 0x1c, 0x18, 0x49, 0x6c, 0xe0, 0x70, 0x36, 0x06, 0x04, 0x00, 0x00, + 0xff, 0xff, 0xcb, 0x97, 0x26, 0xfa, 0xea, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -126,6 +196,44 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ChannelPermission) 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 *ChannelPermission) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChannelPermission) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Permission != 0 { + i = encodeVarintCrosschain(dAtA, i, uint64(m.Permission)) + i-- + dAtA[i] = 0x18 + } + if m.ChannelId != 0 { + i = encodeVarintCrosschain(dAtA, i, uint64(m.ChannelId)) + i-- + dAtA[i] = 0x10 + } + if m.DestChainId != 0 { + i = encodeVarintCrosschain(dAtA, i, uint64(m.DestChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintCrosschain(dAtA []byte, offset int, v uint64) int { offset -= sovCrosschain(v) base := offset @@ -148,6 +256,24 @@ func (m *Params) Size() (n int) { return n } +func (m *ChannelPermission) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DestChainId != 0 { + n += 1 + sovCrosschain(uint64(m.DestChainId)) + } + if m.ChannelId != 0 { + n += 1 + sovCrosschain(uint64(m.ChannelId)) + } + if m.Permission != 0 { + n += 1 + sovCrosschain(uint64(m.Permission)) + } + return n +} + func sovCrosschain(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -238,6 +364,113 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *ChannelPermission) 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 ErrIntOverflowCrosschain + } + 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: ChannelPermission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChannelPermission: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DestChainId", wireType) + } + m.DestChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DestChainId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + m.ChannelId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChannelId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + m.Permission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Permission |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCrosschain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrosschain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCrosschain(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/crosschain/types/msgs.go b/x/crosschain/types/msgs.go index 432e26cbe4..ac9685fffd 100644 --- a/x/crosschain/types/msgs.go +++ b/x/crosschain/types/msgs.go @@ -1,6 +1,8 @@ package types import ( + "fmt" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -30,3 +32,29 @@ func (m *MsgUpdateParams) ValidateBasic() error { return nil } + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateChannelPermissions) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgUpdateChannelPermissions) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromHexUnsafe(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateChannelPermissions) ValidateBasic() error { + if _, err := sdk.AccAddressFromHexUnsafe(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + for _, per := range m.ChannelPermissions { + if per == nil { + return fmt.Errorf("channel permission is nil") + } + } + + return nil +} diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 2142568a9b..58cb953942 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -126,15 +126,110 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgUpdateChannelPermissions is the Msg/MsgUpdateChannelPermissions request type. +type MsgUpdateChannelPermissions struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // channel_permissions defines the channel permissions to update + ChannelPermissions []*ChannelPermission `protobuf:"bytes,2,rep,name=channel_permissions,json=channelPermissions,proto3" json:"channel_permissions,omitempty"` +} + +func (m *MsgUpdateChannelPermissions) Reset() { *m = MsgUpdateChannelPermissions{} } +func (m *MsgUpdateChannelPermissions) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateChannelPermissions) ProtoMessage() {} +func (*MsgUpdateChannelPermissions) Descriptor() ([]byte, []int) { + return fileDescriptor_bdb806a4c5354501, []int{2} +} +func (m *MsgUpdateChannelPermissions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateChannelPermissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateChannelPermissions.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 *MsgUpdateChannelPermissions) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateChannelPermissions.Merge(m, src) +} +func (m *MsgUpdateChannelPermissions) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateChannelPermissions) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateChannelPermissions.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateChannelPermissions proto.InternalMessageInfo + +func (m *MsgUpdateChannelPermissions) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateChannelPermissions) GetChannelPermissions() []*ChannelPermission { + if m != nil { + return m.ChannelPermissions + } + return nil +} + +// MsgUpdateChannelPermissionsResponse defines the response structure for executing a +// MsgUpdateChannelPermissions message. +type MsgUpdateChannelPermissionsResponse struct { +} + +func (m *MsgUpdateChannelPermissionsResponse) Reset() { *m = MsgUpdateChannelPermissionsResponse{} } +func (m *MsgUpdateChannelPermissionsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateChannelPermissionsResponse) ProtoMessage() {} +func (*MsgUpdateChannelPermissionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bdb806a4c5354501, []int{3} +} +func (m *MsgUpdateChannelPermissionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateChannelPermissionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateChannelPermissionsResponse.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 *MsgUpdateChannelPermissionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateChannelPermissionsResponse.Merge(m, src) +} +func (m *MsgUpdateChannelPermissionsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateChannelPermissionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateChannelPermissionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateChannelPermissionsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.crosschain.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.crosschain.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateChannelPermissions)(nil), "cosmos.crosschain.v1.MsgUpdateChannelPermissions") + proto.RegisterType((*MsgUpdateChannelPermissionsResponse)(nil), "cosmos.crosschain.v1.MsgUpdateChannelPermissionsResponse") } func init() { proto.RegisterFile("cosmos/crosschain/v1/tx.proto", fileDescriptor_bdb806a4c5354501) } var fileDescriptor_bdb806a4c5354501 = []byte{ - // 335 bytes of a gzipped FileDescriptorProto + // 422 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2f, 0x2e, 0x4e, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0x48, 0xeb, 0x21, 0xa4, @@ -149,13 +244,19 @@ var fileDescriptor_bdb806a4c5354501 = []byte{ 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa3, 0x87, 0xcd, 0xdb, 0x7a, 0x10, 0x5b, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0x9b, 0x15, 0x5f, 0xd3, 0xf3, 0x0d, 0x5a, 0x08, 0x03, 0x95, 0x24, 0xb9, 0xc4, 0xd1, 0xdc, 0x16, 0x94, 0x5a, 0x5c, 0x90, - 0x9f, 0x57, 0x9c, 0x6a, 0x54, 0xc4, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x94, 0xc2, 0xc5, 0x83, 0xe2, - 0x74, 0x55, 0xec, 0x56, 0xa2, 0x99, 0x22, 0xa5, 0x4b, 0x94, 0x32, 0x98, 0x65, 0x52, 0xac, 0x0d, - 0x20, 0x67, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, - 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, - 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x2c, 0x82, 0xc0, 0x94, 0x6e, - 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x72, 0x6c, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x43, - 0xdf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x07, 0xe9, 0xde, 0xf2, 0x38, 0x02, 0x00, 0x00, + 0x9f, 0x57, 0x9c, 0xaa, 0xb4, 0x9f, 0x91, 0x4b, 0x1a, 0x2e, 0xe7, 0x9c, 0x91, 0x98, 0x97, 0x97, + 0x9a, 0x13, 0x90, 0x5a, 0x94, 0x9b, 0x59, 0x5c, 0x9c, 0x99, 0x9f, 0x47, 0xbe, 0x1f, 0x22, 0xb8, + 0x84, 0x93, 0x21, 0xa6, 0xc5, 0x17, 0x20, 0x8c, 0x93, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0x52, + 0xc7, 0xee, 0x21, 0x0c, 0xeb, 0x83, 0x84, 0x92, 0x31, 0x5c, 0x84, 0xe1, 0x39, 0x55, 0x2e, 0x65, + 0x3c, 0x1e, 0x80, 0x79, 0xd4, 0xe8, 0x2f, 0x23, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x0a, 0x17, + 0x0f, 0x4a, 0x24, 0xa9, 0x62, 0x77, 0x0b, 0x5a, 0x78, 0x49, 0xe9, 0x12, 0xa5, 0x0c, 0x66, 0x9b, + 0x50, 0x07, 0x23, 0x97, 0x04, 0xce, 0x30, 0x35, 0x24, 0x60, 0x16, 0xa6, 0x16, 0x29, 0x4b, 0x92, + 0xb5, 0xc0, 0x9c, 0x22, 0xc5, 0xda, 0x00, 0x4a, 0x1b, 0x4e, 0x9e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x0f, 0xcb, 0x15, 0x60, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x39, 0x8b, 0x94, 0x54, + 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x93, 0xbc, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x22, 0x48, + 0x1d, 0x26, 0xad, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -175,6 +276,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // UpdateChannelPermissions defines a governance operation for updating the channel permissions. + // The authority is defined in the keeper. + UpdateChannelPermissions(ctx context.Context, in *MsgUpdateChannelPermissions, opts ...grpc.CallOption) (*MsgUpdateChannelPermissionsResponse, error) } type msgClient struct { @@ -194,6 +298,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) UpdateChannelPermissions(ctx context.Context, in *MsgUpdateChannelPermissions, opts ...grpc.CallOption) (*MsgUpdateChannelPermissionsResponse, error) { + out := new(MsgUpdateChannelPermissionsResponse) + err := c.cc.Invoke(ctx, "/cosmos.crosschain.v1.Msg/UpdateChannelPermissions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a governance operation for updating the x/crosschain module parameters. @@ -201,6 +314,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // UpdateChannelPermissions defines a governance operation for updating the channel permissions. + // The authority is defined in the keeper. + UpdateChannelPermissions(context.Context, *MsgUpdateChannelPermissions) (*MsgUpdateChannelPermissionsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -210,6 +326,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) UpdateChannelPermissions(ctx context.Context, req *MsgUpdateChannelPermissions) (*MsgUpdateChannelPermissionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelPermissions not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -233,6 +352,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UpdateChannelPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateChannelPermissions) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateChannelPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.crosschain.v1.Msg/UpdateChannelPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateChannelPermissions(ctx, req.(*MsgUpdateChannelPermissions)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.crosschain.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -241,6 +378,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "UpdateChannelPermissions", + Handler: _Msg_UpdateChannelPermissions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/crosschain/v1/tx.proto", @@ -309,6 +450,73 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgUpdateChannelPermissions) 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 *MsgUpdateChannelPermissions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateChannelPermissions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelPermissions) > 0 { + for iNdEx := len(m.ChannelPermissions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChannelPermissions[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.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 *MsgUpdateChannelPermissionsResponse) 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 *MsgUpdateChannelPermissionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateChannelPermissionsResponse) 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 @@ -344,6 +552,34 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgUpdateChannelPermissions) 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)) + } + if len(m.ChannelPermissions) > 0 { + for _, e := range m.ChannelPermissions { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateChannelPermissionsResponse) 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 } @@ -515,6 +751,172 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateChannelPermissions) 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: MsgUpdateChannelPermissions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateChannelPermissions: 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 ChannelPermissions", 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.ChannelPermissions = append(m.ChannelPermissions, &ChannelPermission{}) + if err := m.ChannelPermissions[len(m.ChannelPermissions)-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 *MsgUpdateChannelPermissionsResponse) 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: MsgUpdateChannelPermissionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateChannelPermissionsResponse: 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/gashub/types/genesis.go b/x/gashub/types/genesis.go index 16e4d06f8f..3cdd2f465c 100644 --- a/x/gashub/types/genesis.go +++ b/x/gashub/types/genesis.go @@ -45,6 +45,7 @@ func DefaultGenesisState() *GenesisState { *NewMsgGasParamsWithFixedGas("/cosmos.consensus.v1.MsgUpdateParams", 0), *NewMsgGasParamsWithFixedGas("/cosmos.crisis.v1.MsgUpdateParams", 0), *NewMsgGasParamsWithFixedGas("/cosmos.crosschain.v1.MsgUpdateParams", 0), + *NewMsgGasParamsWithFixedGas("/cosmos.crosschain.v1.MsgUpdateChannelPermissions", 0), *NewMsgGasParamsWithFixedGas("/cosmos.distribution.v1beta1.MsgUpdateParams", 0), *NewMsgGasParamsWithFixedGas("/cosmos.gashub.v1beta1.MsgUpdateParams", 0), *NewMsgGasParamsWithFixedGas("/cosmos.gov.v1.MsgUpdateParams", 0),