diff --git a/api/cosmos/gov/v1beta2/gov.pulsar.go b/api/cosmos/gov/v1beta2/gov.pulsar.go index 27fa41c6e760..3ed5ad014755 100644 --- a/api/cosmos/gov/v1beta2/gov.pulsar.go +++ b/api/cosmos/gov/v1beta2/gov.pulsar.go @@ -1342,8 +1342,8 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_Proposal_metadata, value) { return } @@ -1382,7 +1382,7 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.gov.v1beta2.Proposal.voting_end_time": return x.VotingEndTime != nil case "cosmos.gov.v1beta2.Proposal.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.Proposal")) @@ -1418,7 +1418,7 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.gov.v1beta2.Proposal.voting_end_time": x.VotingEndTime = nil case "cosmos.gov.v1beta2.Proposal.metadata": - x.Metadata = nil + x.Metadata = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.Proposal")) @@ -1470,7 +1470,7 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.gov.v1beta2.Proposal.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.Proposal")) @@ -1514,7 +1514,7 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro case "cosmos.gov.v1beta2.Proposal.voting_end_time": x.VotingEndTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.gov.v1beta2.Proposal.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.Proposal")) @@ -1617,7 +1617,7 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.gov.v1beta2.Proposal.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.Proposal")) @@ -2216,7 +2216,7 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2226,25 +2226,23 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5317,7 +5315,7 @@ type Proposal struct { VotingStartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3" json:"voting_start_time,omitempty"` VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - Metadata []byte `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *Proposal) Reset() { @@ -5403,11 +5401,11 @@ func (x *Proposal) GetVotingEndTime() *timestamppb.Timestamp { return nil } -func (x *Proposal) GetMetadata() []byte { +func (x *Proposal) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } // TallyResult defines a standard tally for a governance proposal. @@ -5735,7 +5733,7 @@ var file_cosmos_gov_v1beta2_gov_proto_rawDesc = []byte{ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, diff --git a/api/cosmos/gov/v1beta2/tx.pulsar.go b/api/cosmos/gov/v1beta2/tx.pulsar.go index a17b471c6468..535f5e4d8197 100644 --- a/api/cosmos/gov/v1beta2/tx.pulsar.go +++ b/api/cosmos/gov/v1beta2/tx.pulsar.go @@ -219,8 +219,8 @@ func (x *fastReflection_MsgSubmitProposal) Range(f func(protoreflect.FieldDescri return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgSubmitProposal_metadata, value) { return } @@ -247,7 +247,7 @@ func (x *fastReflection_MsgSubmitProposal) Has(fd protoreflect.FieldDescriptor) case "cosmos.gov.v1beta2.MsgSubmitProposal.proposer": return x.Proposer != "" case "cosmos.gov.v1beta2.MsgSubmitProposal.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgSubmitProposal")) @@ -271,7 +271,7 @@ func (x *fastReflection_MsgSubmitProposal) Clear(fd protoreflect.FieldDescriptor case "cosmos.gov.v1beta2.MsgSubmitProposal.proposer": x.Proposer = "" case "cosmos.gov.v1beta2.MsgSubmitProposal.metadata": - x.Metadata = nil + x.Metadata = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgSubmitProposal")) @@ -305,7 +305,7 @@ func (x *fastReflection_MsgSubmitProposal) Get(descriptor protoreflect.FieldDesc return protoreflect.ValueOfString(value) case "cosmos.gov.v1beta2.MsgSubmitProposal.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgSubmitProposal")) @@ -337,7 +337,7 @@ func (x *fastReflection_MsgSubmitProposal) Set(fd protoreflect.FieldDescriptor, case "cosmos.gov.v1beta2.MsgSubmitProposal.proposer": x.Proposer = value.Interface().(string) case "cosmos.gov.v1beta2.MsgSubmitProposal.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgSubmitProposal")) @@ -396,7 +396,7 @@ func (x *fastReflection_MsgSubmitProposal) NewField(fd protoreflect.FieldDescrip case "cosmos.gov.v1beta2.MsgSubmitProposal.proposer": return protoreflect.ValueOfString("") case "cosmos.gov.v1beta2.MsgSubmitProposal.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgSubmitProposal")) @@ -714,7 +714,7 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -724,25 +724,23 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4860,7 +4858,7 @@ type MsgSubmitProposal struct { InitialDeposit []*v1beta1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit,omitempty"` Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *MsgSubmitProposal) Reset() { @@ -4904,11 +4902,11 @@ func (x *MsgSubmitProposal) GetProposer() string { return "" } -func (x *MsgSubmitProposal) GetMetadata() []byte { +func (x *MsgSubmitProposal) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. @@ -5287,7 +5285,7 @@ var file_cosmos_gov_v1beta2_tx_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x03, 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, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, diff --git a/api/cosmos/group/v1beta1/tx.pulsar.go b/api/cosmos/group/v1beta1/tx.pulsar.go index b5fd018699ae..b1c24e78ae43 100644 --- a/api/cosmos/group/v1beta1/tx.pulsar.go +++ b/api/cosmos/group/v1beta1/tx.pulsar.go @@ -159,8 +159,8 @@ func (x *fastReflection_MsgCreateGroup) Range(f func(protoreflect.FieldDescripto return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgCreateGroup_metadata, value) { return } @@ -185,7 +185,7 @@ func (x *fastReflection_MsgCreateGroup) Has(fd protoreflect.FieldDescriptor) boo case "cosmos.group.v1beta1.MsgCreateGroup.members": return len(x.Members) != 0 case "cosmos.group.v1beta1.MsgCreateGroup.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup")) @@ -207,7 +207,7 @@ func (x *fastReflection_MsgCreateGroup) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.MsgCreateGroup.members": x.Members = nil case "cosmos.group.v1beta1.MsgCreateGroup.metadata": - x.Metadata = nil + x.Metadata = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup")) @@ -235,7 +235,7 @@ func (x *fastReflection_MsgCreateGroup) Get(descriptor protoreflect.FieldDescrip return protoreflect.ValueOfList(listValue) case "cosmos.group.v1beta1.MsgCreateGroup.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup")) @@ -263,7 +263,7 @@ func (x *fastReflection_MsgCreateGroup) Set(fd protoreflect.FieldDescriptor, val clv := lv.(*_MsgCreateGroup_2_list) x.Members = *clv.list case "cosmos.group.v1beta1.MsgCreateGroup.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup")) @@ -313,7 +313,7 @@ func (x *fastReflection_MsgCreateGroup) NewField(fd protoreflect.FieldDescriptor list := []*Member{} return protoreflect.ValueOfList(&_MsgCreateGroup_2_list{list: &list}) case "cosmos.group.v1beta1.MsgCreateGroup.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup")) @@ -575,7 +575,7 @@ func (x *fastReflection_MsgCreateGroup) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -585,25 +585,23 @@ func (x *fastReflection_MsgCreateGroup) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2986,8 +2984,8 @@ func (x *fastReflection_MsgUpdateGroupMetadata) Range(f func(protoreflect.FieldD return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgUpdateGroupMetadata_metadata, value) { return } @@ -3012,7 +3010,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) Has(fd protoreflect.FieldDescrip case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.group_id": return x.GroupId != uint64(0) case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata")) @@ -3034,7 +3032,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) Clear(fd protoreflect.FieldDescr case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.group_id": x.GroupId = uint64(0) case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata": - x.Metadata = nil + x.Metadata = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata")) @@ -3059,7 +3057,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) Get(descriptor protoreflect.Fiel return protoreflect.ValueOfUint64(value) case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata")) @@ -3085,7 +3083,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) Set(fd protoreflect.FieldDescrip case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.group_id": x.GroupId = value.Uint() case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata")) @@ -3130,7 +3128,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) NewField(fd protoreflect.FieldDe case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.group_id": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata")) @@ -3363,7 +3361,7 @@ func (x *fastReflection_MsgUpdateGroupMetadata) ProtoMethods() *protoiface.Metho if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3373,25 +3371,23 @@ func (x *fastReflection_MsgUpdateGroupMetadata) ProtoMethods() *protoiface.Metho } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3878,8 +3874,8 @@ func (x *fastReflection_MsgCreateGroupPolicy) Range(f func(protoreflect.FieldDes return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgCreateGroupPolicy_metadata, value) { return } @@ -3910,7 +3906,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) Has(fd protoreflect.FieldDescripto case "cosmos.group.v1beta1.MsgCreateGroupPolicy.group_id": return x.GroupId != uint64(0) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy": return x.DecisionPolicy != nil default: @@ -3934,7 +3930,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) Clear(fd protoreflect.FieldDescrip case "cosmos.group.v1beta1.MsgCreateGroupPolicy.group_id": x.GroupId = uint64(0) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy": x.DecisionPolicy = nil default: @@ -3961,7 +3957,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) Get(descriptor protoreflect.FieldD return protoreflect.ValueOfUint64(value) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy": value := x.DecisionPolicy return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -3990,7 +3986,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) Set(fd protoreflect.FieldDescripto case "cosmos.group.v1beta1.MsgCreateGroupPolicy.group_id": x.GroupId = value.Uint() case "cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy": x.DecisionPolicy = value.Message().Interface().(*anypb.Any) default: @@ -4042,7 +4038,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) NewField(fd protoreflect.FieldDesc case "cosmos.group.v1beta1.MsgCreateGroupPolicy.group_id": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -4296,7 +4292,7 @@ func (x *fastReflection_MsgCreateGroupPolicy) ProtoMethods() *protoiface.Methods if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4306,25 +4302,23 @@ func (x *fastReflection_MsgCreateGroupPolicy) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -5514,14 +5508,14 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) Range(f func(protoreflect.Fiel return } } - if len(x.GroupMetadata) != 0 { - value := protoreflect.ValueOfBytes(x.GroupMetadata) + if x.GroupMetadata != "" { + value := protoreflect.ValueOfString(x.GroupMetadata) if !f(fd_MsgCreateGroupWithPolicy_group_metadata, value) { return } } - if len(x.GroupPolicyMetadata) != 0 { - value := protoreflect.ValueOfBytes(x.GroupPolicyMetadata) + if x.GroupPolicyMetadata != "" { + value := protoreflect.ValueOfString(x.GroupPolicyMetadata) if !f(fd_MsgCreateGroupWithPolicy_group_policy_metadata, value) { return } @@ -5558,9 +5552,9 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) Has(fd protoreflect.FieldDescr case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.members": return len(x.Members) != 0 case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_metadata": - return len(x.GroupMetadata) != 0 + return x.GroupMetadata != "" case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_metadata": - return len(x.GroupPolicyMetadata) != 0 + return x.GroupPolicyMetadata != "" case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_as_admin": return x.GroupPolicyAsAdmin != false case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.decision_policy": @@ -5586,9 +5580,9 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) Clear(fd protoreflect.FieldDes case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.members": x.Members = nil case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_metadata": - x.GroupMetadata = nil + x.GroupMetadata = "" case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_metadata": - x.GroupPolicyMetadata = nil + x.GroupPolicyMetadata = "" case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_as_admin": x.GroupPolicyAsAdmin = false case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.decision_policy": @@ -5620,10 +5614,10 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) Get(descriptor protoreflect.Fi return protoreflect.ValueOfList(listValue) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_metadata": value := x.GroupMetadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_metadata": value := x.GroupPolicyMetadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_as_admin": value := x.GroupPolicyAsAdmin return protoreflect.ValueOfBool(value) @@ -5657,9 +5651,9 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) Set(fd protoreflect.FieldDescr clv := lv.(*_MsgCreateGroupWithPolicy_2_list) x.Members = *clv.list case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_metadata": - x.GroupMetadata = value.Bytes() + x.GroupMetadata = value.Interface().(string) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_metadata": - x.GroupPolicyMetadata = value.Bytes() + x.GroupPolicyMetadata = value.Interface().(string) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_as_admin": x.GroupPolicyAsAdmin = value.Bool() case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.decision_policy": @@ -5722,9 +5716,9 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) NewField(fd protoreflect.Field list := []*Member{} return protoreflect.ValueOfList(&_MsgCreateGroupWithPolicy_2_list{list: &list}) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.group_policy_as_admin": return protoreflect.ValueOfBool(false) case "cosmos.group.v1beta1.MsgCreateGroupWithPolicy.decision_policy": @@ -6033,7 +6027,7 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) ProtoMethods() *protoiface.Met if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GroupMetadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6043,31 +6037,29 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) ProtoMethods() *protoiface.Met } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.GroupMetadata = append(x.GroupMetadata[:0], dAtA[iNdEx:postIndex]...) - if x.GroupMetadata == nil { - x.GroupMetadata = []byte{} - } + x.GroupMetadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyMetadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6077,25 +6069,23 @@ func (x *fastReflection_MsgCreateGroupWithPolicy) ProtoMethods() *protoiface.Met } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.GroupPolicyMetadata = append(x.GroupPolicyMetadata[:0], dAtA[iNdEx:postIndex]...) - if x.GroupPolicyMetadata == nil { - x.GroupPolicyMetadata = []byte{} - } + x.GroupPolicyMetadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -8023,8 +8013,8 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Range(f func(protoreflect. return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgUpdateGroupPolicyMetadata_metadata, value) { return } @@ -8049,7 +8039,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Has(fd protoreflect.FieldD case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.address": return x.Address != "" case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")) @@ -8071,7 +8061,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Clear(fd protoreflect.Fiel case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.address": x.Address = "" case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata": - x.Metadata = nil + x.Metadata = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")) @@ -8096,7 +8086,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Get(descriptor protoreflec return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")) @@ -8122,7 +8112,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Set(fd protoreflect.FieldD case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.address": x.Address = value.Interface().(string) case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")) @@ -8167,7 +8157,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) NewField(fd protoreflect.F case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.address": return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")) @@ -8416,7 +8406,7 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) ProtoMethods() *protoiface if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -8426,25 +8416,23 @@ func (x *fastReflection_MsgUpdateGroupPolicyMetadata) ProtoMethods() *protoiface } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9030,8 +9018,8 @@ func (x *fastReflection_MsgSubmitProposal) Range(f func(protoreflect.FieldDescri return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgSubmitProposal_metadata, value) { return } @@ -9068,7 +9056,7 @@ func (x *fastReflection_MsgSubmitProposal) Has(fd protoreflect.FieldDescriptor) case "cosmos.group.v1beta1.MsgSubmitProposal.proposers": return len(x.Proposers) != 0 case "cosmos.group.v1beta1.MsgSubmitProposal.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.MsgSubmitProposal.messages": return len(x.Messages) != 0 case "cosmos.group.v1beta1.MsgSubmitProposal.exec": @@ -9094,7 +9082,7 @@ func (x *fastReflection_MsgSubmitProposal) Clear(fd protoreflect.FieldDescriptor case "cosmos.group.v1beta1.MsgSubmitProposal.proposers": x.Proposers = nil case "cosmos.group.v1beta1.MsgSubmitProposal.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.MsgSubmitProposal.messages": x.Messages = nil case "cosmos.group.v1beta1.MsgSubmitProposal.exec": @@ -9126,7 +9114,7 @@ func (x *fastReflection_MsgSubmitProposal) Get(descriptor protoreflect.FieldDesc return protoreflect.ValueOfList(listValue) case "cosmos.group.v1beta1.MsgSubmitProposal.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgSubmitProposal.messages": if len(x.Messages) == 0 { return protoreflect.ValueOfList(&_MsgSubmitProposal_4_list{}) @@ -9163,7 +9151,7 @@ func (x *fastReflection_MsgSubmitProposal) Set(fd protoreflect.FieldDescriptor, clv := lv.(*_MsgSubmitProposal_2_list) x.Proposers = *clv.list case "cosmos.group.v1beta1.MsgSubmitProposal.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.MsgSubmitProposal.messages": lv := value.List() clv := lv.(*_MsgSubmitProposal_4_list) @@ -9227,7 +9215,7 @@ func (x *fastReflection_MsgSubmitProposal) NewField(fd protoreflect.FieldDescrip list := []string{} return protoreflect.ValueOfList(&_MsgSubmitProposal_2_list{list: &list}) case "cosmos.group.v1beta1.MsgSubmitProposal.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgSubmitProposal.messages": list := []*anypb.Any{} return protoreflect.ValueOfList(&_MsgSubmitProposal_4_list{list: &list}) @@ -9515,7 +9503,7 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -9525,25 +9513,23 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -10963,8 +10949,8 @@ func (x *fastReflection_MsgVote) Range(f func(protoreflect.FieldDescriptor, prot return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_MsgVote_metadata, value) { return } @@ -10997,7 +10983,7 @@ func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.group.v1beta1.MsgVote.option": return x.Option != 0 case "cosmos.group.v1beta1.MsgVote.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.MsgVote.exec": return x.Exec != 0 default: @@ -11023,7 +11009,7 @@ func (x *fastReflection_MsgVote) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.MsgVote.option": x.Option = 0 case "cosmos.group.v1beta1.MsgVote.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.MsgVote.exec": x.Exec = 0 default: @@ -11053,7 +11039,7 @@ func (x *fastReflection_MsgVote) Get(descriptor protoreflect.FieldDescriptor) pr return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) case "cosmos.group.v1beta1.MsgVote.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.MsgVote.exec": value := x.Exec return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) @@ -11084,7 +11070,7 @@ func (x *fastReflection_MsgVote) Set(fd protoreflect.FieldDescriptor, value prot case "cosmos.group.v1beta1.MsgVote.option": x.Option = (VoteOption)(value.Enum()) case "cosmos.group.v1beta1.MsgVote.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.MsgVote.exec": x.Exec = (Exec)(value.Enum()) default: @@ -11137,7 +11123,7 @@ func (x *fastReflection_MsgVote) NewField(fd protoreflect.FieldDescriptor) proto case "cosmos.group.v1beta1.MsgVote.option": return protoreflect.ValueOfEnum(0) case "cosmos.group.v1beta1.MsgVote.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.MsgVote.exec": return protoreflect.ValueOfEnum(0) default: @@ -11407,7 +11393,7 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -11417,25 +11403,23 @@ func (x *fastReflection_MsgVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -12748,7 +12732,7 @@ type MsgCreateGroup struct { // members defines the group members. Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` // metadata is any arbitrary metadata to attached to the group. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *MsgCreateGroup) Reset() { @@ -12785,11 +12769,11 @@ func (x *MsgCreateGroup) GetMembers() []*Member { return nil } -func (x *MsgCreateGroup) GetMetadata() []byte { +func (x *MsgCreateGroup) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } // MsgCreateGroupResponse is the Msg/CreateGroup response type. @@ -13005,7 +12989,7 @@ type MsgUpdateGroupMetadata struct { // group_id is the unique ID of the group. GroupId uint64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // metadata is the updated group's metadata. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *MsgUpdateGroupMetadata) Reset() { @@ -13042,11 +13026,11 @@ func (x *MsgUpdateGroupMetadata) GetGroupId() uint64 { return 0 } -func (x *MsgUpdateGroupMetadata) GetMetadata() []byte { +func (x *MsgUpdateGroupMetadata) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } // MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. @@ -13087,7 +13071,7 @@ type MsgCreateGroupPolicy struct { // group_id is the unique ID of the group. GroupId uint64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // metadata is any arbitrary metadata attached to the group policy. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // decision_policy specifies the group policy's decision policy. DecisionPolicy *anypb.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` } @@ -13126,11 +13110,11 @@ func (x *MsgCreateGroupPolicy) GetGroupId() uint64 { return 0 } -func (x *MsgCreateGroupPolicy) GetMetadata() []byte { +func (x *MsgCreateGroupPolicy) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *MsgCreateGroupPolicy) GetDecisionPolicy() *anypb.Any { @@ -13243,9 +13227,9 @@ type MsgCreateGroupWithPolicy struct { // members defines the group members. Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` // group_metadata is any arbitrary metadata attached to the group. - GroupMetadata []byte `protobuf:"bytes,3,opt,name=group_metadata,json=groupMetadata,proto3" json:"group_metadata,omitempty"` + GroupMetadata string `protobuf:"bytes,3,opt,name=group_metadata,json=groupMetadata,proto3" json:"group_metadata,omitempty"` // group_policy_metadata is any arbitrary metadata attached to the group policy. - GroupPolicyMetadata []byte `protobuf:"bytes,4,opt,name=group_policy_metadata,json=groupPolicyMetadata,proto3" json:"group_policy_metadata,omitempty"` + GroupPolicyMetadata string `protobuf:"bytes,4,opt,name=group_policy_metadata,json=groupPolicyMetadata,proto3" json:"group_policy_metadata,omitempty"` // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. GroupPolicyAsAdmin bool `protobuf:"varint,5,opt,name=group_policy_as_admin,json=groupPolicyAsAdmin,proto3" json:"group_policy_as_admin,omitempty"` // decision_policy specifies the group policy's decision policy. @@ -13286,18 +13270,18 @@ func (x *MsgCreateGroupWithPolicy) GetMembers() []*Member { return nil } -func (x *MsgCreateGroupWithPolicy) GetGroupMetadata() []byte { +func (x *MsgCreateGroupWithPolicy) GetGroupMetadata() string { if x != nil { return x.GroupMetadata } - return nil + return "" } -func (x *MsgCreateGroupWithPolicy) GetGroupPolicyMetadata() []byte { +func (x *MsgCreateGroupWithPolicy) GetGroupPolicyMetadata() string { if x != nil { return x.GroupPolicyMetadata } - return nil + return "" } func (x *MsgCreateGroupWithPolicy) GetGroupPolicyAsAdmin() bool { @@ -13480,7 +13464,7 @@ type MsgUpdateGroupPolicyMetadata struct { // address is the account address of group policy. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // metadata is the updated group policy metadata. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (x *MsgUpdateGroupPolicyMetadata) Reset() { @@ -13517,11 +13501,11 @@ func (x *MsgUpdateGroupPolicyMetadata) GetAddress() string { return "" } -func (x *MsgUpdateGroupPolicyMetadata) GetMetadata() []byte { +func (x *MsgUpdateGroupPolicyMetadata) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } // MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. @@ -13563,7 +13547,7 @@ type MsgSubmitProposal struct { // Proposers signatures will be counted as yes votes. Proposers []string `protobuf:"bytes,2,rep,name=proposers,proto3" json:"proposers,omitempty"` // metadata is any arbitrary metadata to attached to the proposal. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. Messages []*anypb.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"` // exec defines the mode of execution of the proposal, @@ -13606,11 +13590,11 @@ func (x *MsgSubmitProposal) GetProposers() []string { return nil } -func (x *MsgSubmitProposal) GetMetadata() []byte { +func (x *MsgSubmitProposal) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *MsgSubmitProposal) GetMessages() []*anypb.Any { @@ -13750,7 +13734,7 @@ type MsgVote struct { // option is the voter's choice on the proposal. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.group.v1beta1.VoteOption" json:"option,omitempty"` // metadata is any arbitrary metadata to attached to the vote. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // exec defines whether the proposal should be executed // immediately after voting or not. Exec Exec `protobuf:"varint,5,opt,name=exec,proto3,enum=cosmos.group.v1beta1.Exec" json:"exec,omitempty"` @@ -13797,11 +13781,11 @@ func (x *MsgVote) GetOption() VoteOption { return VoteOption_VOTE_OPTION_UNSPECIFIED } -func (x *MsgVote) GetMetadata() []byte { +func (x *MsgVote) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *MsgVote) GetExec() Exec { @@ -13934,7 +13918,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x33, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, @@ -13973,7 +13957,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe0, 0x01, 0x0a, @@ -13984,7 +13968,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x51, 0x0a, 0x0f, + 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x12, 0xca, 0xb4, 0x2d, @@ -14018,10 +14002,10 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x67, 0x72, 0x6f, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x15, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x15, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x61, 0x73, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x67, @@ -14069,7 +14053,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x65, 0x73, 0x73, 0x18, 0x02, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x26, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, @@ -14081,7 +14065,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, @@ -14112,7 +14096,7 @@ var file_cosmos_group_v1beta1_tx_proto_rawDesc = []byte{ 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x04, 0x65, 0x78, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x04, 0x65, 0x78, diff --git a/api/cosmos/group/v1beta1/types.pulsar.go b/api/cosmos/group/v1beta1/types.pulsar.go index f9160f288dea..5bf337ab945a 100644 --- a/api/cosmos/group/v1beta1/types.pulsar.go +++ b/api/cosmos/group/v1beta1/types.pulsar.go @@ -111,8 +111,8 @@ func (x *fastReflection_Member) Range(f func(protoreflect.FieldDescriptor, proto return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_Member_metadata, value) { return } @@ -143,7 +143,7 @@ func (x *fastReflection_Member) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.group.v1beta1.Member.weight": return x.Weight != "" case "cosmos.group.v1beta1.Member.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.Member.added_at": return x.AddedAt != nil default: @@ -167,7 +167,7 @@ func (x *fastReflection_Member) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.Member.weight": x.Weight = "" case "cosmos.group.v1beta1.Member.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.Member.added_at": x.AddedAt = nil default: @@ -194,7 +194,7 @@ func (x *fastReflection_Member) Get(descriptor protoreflect.FieldDescriptor) pro return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.Member.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.Member.added_at": value := x.AddedAt return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -223,7 +223,7 @@ func (x *fastReflection_Member) Set(fd protoreflect.FieldDescriptor, value proto case "cosmos.group.v1beta1.Member.weight": x.Weight = value.Interface().(string) case "cosmos.group.v1beta1.Member.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.Member.added_at": x.AddedAt = value.Message().Interface().(*timestamppb.Timestamp) default: @@ -275,7 +275,7 @@ func (x *fastReflection_Member) NewField(fd protoreflect.FieldDescriptor) protor case "cosmos.group.v1beta1.Member.weight": return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.Member.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.Member.added_at": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -545,7 +545,7 @@ func (x *fastReflection_Member) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -555,25 +555,23 @@ func (x *fastReflection_Member) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -2236,8 +2234,8 @@ func (x *fastReflection_GroupInfo) Range(f func(protoreflect.FieldDescriptor, pr return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_GroupInfo_metadata, value) { return } @@ -2280,7 +2278,7 @@ func (x *fastReflection_GroupInfo) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.group.v1beta1.GroupInfo.admin": return x.Admin != "" case "cosmos.group.v1beta1.GroupInfo.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.GroupInfo.version": return x.Version != uint64(0) case "cosmos.group.v1beta1.GroupInfo.total_weight": @@ -2308,7 +2306,7 @@ func (x *fastReflection_GroupInfo) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.GroupInfo.admin": x.Admin = "" case "cosmos.group.v1beta1.GroupInfo.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.GroupInfo.version": x.Version = uint64(0) case "cosmos.group.v1beta1.GroupInfo.total_weight": @@ -2339,7 +2337,7 @@ func (x *fastReflection_GroupInfo) Get(descriptor protoreflect.FieldDescriptor) return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.GroupInfo.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.GroupInfo.version": value := x.Version return protoreflect.ValueOfUint64(value) @@ -2374,7 +2372,7 @@ func (x *fastReflection_GroupInfo) Set(fd protoreflect.FieldDescriptor, value pr case "cosmos.group.v1beta1.GroupInfo.admin": x.Admin = value.Interface().(string) case "cosmos.group.v1beta1.GroupInfo.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.GroupInfo.version": x.Version = value.Uint() case "cosmos.group.v1beta1.GroupInfo.total_weight": @@ -2434,7 +2432,7 @@ func (x *fastReflection_GroupInfo) NewField(fd protoreflect.FieldDescriptor) pro case "cosmos.group.v1beta1.GroupInfo.admin": return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.GroupInfo.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.GroupInfo.version": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.group.v1beta1.GroupInfo.total_weight": @@ -2711,7 +2709,7 @@ func (x *fastReflection_GroupInfo) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2721,25 +2719,23 @@ func (x *fastReflection_GroupInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -3452,8 +3448,8 @@ func (x *fastReflection_GroupPolicyInfo) Range(f func(protoreflect.FieldDescript return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_GroupPolicyInfo_metadata, value) { return } @@ -3498,7 +3494,7 @@ func (x *fastReflection_GroupPolicyInfo) Has(fd protoreflect.FieldDescriptor) bo case "cosmos.group.v1beta1.GroupPolicyInfo.admin": return x.Admin != "" case "cosmos.group.v1beta1.GroupPolicyInfo.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.GroupPolicyInfo.version": return x.Version != uint64(0) case "cosmos.group.v1beta1.GroupPolicyInfo.decision_policy": @@ -3528,7 +3524,7 @@ func (x *fastReflection_GroupPolicyInfo) Clear(fd protoreflect.FieldDescriptor) case "cosmos.group.v1beta1.GroupPolicyInfo.admin": x.Admin = "" case "cosmos.group.v1beta1.GroupPolicyInfo.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.GroupPolicyInfo.version": x.Version = uint64(0) case "cosmos.group.v1beta1.GroupPolicyInfo.decision_policy": @@ -3562,7 +3558,7 @@ func (x *fastReflection_GroupPolicyInfo) Get(descriptor protoreflect.FieldDescri return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.GroupPolicyInfo.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.GroupPolicyInfo.version": value := x.Version return protoreflect.ValueOfUint64(value) @@ -3599,7 +3595,7 @@ func (x *fastReflection_GroupPolicyInfo) Set(fd protoreflect.FieldDescriptor, va case "cosmos.group.v1beta1.GroupPolicyInfo.admin": x.Admin = value.Interface().(string) case "cosmos.group.v1beta1.GroupPolicyInfo.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.GroupPolicyInfo.version": x.Version = value.Uint() case "cosmos.group.v1beta1.GroupPolicyInfo.decision_policy": @@ -3666,7 +3662,7 @@ func (x *fastReflection_GroupPolicyInfo) NewField(fd protoreflect.FieldDescripto case "cosmos.group.v1beta1.GroupPolicyInfo.admin": return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.GroupPolicyInfo.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.GroupPolicyInfo.version": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.group.v1beta1.GroupPolicyInfo.decision_policy": @@ -3994,7 +3990,7 @@ func (x *fastReflection_GroupPolicyInfo) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4004,25 +4000,23 @@ func (x *fastReflection_GroupPolicyInfo) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -4359,8 +4353,8 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_Proposal_metadata, value) { return } @@ -4445,7 +4439,7 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.group.v1beta1.Proposal.address": return x.Address != "" case "cosmos.group.v1beta1.Proposal.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.Proposal.proposers": return len(x.Proposers) != 0 case "cosmos.group.v1beta1.Proposal.submit_time": @@ -4487,7 +4481,7 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.Proposal.address": x.Address = "" case "cosmos.group.v1beta1.Proposal.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.Proposal.proposers": x.Proposers = nil case "cosmos.group.v1beta1.Proposal.submit_time": @@ -4532,7 +4526,7 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.Proposal.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.Proposal.proposers": if len(x.Proposers) == 0 { return protoreflect.ValueOfList(&_Proposal_4_list{}) @@ -4594,7 +4588,7 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro case "cosmos.group.v1beta1.Proposal.address": x.Address = value.Interface().(string) case "cosmos.group.v1beta1.Proposal.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.Proposal.proposers": lv := value.List() clv := lv.(*_Proposal_4_list) @@ -4700,7 +4694,7 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot case "cosmos.group.v1beta1.Proposal.address": return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.Proposal.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.Proposal.proposers": list := []string{} return protoreflect.ValueOfList(&_Proposal_4_list{list: &list}) @@ -5089,7 +5083,7 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5099,25 +5093,23 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -6137,8 +6129,8 @@ func (x *fastReflection_Vote) Range(f func(protoreflect.FieldDescriptor, protore return } } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfBytes(x.Metadata) + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) if !f(fd_Vote_metadata, value) { return } @@ -6171,7 +6163,7 @@ func (x *fastReflection_Vote) Has(fd protoreflect.FieldDescriptor) bool { case "cosmos.group.v1beta1.Vote.option": return x.Option != 0 case "cosmos.group.v1beta1.Vote.metadata": - return len(x.Metadata) != 0 + return x.Metadata != "" case "cosmos.group.v1beta1.Vote.submit_time": return x.SubmitTime != nil default: @@ -6197,7 +6189,7 @@ func (x *fastReflection_Vote) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.group.v1beta1.Vote.option": x.Option = 0 case "cosmos.group.v1beta1.Vote.metadata": - x.Metadata = nil + x.Metadata = "" case "cosmos.group.v1beta1.Vote.submit_time": x.SubmitTime = nil default: @@ -6227,7 +6219,7 @@ func (x *fastReflection_Vote) Get(descriptor protoreflect.FieldDescriptor) proto return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) case "cosmos.group.v1beta1.Vote.metadata": value := x.Metadata - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfString(value) case "cosmos.group.v1beta1.Vote.submit_time": value := x.SubmitTime return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -6258,7 +6250,7 @@ func (x *fastReflection_Vote) Set(fd protoreflect.FieldDescriptor, value protore case "cosmos.group.v1beta1.Vote.option": x.Option = (VoteOption)(value.Enum()) case "cosmos.group.v1beta1.Vote.metadata": - x.Metadata = value.Bytes() + x.Metadata = value.Interface().(string) case "cosmos.group.v1beta1.Vote.submit_time": x.SubmitTime = value.Message().Interface().(*timestamppb.Timestamp) default: @@ -6314,7 +6306,7 @@ func (x *fastReflection_Vote) NewField(fd protoreflect.FieldDescriptor) protoref case "cosmos.group.v1beta1.Vote.option": return protoreflect.ValueOfEnum(0) case "cosmos.group.v1beta1.Vote.metadata": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfString("") case "cosmos.group.v1beta1.Vote.submit_time": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -6595,7 +6587,7 @@ func (x *fastReflection_Vote) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6605,25 +6597,23 @@ func (x *fastReflection_Vote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Metadata = append(x.Metadata[:0], dAtA[iNdEx:postIndex]...) - if x.Metadata == nil { - x.Metadata = []byte{} - } + x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -6958,7 +6948,7 @@ type Member struct { // weight is the member's voting weight that should be greater than 0. Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` // metadata is any arbitrary metadata to attached to the member. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // added_at is a timestamp specifying when a member was added. AddedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=added_at,json=addedAt,proto3" json:"added_at,omitempty"` } @@ -6997,11 +6987,11 @@ func (x *Member) GetWeight() string { return "" } -func (x *Member) GetMetadata() []byte { +func (x *Member) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *Member) GetAddedAt() *timestamppb.Timestamp { @@ -7153,7 +7143,7 @@ type GroupInfo struct { // admin is the account address of the group's admin. Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` // metadata is any arbitrary metadata to attached to the group. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // version is used to track changes to a group's membership structure that // would break existing proposals. Whenever any members weight is changed, // or any member is added or removed this version is incremented and will @@ -7199,11 +7189,11 @@ func (x *GroupInfo) GetAdmin() string { return "" } -func (x *GroupInfo) GetMetadata() []byte { +func (x *GroupInfo) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *GroupInfo) GetVersion() uint64 { @@ -7286,7 +7276,7 @@ type GroupPolicyInfo struct { // admin is the account address of the group admin. Admin string `protobuf:"bytes,3,opt,name=admin,proto3" json:"admin,omitempty"` // metadata is any arbitrary metadata to attached to the group policy. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // version is used to track changes to a group's GroupPolicyInfo structure that // would create a different result on a running proposal. Version uint64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` @@ -7337,11 +7327,11 @@ func (x *GroupPolicyInfo) GetAdmin() string { return "" } -func (x *GroupPolicyInfo) GetMetadata() []byte { +func (x *GroupPolicyInfo) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *GroupPolicyInfo) GetVersion() uint64 { @@ -7379,7 +7369,7 @@ type Proposal struct { // address is the account address of group policy. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // metadata is any arbitrary metadata to attached to the proposal. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // proposers are the account addresses of the proposers. Proposers []string `protobuf:"bytes,4,rep,name=proposers,proto3" json:"proposers,omitempty"` // submit_time is a timestamp specifying when a proposal was submitted. @@ -7445,11 +7435,11 @@ func (x *Proposal) GetAddress() string { return "" } -func (x *Proposal) GetMetadata() []byte { +func (x *Proposal) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *Proposal) GetProposers() []string { @@ -7599,7 +7589,7 @@ type Vote struct { // option is the voter's choice on the proposal. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.group.v1beta1.VoteOption" json:"option,omitempty"` // metadata is any arbitrary metadata to attached to the vote. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // submit_time is the timestamp when the vote was submitted. SubmitTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` } @@ -7645,11 +7635,11 @@ func (x *Vote) GetOption() VoteOption { return VoteOption_VOTE_OPTION_UNSPECIFIED } -func (x *Vote) GetMetadata() []byte { +func (x *Vote) GetMetadata() string { if x != nil { return x.Metadata } - return nil + return "" } func (x *Vote) GetSubmitTime() *timestamppb.Timestamp { @@ -7680,7 +7670,7 @@ var file_cosmos_group_v1beta1_types_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x08, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, @@ -7713,7 +7703,7 @@ var file_cosmos_group_v1beta1_types_proto_rawDesc = []byte{ 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x02, 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, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1a, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x77, 0x65, 0x69, @@ -7738,7 +7728,7 @@ var file_cosmos_group_v1beta1_types_proto_rawDesc = []byte{ 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x03, 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, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1a, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, @@ -7757,7 +7747,7 @@ var file_cosmos_group_v1beta1_types_proto_rawDesc = []byte{ 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 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, @@ -7818,7 +7808,7 @@ var file_cosmos_group_v1beta1_types_proto_rawDesc = []byte{ 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x0b, 0x73, + 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, diff --git a/api/cosmos/tx/v1beta1/service.pulsar.go b/api/cosmos/tx/v1beta1/service.pulsar.go index 8540bf41c75f..ec4afdbe92bd 100644 --- a/api/cosmos/tx/v1beta1/service.pulsar.go +++ b/api/cosmos/tx/v1beta1/service.pulsar.go @@ -5909,6 +5909,8 @@ func (x *GetTxResponse) GetTxResponse() *v1beta11.TxResponse { // GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs // RPC method. +// +// Since: cosmos-sdk 0.45.2 type GetBlockWithTxsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5955,6 +5957,8 @@ func (x *GetBlockWithTxsRequest) GetPagination() *v1beta1.PageRequest { } // GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// +// Since: cosmos-sdk 0.45.2 type GetBlockWithTxsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/cosmos/gov/v1beta2/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto index c641d27c08ae..64ffaad64f1d 100644 --- a/proto/cosmos/gov/v1beta2/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -55,7 +55,7 @@ message Proposal { google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; // metadata is any arbitrary metadata attached to the proposal. - bytes metadata = 10; + string metadata = 10; } // ProposalStatus enumerates the valid statuses of a proposal. diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index e805a60a429c..390ee8941706 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -39,7 +39,7 @@ message MsgSubmitProposal { repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata attached to the proposal. - bytes metadata = 4; + string metadata = 4; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. diff --git a/proto/cosmos/group/v1beta1/tx.proto b/proto/cosmos/group/v1beta1/tx.proto index 813c6c424417..523ab981e1b8 100644 --- a/proto/cosmos/group/v1beta1/tx.proto +++ b/proto/cosmos/group/v1beta1/tx.proto @@ -69,7 +69,7 @@ message MsgCreateGroup { repeated Member members = 2 [(gogoproto.nullable) = false]; // metadata is any arbitrary metadata to attached to the group. - bytes metadata = 3; + string metadata = 3; } // MsgCreateGroupResponse is the Msg/CreateGroup response type. @@ -125,7 +125,7 @@ message MsgUpdateGroupMetadata { uint64 group_id = 2; // metadata is the updated group's metadata. - bytes metadata = 3; + string metadata = 3; } // MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. @@ -148,7 +148,7 @@ message MsgCreateGroupPolicy { uint64 group_id = 2; // metadata is any arbitrary metadata attached to the group policy. - bytes metadata = 3; + string metadata = 3; // decision_policy specifies the group policy's decision policy. google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "DecisionPolicy"]; @@ -186,10 +186,10 @@ message MsgCreateGroupWithPolicy { repeated Member members = 2 [(gogoproto.nullable) = false]; // group_metadata is any arbitrary metadata attached to the group. - bytes group_metadata = 3; + string group_metadata = 3; // group_policy_metadata is any arbitrary metadata attached to the group policy. - bytes group_policy_metadata = 4; + string group_policy_metadata = 4; // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. bool group_policy_as_admin = 5; @@ -241,7 +241,7 @@ message MsgUpdateGroupPolicyMetadata { string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is the updated group policy metadata. - bytes metadata = 3; + string metadata = 3; } // MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. @@ -279,7 +279,7 @@ message MsgSubmitProposal { repeated string proposers = 2; // metadata is any arbitrary metadata to attached to the proposal. - bytes metadata = 3; + string metadata = 3; // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. repeated google.protobuf.Any messages = 4; @@ -322,7 +322,7 @@ message MsgVote { VoteOption option = 3; // metadata is any arbitrary metadata to attached to the vote. - bytes metadata = 4; + string metadata = 4; // exec defines whether the proposal should be executed // immediately after voting or not. diff --git a/proto/cosmos/group/v1beta1/types.proto b/proto/cosmos/group/v1beta1/types.proto index f5af00734f05..aab2b93ecfc3 100644 --- a/proto/cosmos/group/v1beta1/types.proto +++ b/proto/cosmos/group/v1beta1/types.proto @@ -21,7 +21,7 @@ message Member { string weight = 2; // metadata is any arbitrary metadata to attached to the member. - bytes metadata = 3; + string metadata = 3; // added_at is a timestamp specifying when a member was added. google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; @@ -88,7 +88,7 @@ message GroupInfo { string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata to attached to the group. - bytes metadata = 3; + string metadata = 3; // version is used to track changes to a group's membership structure that // would break existing proposals. Whenever any members weight is changed, @@ -128,7 +128,7 @@ message GroupPolicyInfo { string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata to attached to the group policy. - bytes metadata = 4; + string metadata = 4; // version is used to track changes to a group's GroupPolicyInfo structure that // would create a different result on a running proposal. @@ -155,7 +155,7 @@ message Proposal { string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata to attached to the proposal. - bytes metadata = 3; + string metadata = 3; // proposers are the account addresses of the proposers. repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -282,7 +282,7 @@ message Vote { VoteOption option = 3; // metadata is any arbitrary metadata to attached to the vote. - bytes metadata = 4; + string metadata = 4; // submit_time is the timestamp when the vote was submitted. google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index 2bd6a97276cf..41e585221b71 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -33,7 +33,7 @@ func (s *MWTestSuite) setupAcctsForTips(ctx sdk.Context) (sdk.Context, []testAcc s.Require().NoError(err) // Create dummy proposal for tipper to vote on. - prop, err := govtypes.NewProposal([]sdk.Msg{banktypes.NewMsgSend(accts[0].acc.GetAddress(), accts[0].acc.GetAddress(), initialRegens)}, 1, nil, time.Now(), time.Now().Add(time.Hour)) + prop, err := govtypes.NewProposal([]sdk.Msg{banktypes.NewMsgSend(accts[0].acc.GetAddress(), accts[0].acc.GetAddress(), initialRegens)}, 1, "", time.Now(), time.Now().Add(time.Hour)) s.Require().NoError(err) s.app.GovKeeper.SetProposal(ctx, prop) s.app.GovKeeper.ActivateVotingPeriod(ctx, prop) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index c98fac95015e..b14a8fd711c5 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -37,7 +37,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), - nil, + "", ) require.NoError(t, err) @@ -90,7 +90,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), - nil, + "", ) require.NoError(t, err) @@ -114,7 +114,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), - nil, + "", ) require.NoError(t, err) @@ -172,7 +172,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), - nil, + "", ) require.NoError(t, err) @@ -225,7 +225,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), nil) + newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "") require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -293,7 +293,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -343,7 +343,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/cli/parse.go b/x/gov/client/cli/parse.go index 91736f985332..e5a6cc3cb9a7 100644 --- a/x/gov/client/cli/parse.go +++ b/x/gov/client/cli/parse.go @@ -84,21 +84,21 @@ func parseSubmitLegacyProposalFlags(fs *pflag.FlagSet) (*legacyProposal, error) type proposal struct { // Msgs defines an array of sdk.Msgs proto-JSON-encoded as Anys. Messages []json.RawMessage - Metadata []byte + Metadata string Deposit string } -func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, []byte, sdk.Coins, error) { +func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, string, sdk.Coins, error) { var proposal proposal contents, err := os.ReadFile(path) if err != nil { - return nil, nil, nil, err + return nil, "", nil, err } err = json.Unmarshal(contents, &proposal) if err != nil { - return nil, nil, nil, err + return nil, "", nil, err } msgs := make([]sdk.Msg, len(proposal.Messages)) @@ -106,7 +106,7 @@ func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, []byte, sdk.C var msg sdk.Msg err := cdc.UnmarshalInterfaceJSON(anyJSON, &msg) if err != nil { - return nil, nil, nil, err + return nil, "", nil, err } msgs[i] = msg @@ -114,7 +114,7 @@ func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, []byte, sdk.C deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) if err != nil { - return nil, nil, nil, err + return nil, "", nil, err } return msgs, proposal.Metadata, deposit, nil diff --git a/x/gov/client/cli/parse_test.go b/x/gov/client/cli/parse_test.go index 12946b68c56a..7b27c8a7a5d0 100644 --- a/x/gov/client/cli/parse_test.go +++ b/x/gov/client/cli/parse_test.go @@ -132,7 +132,7 @@ func TestParseSubmitProposal(t *testing.T) { msgs, metadata, deposit, err := parseSubmitProposal(cdc, okJSON.Name()) require.NoError(t, err, "unexpected error") require.Equal(t, sdk.NewCoins(sdk.NewCoin("test", sdk.NewInt(1000))), deposit) - require.Equal(t, expectedMetadata, metadata) + require.Equal(t, base64.StdEncoding.EncodeToString(expectedMetadata), metadata) require.Len(t, msgs, 3) msg1, ok := msgs[0].(*banktypes.MsgSend) require.True(t, ok) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 34fda18315e8..b34cbd3bf687 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -35,11 +35,11 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID1 := proposal1.Id - proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID2 := proposal2.Id diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 85f3ce9efd23..9183f16deb55 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -17,7 +17,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id @@ -101,7 +101,7 @@ func TestDeposits(t *testing.T) { require.Equal(t, addr1Initial, app.BankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Test delete and burn deposits - proposal, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID = proposal.Id _, err = app.GovKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 9beacaa4d98c..fd3097decba7 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -53,7 +53,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, nil) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "") suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -127,7 +127,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, nil) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "") suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -192,7 +192,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1beta2.NewMsgVote(govAddress, uint64(i), v1beta2.OptionYes), } - proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal, "") suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -367,7 +367,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) req = &v1beta2.QueryVoteRequest{ @@ -472,7 +472,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) req = &v1beta2.QueryVotesRequest{ @@ -573,7 +573,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) req = &v1beta1.QueryVotesRequest{ @@ -855,7 +855,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -944,7 +944,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) req = &v1beta2.QueryDepositsRequest{ @@ -1036,7 +1036,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 559abc376ac9..b8bda4b31875 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -64,7 +64,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) tp := TestProposal - _, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) @@ -75,7 +75,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalFailedMinDepositValid) - p2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + p2, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) activated, err := app.GovKeeper.AddDeposit(ctx, p2.Id, addrs[0], minDeposit) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 3ac495c554e8..a86d70335b31 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -58,17 +58,17 @@ func TestIncrementProposalNumber(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) tp := TestProposal - _, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) - proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) require.Equal(t, uint64(6), proposal6.Id) @@ -80,7 +80,7 @@ func TestProposalQueues(t *testing.T) { // create test proposals tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) inactiveIterator := app.GovKeeper.InactiveProposalQueueIterator(ctx, *proposal.DepositEndTime) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index b56c36d12652..b074a8255e57 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -230,7 +230,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS []sdk.Msg{contentMsg}, msg.InitialDeposit, msg.Proposer, - nil, + "", ) if err != nil { return nil, err diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index a07ac19a3c57..7eaaf89a46c6 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -11,8 +11,8 @@ import ( ) // SubmitProposal create new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata []byte) (v1beta2.Proposal, error) { - if metadata != nil && uint64(len(metadata)) > keeper.config.MaxMetadataLen { +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata string) (v1beta2.Proposal, error) { + if metadata != "" && uint64(len(metadata)) > keeper.config.MaxMetadataLen { return v1beta2.Proposal{}, types.ErrMetadataTooLong.Wrapf("got metadata with length %d", len(metadata)) } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 1065faaa7089..a1e58b619a5d 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "bytes" "errors" "fmt" "strings" @@ -19,7 +18,7 @@ import ( func (suite *KeeperTestSuite) TestGetSetProposal() { tp := TestProposal - proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, nil) + proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, "") suite.Require().NoError(err) proposalID := proposal.Id suite.app.GovKeeper.SetProposal(suite.ctx, proposal) @@ -31,7 +30,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { func (suite *KeeperTestSuite) TestActivateVotingPeriod() { tp := TestProposal - proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, nil) + proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, "") suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -62,21 +61,21 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { testCases := []struct { content v1beta1.Content authority string - metadata []byte + metadata string expectedErr error }{ - {&tp, govAcct, nil, nil}, + {&tp, govAcct, "", nil}, // Keeper does not check the validity of title and description, no error - {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, nil, nil}, - {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, nil, nil}, - {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, nil, nil}, - {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, nil, nil}, + {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, "", nil}, + {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, "", nil}, + {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, "", nil}, + {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, "", nil}, // error when metadata is too long (>10000) - {&tp, govAcct, bytes.Repeat([]byte{42}, 10001), types.ErrMetadataTooLong}, + {&tp, govAcct, strings.Repeat("a", 100001), types.ErrMetadataTooLong}, // error when signer is not gov acct - {&tp, randomAddr.String(), nil, types.ErrInvalidSigner}, + {&tp, randomAddr.String(), "", types.ErrInvalidSigner}, // error only when invalid route - {&invalidProposalRoute{}, govAcct, nil, types.ErrNoProposalHandlerExists}, + {&invalidProposalRoute{}, govAcct, "", types.ErrNoProposalHandlerExists}, } for i, tc := range testCases { @@ -95,7 +94,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { for _, s := range status { for i := 0; i < 50; i++ { - p, err := v1beta2.NewProposal(TestProposal, proposalID, nil, time.Now(), time.Now()) + p, err := v1beta2.NewProposal(TestProposal, proposalID, "", time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 79a4ce89174a..c6ef9df0dc4d 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -161,7 +161,7 @@ func TestQueries(t *testing.T) { depositParams, _, _ := getQueriedParams(t, ctx, legacyQuerierCdc, querier) // TestAddrs[0] proposes (and deposits) proposals #1 and #2 - proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) deposit1 := v1beta2.NewDeposit(proposal1.Id, TestAddrs[0], oneCoins) depositer1, err := sdk.AccAddressFromBech32(deposit1.Depositor) @@ -171,7 +171,7 @@ func TestQueries(t *testing.T) { proposal1.TotalDeposit = sdk.NewCoins(proposal1.TotalDeposit...).Add(deposit1.Amount...) - proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) deposit2 := v1beta2.NewDeposit(proposal2.Id, TestAddrs[0], consCoins) depositer2, err := sdk.AccAddressFromBech32(deposit2.Depositor) @@ -182,7 +182,7 @@ func TestQueries(t *testing.T) { proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit2.Amount...) // TestAddrs[1] proposes (and deposits) on proposal #3 - proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) deposit3 := v1beta2.NewDeposit(proposal3.Id, TestAddrs[1], oneCoins) depositer3, err := sdk.AccAddressFromBech32(deposit3.Depositor) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index c550086a23dd..98afa808d662 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -20,7 +20,7 @@ func TestTallyNoOneVotes(t *testing.T) { createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -44,7 +44,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -67,7 +67,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -93,7 +93,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -117,7 +117,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -142,7 +142,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -168,7 +168,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -194,7 +194,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -221,7 +221,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -255,7 +255,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -291,7 +291,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -330,7 +330,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -372,7 +372,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -415,7 +415,7 @@ func TestTallyJailedValidator(t *testing.T) { app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod @@ -448,7 +448,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1beta2.StatusVotingPeriod diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 86ca5b9ac87e..bc329442c558 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -18,7 +18,7 @@ func TestVotes(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") require.NoError(t, err) proposalID := proposal.Id diff --git a/x/gov/migrations/v046/json_test.go b/x/gov/migrations/v046/json_test.go index 2ae043eafb93..a9757a44106b 100644 --- a/x/gov/migrations/v046/json_test.go +++ b/x/gov/migrations/v046/json_test.go @@ -104,7 +104,7 @@ func TestMigrateJSON(t *testing.T) { } } ], - "metadata": null, + "metadata": "", "status": "PROPOSAL_STATUS_DEPOSIT_PERIOD", "submit_time": "2001-09-09T01:46:40Z", "total_deposit": [ diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 6e8b8d81b995..308aa8de476a 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -152,7 +152,7 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "error converting legacy content into proposal message"), nil, err } - msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address.String(), nil) + msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address.String(), "") if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err } diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 19cba5221cdf..d424148da6ec 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -2,7 +2,6 @@ package simulation_test import ( "fmt" - "github.com/cosmos/cosmos-sdk/codec/legacy" "math/rand" "testing" "time" @@ -11,6 +10,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -150,7 +150,7 @@ func TestSimulateMsgDeposit(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -196,7 +196,7 @@ func TestSimulateMsgVote(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -239,7 +239,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/types/v1beta2/gov.pb.go b/x/gov/types/v1beta2/gov.pb.go index 91034aa6a680..0f094171fa2e 100644 --- a/x/gov/types/v1beta2/gov.pb.go +++ b/x/gov/types/v1beta2/gov.pb.go @@ -250,7 +250,7 @@ type Proposal struct { VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - Metadata []byte `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -349,11 +349,11 @@ func (m *Proposal) GetVotingEndTime() *time.Time { return nil } -func (m *Proposal) GetMetadata() []byte { +func (m *Proposal) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } // TallyResult defines a standard tally for a governance proposal. @@ -671,7 +671,7 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1103 bytes of a gzipped FileDescriptorProto + // 1101 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x53, 0xdb, 0x46, 0x14, 0x46, 0xb6, 0x30, 0xe6, 0x19, 0x8c, 0xba, 0xd0, 0x46, 0x10, 0x62, 0x53, 0x4f, 0x9b, 0xa1, 0xb4, 0xd8, 0x81, 0xcc, 0xa4, 0x33, 0xe9, 0xa5, 0x36, 0x56, 0x1a, 0x33, 0x14, 0xbb, 0x92, 0x62, @@ -706,41 +706,41 @@ var fileDescriptor_5abf7b8852811c49 = []byte{ 0x77, 0x2d, 0x11, 0x57, 0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x59, 0x4e, 0x7a, 0x7f, 0x96, + 0x93, 0x5e, 0x9d, 0xe7, 0x66, 0xde, 0x9e, 0xe7, 0x66, 0xfe, 0x39, 0xcf, 0xcd, 0xfc, 0xfc, 0xa0, + 0xed, 0xb2, 0x4e, 0xbf, 0x55, 0x3c, 0x26, 0x9e, 0xf8, 0x30, 0x11, 0x3f, 0xdb, 0xd4, 0xf9, 0xa5, + 0x74, 0xca, 0x3f, 0xbb, 0xd8, 0xa0, 0x87, 0x69, 0xfc, 0xf1, 0xd5, 0x4a, 0x71, 0xcf, 0x3e, 0xfc, + 0x10, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xbe, 0x2b, 0x6a, 0x99, 0x09, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1932,7 +1932,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -1942,25 +1942,23 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index 2929d339e4f2..b378418d57ea 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -2,6 +2,7 @@ package v1beta2 import ( "fmt" + "github.com/cosmos/cosmos-sdk/codec/legacy" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,7 +19,7 @@ var ( // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer -func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer string, metadata []byte) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer string, metadata string) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, Proposer: proposer, diff --git a/x/gov/types/v1beta2/msgs_test.go b/x/gov/types/v1beta2/msgs_test.go index 5a64426f6356..7d496e222423 100644 --- a/x/gov/types/v1beta2/msgs_test.go +++ b/x/gov/types/v1beta2/msgs_test.go @@ -128,7 +128,7 @@ func TestMsgVoteWeighted(t *testing.T) { } func TestMsgSubmitProposal_ValidateBasic(t *testing.T) { - metadata := []byte{42} + metadata := "metadata" // Valid msg msg1, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Title", "description"), addrs[0].String()) require.NoError(t, err) @@ -141,14 +141,14 @@ func TestMsgSubmitProposal_ValidateBasic(t *testing.T) { proposer string initialDeposit sdk.Coins messages []sdk.Msg - metadata []byte + metadata string expErr bool }{ {"invalid addr", "", coinsPos, []sdk.Msg{msg1}, metadata, true}, - {"empty msgs and metadata", addrs[0].String(), coinsPos, nil, nil, true}, + {"empty msgs and metadata", addrs[0].String(), coinsPos, nil, "", true}, {"invalid msg", addrs[0].String(), coinsPos, []sdk.Msg{msg1, msg2}, metadata, true}, {"valid with no Msg", addrs[0].String(), coinsPos, nil, metadata, false}, - {"valid with no metadata", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, nil, false}, + {"valid with no metadata", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, "", false}, {"valid with everything", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, metadata, false}, } @@ -166,7 +166,7 @@ func TestMsgSubmitProposal_ValidateBasic(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { proposal := []sdk.Msg{v1beta2.NewMsgVote(addrs[0], 1, v1beta2.OptionYes)} - msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), nil) + msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), "") require.NoError(t, err) var bz []byte require.NotPanics(t, func() { diff --git a/x/gov/types/v1beta2/proposal.go b/x/gov/types/v1beta2/proposal.go index 425a51773404..e4ebcd35c546 100644 --- a/x/gov/types/v1beta2/proposal.go +++ b/x/gov/types/v1beta2/proposal.go @@ -23,7 +23,7 @@ const ( ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, metadata []byte, submitTime, depositEndTime time.Time) (Proposal, error) { +func NewProposal(messages []sdk.Msg, id uint64, metadata string, submitTime, depositEndTime time.Time) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { diff --git a/x/gov/types/v1beta2/proposals_test.go b/x/gov/types/v1beta2/proposals_test.go index 7525ba5361f6..df41caeb332d 100644 --- a/x/gov/types/v1beta2/proposals_test.go +++ b/x/gov/types/v1beta2/proposals_test.go @@ -37,7 +37,7 @@ func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) - proposal, err := v1beta2.NewProposal([]sdk.Msg{msgContent}, 1, nil, time.Now(), time.Now()) + proposal, err := v1beta2.NewProposal([]sdk.Msg{msgContent}, 1, "", time.Now(), time.Now()) require.NoError(t, err) require.Equal(t, "TODO Fix panic here", proposal.String()) diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go index 969617f7ce54..21883c4ce980 100644 --- a/x/gov/types/v1beta2/tx.pb.go +++ b/x/gov/types/v1beta2/tx.pb.go @@ -39,7 +39,7 @@ type MsgSubmitProposal struct { InitialDeposit []types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit"` Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -96,11 +96,11 @@ func (m *MsgSubmitProposal) GetProposer() string { return "" } -func (m *MsgSubmitProposal) GetMetadata() []byte { +func (m *MsgSubmitProposal) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. @@ -551,54 +551,53 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, - 0x10, 0x8d, 0x9b, 0xfc, 0x9a, 0x76, 0xda, 0x5f, 0xaa, 0xae, 0x22, 0xd5, 0x71, 0x2b, 0x37, 0x32, - 0xa2, 0x8a, 0x40, 0xb1, 0x93, 0x80, 0x8a, 0x54, 0x38, 0xd0, 0x14, 0xa4, 0x82, 0x88, 0x00, 0x57, - 0x02, 0x89, 0x4b, 0x71, 0xe2, 0xed, 0xd6, 0xa2, 0xf1, 0x5a, 0xde, 0x4d, 0xd4, 0x1c, 0xe1, 0x13, - 0xf0, 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, 0x63, 0x80, 0xa9, 0x54, 0xae, 0xca, 0x4c, 0x0e, 0xdc, 0x84, - 0x4c, 0x38, 0x58, 0x8b, 0x23, 0x94, 0x01, 0xa8, 0x5c, 0x1b, 0x03, 0x26, 0x99, 0x5e, 0xc3, 0xec, - 0xb9, 0xee, 0x1e, 0x27, 0x8a, 0x49, 0xca, 0xcd, 0x2b, 0x90, 0x92, 0x13, 0x9e, 0x43, 0x36, 0x6e, - 0x30, 0x75, 0x84, 0x4e, 0xe0, 0xca, 0xca, 0x78, 0x3c, 0x4e, 0x59, 0x7f, 0x7c, 0x78, 0xa2, 0x4a, - 0x47, 0x27, 0xaa, 0xf4, 0xe3, 0x44, 0x95, 0xde, 0x9f, 0xaa, 0xa9, 0xa3, 0x53, 0x35, 0xf5, 0xed, - 0x54, 0x4d, 0xbd, 0xaa, 0x10, 0x87, 0xef, 0x76, 0x9a, 0x7a, 0x8b, 0xb6, 0xc5, 0xbb, 0x24, 0x7e, - 0xca, 0xcc, 0x7e, 0x63, 0xec, 0x87, 0xaf, 0x1c, 0xef, 0x79, 0x98, 0xc5, 0x6f, 0x5d, 0x73, 0x32, - 0xfc, 0x32, 0xde, 0xfa, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x8d, 0x72, 0xa4, 0x59, 0x07, 0x00, - 0x00, + // 733 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xee, 0xd2, 0x4a, 0xe1, 0xa1, 0x25, 0x4c, 0x9a, 0xb0, 0x5d, 0xc8, 0x42, 0xd6, 0x48, 0x1a, + 0x4d, 0x77, 0xdb, 0x6a, 0x30, 0x41, 0x0f, 0x52, 0x34, 0x41, 0x63, 0xa3, 0x2e, 0x89, 0x26, 0x5e, + 0x70, 0xdb, 0x1d, 0x86, 0x8d, 0x74, 0x67, 0xb3, 0x33, 0x6d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 0x13, 0xda, 0x47, 0x09, 0xb2, 0x75, 0x46, 0x5e, + 0x52, 0x8e, 0x51, 0x79, 0x80, 0xa1, 0xda, 0xec, 0xef, 0xe3, 0xa5, 0xb3, 0xe1, 0xb3, 0x0e, 0x91, + 0x0e, 0x57, 0x3a, 0x94, 0x63, 0x3f, 0xaa, 0x63, 0xc4, 0xed, 0x47, 0x34, 0xb4, 0x0a, 0x93, 0xd4, + 0xe3, 0x0e, 0x75, 0xc3, 0xbf, 0x2b, 0x57, 0x55, 0xf5, 0xfe, 0x51, 0xd0, 0x83, 0x5a, 0x9e, 0x85, + 0x2c, 0x53, 0xb0, 0xd7, 0x20, 0x70, 0x15, 0xe5, 0xd0, 0xe6, 0x60, 0x56, 0x14, 0x9c, 0x98, 0xf8, + 0x22, 0x25, 0xb1, 0x57, 0xd8, 0x21, 0xbb, 0x1c, 0xdb, 0xff, 0xc1, 0xcc, 0x03, 0xc8, 0x46, 0xe5, + 0x31, 0x39, 0x1d, 0xf6, 0xef, 0xca, 0x20, 0x37, 0x71, 0x41, 0x67, 0x5c, 0xc5, 0xb2, 0x73, 0xb6, + 0x0a, 0x30, 0x7f, 0xc1, 0x42, 0x62, 0xef, 0xb3, 0x04, 0x50, 0x67, 0x24, 0xee, 0xfa, 0x7f, 0x77, + 0xb6, 0x0a, 0xd3, 0x62, 0xd2, 0xe8, 0xe5, 0xee, 0x7a, 0x54, 0x74, 0x17, 0x26, 0xad, 0x16, 0x6d, + 0xbb, 0x5c, 0x18, 0xbc, 0x74, 0x40, 0x05, 0x5d, 0x74, 0x61, 0x92, 0x48, 0xcb, 0x03, 0xea, 0x19, + 0x88, 0x7d, 0x55, 0x7f, 0xa4, 0x21, 0x5d, 0x67, 0x04, 0xed, 0x40, 0xee, 0xc2, 0x47, 0xe5, 0xc6, + 0xa0, 0x9b, 0xec, 0x9b, 0x44, 0xa5, 0x34, 0x16, 0x2d, 0x19, 0x58, 0x0a, 0x73, 0xfd, 0xb3, 0x58, + 0x1c, 0x92, 0xa3, 0x8f, 0xa9, 0x94, 0xc7, 0x65, 0x26, 0x07, 0x6e, 0x42, 0x26, 0x1c, 0xac, 0x85, + 0x21, 0xca, 0x00, 0x54, 0xae, 0x8f, 0x00, 0x93, 0x4c, 0x6f, 0xe0, 0xea, 0xb9, 0xee, 0x1e, 0x25, + 0x8a, 0x49, 0xca, 0xad, 0x31, 0x48, 0xc9, 0x09, 0x2f, 0x20, 0x1b, 0x37, 0x98, 0x3a, 0x44, 0x27, + 0x70, 0x65, 0x65, 0x34, 0x1e, 0xa7, 0xac, 0x3d, 0x39, 0x3c, 0x51, 0xa5, 0xa3, 0x13, 0x55, 0xfa, + 0x79, 0xa2, 0x4a, 0x1f, 0x4e, 0xd5, 0xd4, 0xd1, 0xa9, 0x9a, 0xfa, 0x7e, 0xaa, 0xa6, 0x5e, 0x97, + 0x89, 0xc3, 0x77, 0xdb, 0x0d, 0xbd, 0x49, 0x5b, 0xe2, 0x5d, 0x12, 0x3f, 0x25, 0x66, 0xbf, 0x35, + 0xf6, 0xc3, 0x57, 0x8e, 0x77, 0x3d, 0xcc, 0xe2, 0xb7, 0xae, 0x31, 0x19, 0x7e, 0x19, 0x6f, 0xff, + 0x0d, 0x00, 0x00, 0xff, 0xff, 0x50, 0xa3, 0xc5, 0x32, 0x59, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1509,7 +1508,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1519,25 +1518,23 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/group/client/cli/tx.go b/x/group/client/cli/tx.go index 1c29ebf51886..4b6a08e37839 100644 --- a/x/group/client/cli/tx.go +++ b/x/group/client/cli/tx.go @@ -1,7 +1,6 @@ package cli import ( - "encoding/base64" "fmt" "strconv" "strings" @@ -12,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/group" ) @@ -104,15 +102,10 @@ Where members.json contains: return err } - metadata, err := base64.StdEncoding.DecodeString(args[1]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required") - } - msg := &group.MsgCreateGroup{ Admin: clientCtx.GetFromAddress().String(), Members: members, - Metadata: metadata, + Metadata: args[1], } if err = msg.ValidateBasic(); err != nil { return fmt.Errorf("message validation failed: %w", err) @@ -262,14 +255,9 @@ func MsgUpdateGroupMetadataCmd() *cobra.Command { return err } - b, err := base64.StdEncoding.DecodeString(args[2]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required") - } - msg := &group.MsgUpdateGroupMetadata{ Admin: clientCtx.GetFromAddress().String(), - Metadata: b, + Metadata: args[2], GroupId: groupID, } if err = msg.ValidateBasic(); err != nil { @@ -345,16 +333,6 @@ where members.json contains: return err } - groupMetadata, err := base64.StdEncoding.DecodeString(args[1]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "group metadata is malformed, proper base64 string is required") - } - - groupPolicyMetadata, err := base64.StdEncoding.DecodeString(args[2]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "group policy metadata is malformed, proper base64 string is required") - } - var policy group.DecisionPolicy if err := clientCtx.Codec.UnmarshalInterfaceJSON([]byte(args[4]), &policy); err != nil { return err @@ -363,8 +341,8 @@ where members.json contains: msg, err := group.NewMsgCreateGroupWithPolicy( clientCtx.GetFromAddress().String(), members, - groupMetadata, - groupPolicyMetadata, + args[1], + args[2], groupPolicyAsAdmin, policy, ) @@ -429,15 +407,10 @@ Ex: '{"@type":"/cosmos.group.v1beta1.PercentageDecisionPolicy", "percentage":"0. return err } - b, err := base64.StdEncoding.DecodeString(args[2]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required") - } - msg, err := group.NewMsgCreateGroupPolicy( clientCtx.GetFromAddress(), groupID, - b, + args[2], policy, ) if err != nil { @@ -557,15 +530,10 @@ func MsgUpdateGroupPolicyMetadataCmd() *cobra.Command { return err } - b, err := base64.StdEncoding.DecodeString(args[2]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required") - } - msg := &group.MsgUpdateGroupPolicyMetadata{ Admin: clientCtx.GetFromAddress().String(), Address: args[1], - Metadata: b, + Metadata: args[2], } if err = msg.ValidateBasic(); err != nil { return fmt.Errorf("message validation failed: %w", err) @@ -748,18 +716,13 @@ Parameters: return err } - b, err := base64.StdEncoding.DecodeString(args[3]) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required") - } - execStr, _ := cmd.Flags().GetString(FlagExec) msg := &group.MsgVote{ ProposalId: proposalID, Voter: args[1], Option: voteOption, - Metadata: b, + Metadata: args[3], Exec: execFromString(execStr), } if err != nil { diff --git a/x/group/client/cli/util.go b/x/group/client/cli/util.go index bcc2001e8ebe..2c187bdd70e9 100644 --- a/x/group/client/cli/util.go +++ b/x/group/client/cli/util.go @@ -45,7 +45,7 @@ type CLIProposal struct { GroupPolicyAddress string // Messages defines an array of sdk.Msgs proto-JSON-encoded as Anys. Messages []json.RawMessage - Metadata []byte + Metadata string Proposers []string } diff --git a/x/group/client/testutil/query.go b/x/group/client/testutil/query.go index f96215ca26e4..da3d936e290f 100644 --- a/x/group/client/testutil/query.go +++ b/x/group/client/testutil/query.go @@ -180,7 +180,7 @@ func (s *IntegrationTestSuite) TestQueryGroupMembers() { Member: &group.Member{ Address: val.Address.String(), Weight: "3", - Metadata: []byte{1}, + Metadata: validMetadata, }, }, }, diff --git a/x/group/client/testutil/tx.go b/x/group/client/testutil/tx.go index bee52e27b041..e51b3210f48c 100644 --- a/x/group/client/testutil/tx.go +++ b/x/group/client/testutil/tx.go @@ -36,7 +36,7 @@ type IntegrationTestSuite struct { vote *group.Vote } -const validMetadata = "AQ==" +const validMetadata = "metadata" func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { return &IntegrationTestSuite{cfg: cfg} @@ -106,7 +106,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().Equal(uint32(0), txResp.Code, out.String()) - s.group = &group.GroupInfo{Id: 1, Admin: val.Address.String(), Metadata: []byte{1}, TotalWeight: "3", Version: 1} + s.group = &group.GroupInfo{Id: 1, Admin: val.Address.String(), Metadata: validMetadata, TotalWeight: "3", Version: 1} // create 5 group policies for i := 0; i < 5; i++ { @@ -289,7 +289,7 @@ func (s *IntegrationTestSuite) TestTxCreateGroup() { append( []string{ val.Address.String(), - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==", + strings.Repeat("a", 256), "", }, commonFlags..., @@ -541,7 +541,7 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupMetadata() { []string{ val.Address.String(), strconv.FormatUint(s.group.Id, 10), - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==", + strings.Repeat("a", 256), }, commonFlags..., ), @@ -798,7 +798,7 @@ func (s *IntegrationTestSuite) TestTxCreateGroupWithPolicy() { append( []string{ val.Address.String(), - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==", + strings.Repeat("a", 256), validMetadata, validMembersFile.Name(), "{\"@type\":\"/cosmos.group.v1beta1.ThresholdDecisionPolicy\", \"threshold\":\"1\", \"timeout\":\"1s\"}", @@ -817,7 +817,7 @@ func (s *IntegrationTestSuite) TestTxCreateGroupWithPolicy() { []string{ val.Address.String(), validMetadata, - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==", + strings.Repeat("a", 256), validMembersFile.Name(), "{\"@type\":\"/cosmos.group.v1beta1.ThresholdDecisionPolicy\", \"threshold\":\"1\", \"timeout\":\"1s\"}", fmt.Sprintf("--%s=%v", client.FlagGroupPolicyAsAdmin, false), @@ -2125,7 +2125,7 @@ func (s *IntegrationTestSuite) createCLIProposal(groupPolicyAddress, proposer, s p := client.CLIProposal{ GroupPolicyAddress: groupPolicyAddress, Messages: []json.RawMessage{msgJSON}, - Metadata: bz, + Metadata: metadata, Proposers: []string{proposer}, } diff --git a/x/group/genesis_test.go b/x/group/genesis_test.go index 5feaac8e9ff4..f1ab9962b10f 100644 --- a/x/group/genesis_test.go +++ b/x/group/genesis_test.go @@ -27,7 +27,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", } err := groupPolicy.SetDecisionPolicy(&ThresholdDecisionPolicy{ Threshold: "1", @@ -41,7 +41,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", } err = groupPolicy2.SetDecisionPolicy(&ThresholdDecisionPolicy{ Threshold: "1", @@ -52,7 +52,7 @@ func TestGenesisStateValidate(t *testing.T) { proposal := &Proposal{ Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -86,8 +86,8 @@ func TestGenesisStateValidate(t *testing.T) { "valid genesisState", GenesisState{ GroupSeq: 2, - Groups: []*GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}}, - GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}}, + Groups: []*GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: "2", Version: 2, TotalWeight: "2"}}, + GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberAddr.String(), Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &Member{Address: memberAddr.String(), Weight: "2", Metadata: "member metadata"}}}, GroupPolicySeq: 1, GroupPolicies: []*GroupPolicyInfo{groupPolicy}, ProposalSeq: 1, @@ -108,7 +108,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 0, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -123,7 +123,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: "invalid admin", - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -138,7 +138,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 0, TotalWeight: "1", }, @@ -153,7 +153,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "-1", }, @@ -168,7 +168,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -179,7 +179,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", }, }, }, @@ -192,7 +192,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -203,7 +203,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: "invalid admin", Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", }, }, }, @@ -216,7 +216,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -227,7 +227,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 0, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", }, }, }, @@ -240,7 +240,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -251,7 +251,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: accAddr.String(), Version: 0, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", }, }, }, @@ -264,7 +264,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -275,7 +275,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", DecisionPolicy: groupPolicy2.DecisionPolicy, }, }, @@ -289,7 +289,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -299,7 +299,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 0, Member: &Member{ Address: memberAddr.String(), - Weight: "1", Metadata: []byte("member metadata"), + Weight: "1", Metadata: "member metadata", }, }, }, @@ -313,7 +313,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -323,7 +323,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Member: &Member{ Address: "invalid address", - Weight: "1", Metadata: []byte("member metadata"), + Weight: "1", Metadata: "member metadata", }, }, }, @@ -337,7 +337,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -347,7 +347,7 @@ func TestGenesisStateValidate(t *testing.T) { GroupId: 1, Member: &Member{ Address: memberAddr.String(), - Weight: "-1", Metadata: []byte("member metadata"), + Weight: "-1", Metadata: "member metadata", }, }, }, @@ -361,7 +361,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -373,7 +373,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 0, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, }, @@ -388,7 +388,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -400,7 +400,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: "invalid address", - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, }, @@ -415,7 +415,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -427,7 +427,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 0, GroupPolicyVersion: 1, }, @@ -442,7 +442,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -454,7 +454,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 0, }, @@ -469,7 +469,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -481,7 +481,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -508,7 +508,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -520,7 +520,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -547,7 +547,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -559,7 +559,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -586,7 +586,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -598,7 +598,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -625,7 +625,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -654,7 +654,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -683,7 +683,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, @@ -712,7 +712,7 @@ func TestGenesisStateValidate(t *testing.T) { { Id: 1, Admin: accAddr.String(), - Metadata: []byte("1"), + Metadata: "1", Version: 1, TotalWeight: "1", }, diff --git a/x/group/keeper/genesis_test.go b/x/group/keeper/genesis_test.go index 56cd372bf191..3488d65e753c 100644 --- a/x/group/keeper/genesis_test.go +++ b/x/group/keeper/genesis_test.go @@ -69,7 +69,7 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { GroupId: 1, Admin: accAddr.String(), Version: 1, - Metadata: []byte("policy metadata"), + Metadata: "policy metadata", } err := groupPolicy.SetDecisionPolicy(&group.ThresholdDecisionPolicy{ Threshold: "1", @@ -80,7 +80,7 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { proposal := &group.Proposal{ Id: 1, Address: accAddr.String(), - Metadata: []byte("proposal metadata"), + Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ @@ -107,8 +107,8 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { genesisState := &group.GenesisState{ GroupSeq: 2, - Groups: []*group.GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}}, - GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &group.Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}}, + Groups: []*group.GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: "2", Version: 2, TotalWeight: "2"}}, + GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberAddr.String(), Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &group.Member{Address: memberAddr.String(), Weight: "2", Metadata: "member metadata"}}}, GroupPolicySeq: 1, GroupPolicies: []*group.GroupPolicyInfo{groupPolicy}, ProposalSeq: 1, diff --git a/x/group/keeper/grpc_query_test.go b/x/group/keeper/grpc_query_test.go index 2b2b46583b7f..c9d91e728c26 100644 --- a/x/group/keeper/grpc_query_test.go +++ b/x/group/keeper/grpc_query_test.go @@ -27,9 +27,8 @@ func TestQueryGroupsByMember(t *testing.T) { {Address: addrs[2].String(), Weight: "1"}, {Address: addrs[3].String(), Weight: "2"}, } _, err := app.GroupKeeper.CreateGroup(sdkCtx, &group.MsgCreateGroup{ - Admin: addrs[0].String(), - Members: members, - Metadata: nil, + Admin: addrs[0].String(), + Members: members, }) require.NoError(t, err) @@ -37,9 +36,8 @@ func TestQueryGroupsByMember(t *testing.T) { {Address: addrs[3].String(), Weight: "1"}, {Address: addrs[4].String(), Weight: "2"}, } _, err = app.GroupKeeper.CreateGroup(sdkCtx, &group.MsgCreateGroup{ - Admin: addrs[1].String(), - Members: members, - Metadata: nil, + Admin: addrs[1].String(), + Members: members, }) require.NoError(t, err) diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index c32b3551b2eb..db46581aa1ec 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -52,9 +52,8 @@ func (s *TestSuite) SetupTest() { {Address: s.addrs[4].String(), Weight: "1"}, {Address: s.addrs[1].String(), Weight: "2"}, } groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: s.addrs[0].String(), - Members: members, - Metadata: nil, + Admin: s.addrs[0].String(), + Members: members, }) s.Require().NoError(err) s.groupID = groupRes.GroupId @@ -64,9 +63,8 @@ func (s *TestSuite) SetupTest() { time.Second, ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: s.addrs[0].String(), - GroupId: s.groupID, - Metadata: nil, + Admin: s.addrs[0].String(), + GroupId: s.groupID, } err = policyReq.SetDecisionPolicy(policy) s.Require().NoError(err) @@ -90,15 +88,13 @@ func (s *TestSuite) TestCreateGroup() { addr6 := addrs[5] members := []group.Member{{ - Address: addr5.String(), - Weight: "1", - Metadata: nil, - AddedAt: s.blockTime, + Address: addr5.String(), + Weight: "1", + AddedAt: s.blockTime, }, { - Address: addr6.String(), - Weight: "2", - Metadata: nil, - AddedAt: s.blockTime, + Address: addr6.String(), + Weight: "2", + AddedAt: s.blockTime, }} expGroups := []*group.GroupInfo{ @@ -107,7 +103,6 @@ func (s *TestSuite) TestCreateGroup() { Version: 1, Admin: addr1.String(), TotalWeight: "3", - Metadata: nil, CreatedAt: s.blockTime, }, { @@ -115,7 +110,6 @@ func (s *TestSuite) TestCreateGroup() { Version: 1, Admin: addr1.String(), TotalWeight: "3", - Metadata: nil, CreatedAt: s.blockTime, }, } @@ -127,9 +121,8 @@ func (s *TestSuite) TestCreateGroup() { }{ "all good": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), - Members: members, - Metadata: nil, + Admin: addr1.String(), + Members: members, }, expGroups: expGroups, }, @@ -137,7 +130,7 @@ func (s *TestSuite) TestCreateGroup() { req: &group.MsgCreateGroup{ Admin: addr1.String(), Members: members, - Metadata: bytes.Repeat([]byte{1}, 256), + Metadata: strings.Repeat("a", 256), }, expErr: true, }, @@ -147,9 +140,8 @@ func (s *TestSuite) TestCreateGroup() { Members: []group.Member{{ Address: addr3.String(), Weight: "1", - Metadata: bytes.Repeat([]byte{1}, 256), + Metadata: strings.Repeat("a", 256), }}, - Metadata: nil, }, expErr: true, }, @@ -157,11 +149,9 @@ func (s *TestSuite) TestCreateGroup() { req: &group.MsgCreateGroup{ Admin: addr1.String(), Members: []group.Member{{ - Address: addr3.String(), - Weight: "0", - Metadata: nil, + Address: addr3.String(), + Weight: "0", }}, - Metadata: nil, }, expErr: true, }, @@ -239,17 +229,15 @@ func (s *TestSuite) TestUpdateGroupAdmin() { addr4 := addrs[3] members := []group.Member{{ - Address: addr1.String(), - Weight: "1", - Metadata: nil, - AddedAt: s.blockTime, + Address: addr1.String(), + Weight: "1", + AddedAt: s.blockTime, }} oldAdmin := addr2.String() newAdmin := addr3.String() groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: oldAdmin, - Members: members, - Metadata: nil, + Admin: oldAdmin, + Members: members, }) s.Require().NoError(err) groupID := groupRes.GroupId @@ -267,7 +255,6 @@ func (s *TestSuite) TestUpdateGroupAdmin() { expStored: &group.GroupInfo{ Id: groupID, Admin: newAdmin, - Metadata: nil, TotalWeight: "1", Version: 2, CreatedAt: s.blockTime, @@ -283,7 +270,6 @@ func (s *TestSuite) TestUpdateGroupAdmin() { expStored: &group.GroupInfo{ Id: groupID, Admin: oldAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -299,7 +285,6 @@ func (s *TestSuite) TestUpdateGroupAdmin() { expStored: &group.GroupInfo{ Id: groupID, Admin: oldAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -339,14 +324,12 @@ func (s *TestSuite) TestUpdateGroupMetadata() { }{ "with correct admin": { req: &group.MsgUpdateGroupMetadata{ - GroupId: groupID, - Admin: oldAdmin, - Metadata: []byte{1, 2, 3}, + GroupId: groupID, + Admin: oldAdmin, }, expStored: &group.GroupInfo{ Id: groupID, Admin: oldAdmin, - Metadata: []byte{1, 2, 3}, TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, @@ -354,15 +337,13 @@ func (s *TestSuite) TestUpdateGroupMetadata() { }, "with wrong admin": { req: &group.MsgUpdateGroupMetadata{ - GroupId: groupID, - Admin: addr3.String(), - Metadata: []byte{1, 2, 3}, + GroupId: groupID, + Admin: addr3.String(), }, expErr: true, expStored: &group.GroupInfo{ Id: groupID, Admin: oldAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -370,15 +351,13 @@ func (s *TestSuite) TestUpdateGroupMetadata() { }, "with unknown groupid": { req: &group.MsgUpdateGroupMetadata{ - GroupId: 999, - Admin: oldAdmin, - Metadata: []byte{1, 2, 3}, + GroupId: 999, + Admin: oldAdmin, }, expErr: true, expStored: &group.GroupInfo{ Id: groupID, Admin: oldAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -415,16 +394,14 @@ func (s *TestSuite) TestUpdateGroupMembers() { member1 := addr5.String() member2 := addr6.String() members := []group.Member{{ - Address: member1, - Weight: "1", - Metadata: nil, + Address: member1, + Weight: "1", }} myAdmin := addr4.String() groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: myAdmin, - Members: members, - Metadata: nil, + Admin: myAdmin, + Members: members, }) s.Require().NoError(err) groupID := groupRes.GroupId @@ -440,15 +417,13 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.Member{{ - Address: member2, - Weight: "2", - Metadata: nil, + Address: member2, + Weight: "2", }}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, @@ -456,17 +431,15 @@ func (s *TestSuite) TestUpdateGroupMembers() { expMembers: []*group.GroupMember{ { Member: &group.Member{ - Address: member2, - Weight: "2", - Metadata: nil, + Address: member2, + Weight: "2", }, GroupId: groupID, }, { Member: &group.Member{ - Address: member1, - Weight: "1", - Metadata: nil, + Address: member1, + Weight: "1", }, GroupId: groupID, }, @@ -477,15 +450,13 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.Member{{ - Address: member1, - Weight: "2", - Metadata: []byte{1, 2, 3}, + Address: member1, + Weight: "2", }}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "2", Version: 2, CreatedAt: s.blockTime, @@ -494,9 +465,8 @@ func (s *TestSuite) TestUpdateGroupMembers() { { GroupId: groupID, Member: &group.Member{ - Address: member1, - Weight: "2", - Metadata: []byte{1, 2, 3}, + Address: member1, + Weight: "2", }, }, }, @@ -513,7 +483,6 @@ func (s *TestSuite) TestUpdateGroupMembers() { expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "1", Version: 2, CreatedAt: s.blockTime, @@ -534,21 +503,18 @@ func (s *TestSuite) TestUpdateGroupMembers() { Admin: myAdmin, MemberUpdates: []group.Member{ { - Address: member1, - Weight: "0", - Metadata: nil, + Address: member1, + Weight: "0", }, { - Address: member2, - Weight: "1", - Metadata: nil, + Address: member2, + Weight: "1", }, }, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "1", Version: 2, CreatedAt: s.blockTime, @@ -556,9 +522,8 @@ func (s *TestSuite) TestUpdateGroupMembers() { expMembers: []*group.GroupMember{{ GroupId: groupID, Member: &group.Member{ - Address: member2, - Weight: "1", - Metadata: nil, + Address: member2, + Weight: "1", }, }}, }, @@ -567,15 +532,13 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.Member{{ - Address: member1, - Weight: "0", - Metadata: nil, + Address: member1, + Weight: "0", }}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "0", Version: 2, CreatedAt: s.blockTime, @@ -587,16 +550,14 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.Member{{ - Address: addr4.String(), - Weight: "0", - Metadata: nil, + Address: addr4.String(), + Weight: "0", }}, }, expErr: true, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -604,9 +565,8 @@ func (s *TestSuite) TestUpdateGroupMembers() { expMembers: []*group.GroupMember{{ GroupId: groupID, Member: &group.Member{ - Address: member1, - Weight: "1", - Metadata: nil, + Address: member1, + Weight: "1", }, }}, }, @@ -615,16 +575,14 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: addr3.String(), MemberUpdates: []group.Member{{ - Address: member1, - Weight: "2", - Metadata: nil, + Address: member1, + Weight: "2", }}, }, expErr: true, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -642,16 +600,14 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: 999, Admin: myAdmin, MemberUpdates: []group.Member{{ - Address: member1, - Weight: "2", - Metadata: nil, + Address: member1, + Weight: "2", }}, }, expErr: true, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - Metadata: nil, TotalWeight: "1", Version: 1, CreatedAt: s.blockTime, @@ -713,15 +669,13 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { addr6 := addrs[5] members := []group.Member{{ - Address: addr5.String(), - Weight: "1", - Metadata: nil, - AddedAt: s.blockTime, + Address: addr5.String(), + Weight: "1", + AddedAt: s.blockTime, }, { - Address: addr6.String(), - Weight: "2", - Metadata: nil, - AddedAt: s.blockTime, + Address: addr6.String(), + Weight: "2", + AddedAt: s.blockTime, }} specs := map[string]struct { @@ -732,11 +686,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }{ "all good": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), - Members: members, - GroupMetadata: nil, - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: false, + Admin: addr1.String(), + Members: members, + GroupPolicyAsAdmin: false, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -745,11 +697,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "group policy as admin is true": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), - Members: members, - GroupMetadata: nil, - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: true, + Admin: addr1.String(), + Members: members, + GroupPolicyAsAdmin: true, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -758,11 +708,10 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "group metadata too long": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), - Members: members, - GroupMetadata: bytes.Repeat([]byte{1}, 256), - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: false, + Admin: addr1.String(), + Members: members, + GroupPolicyAsAdmin: false, + GroupMetadata: strings.Repeat("a", 256), }, policy: group.NewThresholdDecisionPolicy( "1", @@ -775,9 +724,8 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { req: &group.MsgCreateGroupWithPolicy{ Admin: addr1.String(), Members: members, - GroupMetadata: nil, - GroupPolicyMetadata: bytes.Repeat([]byte{1}, 256), GroupPolicyAsAdmin: false, + GroupPolicyMetadata: strings.Repeat("a", 256), }, policy: group.NewThresholdDecisionPolicy( "1", @@ -792,11 +740,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { Members: []group.Member{{ Address: addr3.String(), Weight: "1", - Metadata: bytes.Repeat([]byte{1}, 256), + Metadata: strings.Repeat("a", 256), }}, - GroupMetadata: nil, - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: false, + GroupPolicyAsAdmin: false, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -809,13 +755,10 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { req: &group.MsgCreateGroupWithPolicy{ Admin: addr1.String(), Members: []group.Member{{ - Address: addr3.String(), - Weight: "0", - Metadata: nil, + Address: addr3.String(), + Weight: "0", }}, - GroupMetadata: nil, - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: false, + GroupPolicyAsAdmin: false, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -826,11 +769,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "decision policy threshold > total group weight": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), - Members: members, - GroupMetadata: nil, - GroupPolicyMetadata: nil, - GroupPolicyAsAdmin: false, + Admin: addr1.String(), + Members: members, + GroupPolicyAsAdmin: false, }, policy: group.NewThresholdDecisionPolicy( "10", @@ -915,9 +856,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { addr4 := addrs[3] groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: addr1.String(), - Members: nil, - Metadata: nil, + Admin: addr1.String(), + Members: nil, }) s.Require().NoError(err) myGroupID := groupRes.GroupId @@ -930,9 +870,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }{ "all good": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr1.String(), + GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -941,9 +880,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "all good with percentage decision policy": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr1.String(), + GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( "0.5", @@ -952,9 +890,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "decision policy threshold > total group weight": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr1.String(), + GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( "10", @@ -963,9 +900,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "group id does not exists": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: 9999, + Admin: addr1.String(), + GroupId: 9999, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -976,9 +912,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "admin not group admin": { req: &group.MsgCreateGroupPolicy{ - Admin: addr4.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr4.String(), + GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( "1", @@ -990,8 +925,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { "metadata too long": { req: &group.MsgCreateGroupPolicy{ Admin: addr1.String(), - Metadata: []byte(strings.Repeat("a", 256)), GroupId: myGroupID, + Metadata: strings.Repeat("a", 256), }, policy: group.NewThresholdDecisionPolicy( "1", @@ -1002,9 +937,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "percentage decision policy with negative value": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr1.String(), + GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( "-0.5", @@ -1015,9 +949,8 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "percentage decision policy with value greater than 1": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: addr1.String(), + GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( "2", @@ -1086,7 +1019,6 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Admin: admin.String(), Address: groupPolicyAddr, GroupId: myGroupID, - Metadata: nil, Version: 2, DecisionPolicy: nil, CreatedAt: s.blockTime, @@ -1103,7 +1035,6 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Admin: admin.String(), Address: groupPolicyAddr, GroupId: myGroupID, - Metadata: nil, Version: 2, DecisionPolicy: nil, CreatedAt: s.blockTime, @@ -1120,7 +1051,6 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Admin: newAdmin.String(), Address: groupPolicyAddr, GroupId: myGroupID, - Metadata: nil, Version: 2, DecisionPolicy: nil, CreatedAt: s.blockTime, @@ -1164,42 +1094,37 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }{ "with wrong admin": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: addr5.String(), - Address: groupPolicyAddr, - Metadata: []byte("hello"), + Admin: addr5.String(), + Address: groupPolicyAddr, }, expGroupPolicy: &group.GroupPolicyInfo{}, expErr: true, }, "with wrong group policy": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), - Address: addr5.String(), - Metadata: []byte("hello"), + Admin: admin.String(), + Address: addr5.String(), }, expGroupPolicy: &group.GroupPolicyInfo{}, expErr: true, }, "with comment too long": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), - Address: addr5.String(), - Metadata: []byte(strings.Repeat("a", 256)), + Admin: admin.String(), + Address: addr5.String(), }, expGroupPolicy: &group.GroupPolicyInfo{}, expErr: true, }, "correct data": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), - Address: groupPolicyAddr, - Metadata: []byte("hello"), + Admin: admin.String(), + Address: groupPolicyAddr, }, expGroupPolicy: &group.GroupPolicyInfo{ Admin: admin.String(), Address: groupPolicyAddr, GroupId: myGroupID, - Metadata: []byte("hello"), Version: 2, DecisionPolicy: nil, CreatedAt: s.blockTime, @@ -1274,7 +1199,6 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { Admin: admin.String(), Address: groupPolicyAddr, GroupId: myGroupID, - Metadata: nil, Version: 2, DecisionPolicy: nil, CreatedAt: s.blockTime, @@ -1295,7 +1219,6 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { ), expGroupPolicy: &group.GroupPolicyInfo{ Admin: admin.String(), - Metadata: nil, DecisionPolicy: nil, Version: 2, CreatedAt: s.blockTime, @@ -1345,9 +1268,8 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { admin := addr2 groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: admin.String(), - Members: nil, - Metadata: nil, + Admin: admin.String(), + Members: nil, }) s.Require().NoError(err) myGroupID := groupRes.GroupId @@ -1371,9 +1293,8 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { expectAccs := make([]*group.GroupPolicyInfo, count) for i := range expectAccs { req := &group.MsgCreateGroupPolicy{ - Admin: admin.String(), - Metadata: nil, - GroupId: myGroupID, + Admin: admin.String(), + GroupId: myGroupID, } err := req.SetDecisionPolicy(policies[i]) s.Require().NoError(err) @@ -1383,7 +1304,6 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { expectAcc := &group.GroupPolicyInfo{ Address: res.Address, Admin: admin.String(), - Metadata: nil, GroupId: myGroupID, Version: uint64(1), CreatedAt: s.blockTime, @@ -1450,9 +1370,8 @@ func (s *TestSuite) TestSubmitProposal() { } policyReq := &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - GroupId: myGroupID, - Metadata: nil, + Admin: addr1.String(), + GroupId: myGroupID, } policy := group.NewThresholdDecisionPolicy( "100", @@ -1506,15 +1425,14 @@ func (s *TestSuite) TestSubmitProposal() { "metadata too long": { req: &group.MsgSubmitProposal{ Address: accountAddr.String(), - Metadata: bytes.Repeat([]byte{1}, 256), Proposers: []string{addr2.String()}, + Metadata: strings.Repeat("a", 256), }, expErr: true, postRun: func(sdkCtx sdk.Context) {}, }, "group policy required": { req: &group.MsgSubmitProposal{ - Metadata: nil, Proposers: []string{addr2.String()}, }, expErr: true, @@ -1555,7 +1473,6 @@ func (s *TestSuite) TestSubmitProposal() { "admin that is not a group member can not create proposal": { req: &group.MsgSubmitProposal{ Address: accountAddr.String(), - Metadata: nil, Proposers: []string{addr1.String()}, }, expErr: true, @@ -1564,7 +1481,6 @@ func (s *TestSuite) TestSubmitProposal() { "reject msgs that are not authz by group policy": { req: &group.MsgSubmitProposal{ Address: accountAddr.String(), - Metadata: nil, Proposers: []string{addr2.String()}, }, msgs: []sdk.Msg{&testdata.TestMsg{Signers: []string{addr1.String()}}}, @@ -1759,9 +1675,8 @@ func (s *TestSuite) TestVote() { {Address: addr3.String(), Weight: "2", AddedAt: s.blockTime}, } groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: addr1.String(), - Members: members, - Metadata: nil, + Admin: addr1.String(), + Members: members, }) s.Require().NoError(err) myGroupID := groupRes.GroupId @@ -1771,9 +1686,8 @@ func (s *TestSuite) TestVote() { time.Duration(2), ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), - GroupId: myGroupID, - Metadata: nil, + Admin: addr1.String(), + GroupId: myGroupID, } err = policyReq.SetDecisionPolicy(policy) s.Require().NoError(err) @@ -1788,7 +1702,6 @@ func (s *TestSuite) TestVote() { req := &group.MsgSubmitProposal{ Address: accountAddr, - Metadata: nil, Proposers: []string{addr4.String()}, Messages: nil, } @@ -1984,8 +1897,8 @@ func (s *TestSuite) TestVote() { req: &group.MsgVote{ ProposalId: myProposalID, Voter: addr4.String(), - Metadata: bytes.Repeat([]byte{1}, 256), Option: group.VOTE_OPTION_NO, + Metadata: strings.Repeat("a", 256), }, expErr: true, postRun: func(sdkCtx sdk.Context) {}, @@ -2086,9 +1999,8 @@ func (s *TestSuite) TestVote() { }, doBefore: func(ctx context.Context) { _, err = s.keeper.UpdateGroupMetadata(ctx, &group.MsgUpdateGroupMetadata{ - GroupId: myGroupID, - Admin: addr1.String(), - Metadata: []byte{1, 2, 3}, + GroupId: myGroupID, + Admin: addr1.String(), }) s.Require().NoError(err) }, @@ -2298,9 +2210,8 @@ func (s *TestSuite) TestExecProposal() { // then modify group _, err := s.keeper.UpdateGroupMetadata(ctx, &group.MsgUpdateGroupMetadata{ - Admin: addr1.String(), - GroupId: s.groupID, - Metadata: []byte{1, 2, 3}, + Admin: addr1.String(), + GroupId: s.groupID, }) s.Require().NoError(err) return myProposalID @@ -2313,9 +2224,8 @@ func (s *TestSuite) TestExecProposal() { setupProposal: func(ctx context.Context) uint64 { myProposalID := submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers) _, err := s.keeper.UpdateGroupPolicyMetadata(ctx, &group.MsgUpdateGroupPolicyMetadata{ - Admin: addr1.String(), - Address: s.groupPolicyAddr.String(), - Metadata: []byte("group policy modified before tally"), + Admin: addr1.String(), + Address: s.groupPolicyAddr.String(), }) s.Require().NoError(err) return myProposalID @@ -2417,7 +2327,6 @@ func submitProposal( proposalReq := &group.MsgSubmitProposal{ Address: s.groupPolicyAddr.String(), Proposers: proposers, - Metadata: nil, } err := proposalReq.SetMsgs(msgs) s.Require().NoError(err) @@ -2447,17 +2356,15 @@ func createGroupAndGroupPolicy( s *TestSuite, ) (string, uint64, group.DecisionPolicy) { groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: admin.String(), - Members: nil, - Metadata: nil, + Admin: admin.String(), + Members: nil, }) s.Require().NoError(err) myGroupID := groupRes.GroupId groupPolicy := &group.MsgCreateGroupPolicy{ - Admin: admin.String(), - GroupId: myGroupID, - Metadata: nil, + Admin: admin.String(), + GroupId: myGroupID, } policy := group.NewThresholdDecisionPolicy( diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index 7d3b2172cf10..b2240260224b 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -890,8 +890,8 @@ func (k Keeper) doAuthenticated(ctx sdk.Context, req authNGroupReq, action actio // assertMetadataLength returns an error if given metadata length // is greater than a pre-defined maxMetadataLen. -func (k Keeper) assertMetadataLength(metadata []byte, description string) error { - if metadata != nil && uint64(len(metadata)) > k.config.MaxMetadataLen { +func (k Keeper) assertMetadataLength(metadata string, description string) error { + if metadata != "" && uint64(len(metadata)) > k.config.MaxMetadataLen { return sdkerrors.Wrapf(errors.ErrMaxLimit, description) } return nil diff --git a/x/group/msgs.go b/x/group/msgs.go index 38982d847210..24fa55b5bbb8 100644 --- a/x/group/msgs.go +++ b/x/group/msgs.go @@ -216,7 +216,7 @@ var _ sdk.Msg = &MsgCreateGroupWithPolicy{} var _ types.UnpackInterfacesMessage = MsgCreateGroupWithPolicy{} // NewMsgCreateGroupWithPolicy creates a new MsgCreateGroupWithPolicy. -func NewMsgCreateGroupWithPolicy(admin string, members []Member, group_metadata []byte, group_policy_metadata []byte, groupPolicyAsAdmin bool, decisionPolicy DecisionPolicy) (*MsgCreateGroupWithPolicy, error) { +func NewMsgCreateGroupWithPolicy(admin string, members []Member, group_metadata string, group_policy_metadata string, groupPolicyAsAdmin bool, decisionPolicy DecisionPolicy) (*MsgCreateGroupWithPolicy, error) { m := &MsgCreateGroupWithPolicy{ Admin: admin, Members: members, @@ -533,7 +533,7 @@ var _ sdk.Msg = &MsgCreateGroupPolicy{} var _ types.UnpackInterfacesMessage = MsgCreateGroupPolicy{} // NewMsgCreateGroupPolicy creates a new MsgCreateGroupPolicy. -func NewMsgCreateGroupPolicy(admin sdk.AccAddress, group uint64, metadata []byte, decisionPolicy DecisionPolicy) (*MsgCreateGroupPolicy, error) { +func NewMsgCreateGroupPolicy(admin sdk.AccAddress, group uint64, metadata string, decisionPolicy DecisionPolicy) (*MsgCreateGroupPolicy, error) { m := &MsgCreateGroupPolicy{ Admin: admin.String(), GroupId: group, @@ -554,7 +554,7 @@ func (m *MsgCreateGroupPolicy) GetGroupID() uint64 { return m.GroupId } -func (m *MsgCreateGroupPolicy) GetMetadata() []byte { +func (m *MsgCreateGroupPolicy) GetMetadata() string { return m.Metadata } @@ -588,7 +588,7 @@ func (m MsgCreateGroupPolicy) UnpackInterfaces(unpacker types.AnyUnpacker) error var _ sdk.Msg = &MsgSubmitProposal{} // NewMsgSubmitProposalRequest creates a new MsgSubmitProposal. -func NewMsgSubmitProposalRequest(address string, proposers []string, msgs []sdk.Msg, metadata []byte, exec Exec) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposalRequest(address string, proposers []string, msgs []sdk.Msg, metadata string, exec Exec) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ Address: address, Proposers: proposers, diff --git a/x/group/msgs_test.go b/x/group/msgs_test.go index db8583d94136..c15b16011fe8 100644 --- a/x/group/msgs_test.go +++ b/x/group/msgs_test.go @@ -83,12 +83,12 @@ func TestMsgCreateGroup(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, }, }, @@ -103,7 +103,7 @@ func TestMsgCreateGroup(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, }, }, @@ -127,12 +127,12 @@ func TestMsgCreateGroup(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, { Address: member2.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, }, }, @@ -255,7 +255,7 @@ func TestMsgUpdateGroupMetadata(t *testing.T) { &group.MsgUpdateGroupMetadata{ GroupId: 1, Admin: admin.String(), - Metadata: []byte("metadata"), + Metadata: "metadata", }, false, "", @@ -317,7 +317,7 @@ func TestMsgUpdateGroupMembers(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, }, }, @@ -333,7 +333,7 @@ func TestMsgUpdateGroupMembers(t *testing.T) { { Address: member1.String(), Weight: "0", - Metadata: []byte("metadata"), + Metadata: "metadata", }, }, }, @@ -372,10 +372,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin, members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin, members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -390,10 +390,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: "invalid_address", Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -408,10 +408,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "-1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -426,10 +426,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "0", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -444,15 +444,15 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -467,10 +467,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -485,10 +485,10 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -503,15 +503,15 @@ func TestMsgCreateGroupWithPolicy(t *testing.T) { { Address: member1.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, { Address: member2.String(), Weight: "1", - Metadata: []byte("metadata"), + Metadata: "metadata", }, } - req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, []byte("group_metadata"), []byte("group_policy_metadata"), false, policy) + req, err := group.NewMsgCreateGroupWithPolicy(admin.String(), members, "group_metadata", "group_policy_metadata", false, policy) require.NoError(t, err) return req }, @@ -567,7 +567,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "invalid threshold policy", func() *group.MsgCreateGroupPolicy { policy := group.NewThresholdDecisionPolicy("-1", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), policy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", policy) require.NoError(t, err) return req }, @@ -578,7 +578,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "valid test case", func() *group.MsgCreateGroupPolicy { policy := group.NewThresholdDecisionPolicy("1", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), policy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", policy) require.NoError(t, err) return req }, @@ -589,7 +589,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "invalid percentage decision policy with zero value", func() *group.MsgCreateGroupPolicy { percentagePolicy := group.NewPercentageDecisionPolicy("0", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), percentagePolicy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", percentagePolicy) require.NoError(t, err) return req }, @@ -600,7 +600,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "invalid percentage decision policy with negative value", func() *group.MsgCreateGroupPolicy { percentagePolicy := group.NewPercentageDecisionPolicy("-0.2", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), percentagePolicy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", percentagePolicy) require.NoError(t, err) return req }, @@ -611,7 +611,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "invalid percentage decision policy with value greater than 1", func() *group.MsgCreateGroupPolicy { percentagePolicy := group.NewPercentageDecisionPolicy("2", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), percentagePolicy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", percentagePolicy) require.NoError(t, err) return req }, @@ -622,7 +622,7 @@ func TestMsgCreateGroupPolicy(t *testing.T) { "valid test case with percentage decision policy", func() *group.MsgCreateGroupPolicy { percentagePolicy := group.NewPercentageDecisionPolicy("0.5", time.Second) - req, err := group.NewMsgCreateGroupPolicy(admin, 1, []byte("metadata"), percentagePolicy) + req, err := group.NewMsgCreateGroupPolicy(admin, 1, "metadata", percentagePolicy) require.NoError(t, err) return req }, @@ -847,7 +847,7 @@ func TestMsgUpdateGroupPolicyMetadata(t *testing.T) { &group.MsgUpdateGroupPolicyMetadata{ Admin: admin.String(), Address: member1.String(), - Metadata: []byte("metadata"), + Metadata: "metadata", }, false, "", diff --git a/x/group/simulation/genesis.go b/x/group/simulation/genesis.go index 3ee2cf578db8..d3958bfe7d06 100644 --- a/x/group/simulation/genesis.go +++ b/x/group/simulation/genesis.go @@ -28,7 +28,7 @@ func getGroups(r *rand.Rand, accounts []simtypes.Account) []*group.GroupInfo { groups[i] = &group.GroupInfo{ Id: uint64(i + 1), Admin: acc.Address.String(), - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), Version: 1, TotalWeight: "10", } @@ -45,7 +45,7 @@ func getGroupMembers(r *rand.Rand, accounts []simtypes.Account) []*group.GroupMe Member: &group.Member{ Address: acc.Address.String(), Weight: "10", - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), }, } } @@ -66,7 +66,7 @@ func getGroupPolicies(r *rand.Rand, simState *module.SimulationState) []*group.G Address: acc.Address.String(), Version: 1, DecisionPolicy: any, - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } } return groupPolicies @@ -98,7 +98,7 @@ func getProposals(r *rand.Rand, simState *module.SimulationState) []*group.Propo NoWithVetoCount: "0", }, ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN, - Metadata: []byte(simtypes.RandStringOfLength(r, 50)), + Metadata: simtypes.RandStringOfLength(r, 50), SubmitTime: submittedAt, Timeout: timeout, } @@ -125,7 +125,7 @@ func getVotes(r *rand.Rand, simState *module.SimulationState) []*group.Vote { ProposalId: uint64(i + 1), Voter: simState.Accounts[i].Address.String(), Option: getVoteOption(i), - Metadata: []byte(simtypes.RandStringOfLength(r, 50)), + Metadata: simtypes.RandStringOfLength(r, 50), SubmitTime: time.Unix(0, 0), } } diff --git a/x/group/simulation/operations.go b/x/group/simulation/operations.go index b57eca40f61c..58ffed18c837 100644 --- a/x/group/simulation/operations.go +++ b/x/group/simulation/operations.go @@ -242,7 +242,7 @@ func SimulateMsgCreateGroup(ak group.AccountKeeper, bk group.BankKeeper) simtype } members := genGroupMembers(r, accounts) - msg := &group.MsgCreateGroup{Admin: accAddr, Members: members, Metadata: []byte(simtypes.RandStringOfLength(r, 10))} + msg := &group.MsgCreateGroup{Admin: accAddr, Members: members, Metadata: simtypes.RandStringOfLength(r, 10)} txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( @@ -291,8 +291,8 @@ func SimulateMsgCreateGroupWithPolicy(ak group.AccountKeeper, bk group.BankKeepe msg := &group.MsgCreateGroupWithPolicy{ Admin: accAddr, Members: members, - GroupMetadata: []byte(simtypes.RandStringOfLength(r, 10)), - GroupPolicyMetadata: []byte(simtypes.RandStringOfLength(r, 10)), + GroupMetadata: simtypes.RandStringOfLength(r, 10), + GroupPolicyMetadata: simtypes.RandStringOfLength(r, 10), GroupPolicyAsAdmin: r.Float32() < 0.5, } msg.SetDecisionPolicy(decisionPolicy) @@ -346,7 +346,7 @@ func SimulateMsgCreateGroupPolicy(ak group.AccountKeeper, bk group.BankKeeper, k msg, err := group.NewMsgCreateGroupPolicy( acc.Address, groupID, - []byte(simtypes.RandStringOfLength(r, 10)), + simtypes.RandStringOfLength(r, 10), &group.ThresholdDecisionPolicy{ Threshold: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 10)), Timeout: time.Second * time.Duration(30*24*60*60), @@ -424,7 +424,7 @@ func SimulateMsgSubmitProposal(ak group.AccountKeeper, bk group.BankKeeper, k ke msg := group.MsgSubmitProposal{ Address: groupPolicyAddr, Proposers: []string{acc.Address.String()}, - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } txGen := simappparams.MakeTestEncodingConfig().TxConfig @@ -531,7 +531,7 @@ func SimulateMsgUpdateGroupMetadata(ak group.AccountKeeper, bk group.BankKeeper, msg := group.MsgUpdateGroupMetadata{ GroupId: groupID, Admin: account.GetAddress().String(), - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } txGen := simappparams.MakeTestEncodingConfig().TxConfig @@ -773,7 +773,7 @@ func SimulateMsgUpdateGroupPolicyMetadata(ak group.AccountKeeper, msg := group.MsgUpdateGroupPolicyMetadata{ Admin: acc.Address.String(), Address: groupPolicyAddr, - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } txGen := simappparams.MakeTestEncodingConfig().TxConfig @@ -995,7 +995,7 @@ func SimulateMsgVote(ak group.AccountKeeper, ProposalId: uint64(proposalID), Voter: acc.Address.String(), Option: group.VOTE_OPTION_YES, - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } txGen := simappparams.MakeTestEncodingConfig().TxConfig tx, err := helpers.GenTx( @@ -1217,7 +1217,7 @@ func genGroupMembers(r *rand.Rand, accounts []simtypes.Account) []group.Member { { Address: accounts[0].Address.String(), Weight: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 5)), - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), }, } } @@ -1234,7 +1234,7 @@ func genGroupMembers(r *rand.Rand, accounts []simtypes.Account) []group.Member { members[i] = group.Member{ Address: accounts[i].Address.String(), Weight: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 5)), - Metadata: []byte(simtypes.RandStringOfLength(r, 10)), + Metadata: simtypes.RandStringOfLength(r, 10), } } diff --git a/x/group/simulation/operations_test.go b/x/group/simulation/operations_test.go index b84fff53379c..2dcd6e8ae4bd 100644 --- a/x/group/simulation/operations_test.go +++ b/x/group/simulation/operations_test.go @@ -1,11 +1,12 @@ package simulation_test import ( - "github.com/cosmos/cosmos-sdk/codec/legacy" "math/rand" "testing" "time" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -217,9 +218,8 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: acc.Address.String(), + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -272,9 +272,8 @@ func (suite *SimTestSuite) TestWithdrawProposal() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: addr, - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: addr, + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -288,7 +287,7 @@ func (suite *SimTestSuite) TestWithdrawProposal() { ToAddress: addr, Amount: sdk.Coins{sdk.NewInt64Coin("token", 100)}, }, - }, []byte{}, 0) + }, "", 0) suite.Require().NoError(err) _, err = suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq) suite.Require().NoError(err) @@ -341,7 +340,7 @@ func (suite *SimTestSuite) TestSimulateVote() { accountReq := &group.MsgCreateGroupPolicy{ Admin: addr, GroupId: groupRes.GroupId, - Metadata: nil, + Metadata: "", } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -355,7 +354,7 @@ func (suite *SimTestSuite) TestSimulateVote() { ToAddress: addr, Amount: sdk.Coins{sdk.NewInt64Coin("token", 100)}, }, - }, []byte{}, 0) + }, "", 0) suite.Require().NoError(err) _, err = suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq) suite.Require().NoError(err) @@ -406,9 +405,8 @@ func (suite *SimTestSuite) TestSimulateExec() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: addr, - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: addr, + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -422,7 +420,7 @@ func (suite *SimTestSuite) TestSimulateExec() { ToAddress: addr, Amount: sdk.Coins{sdk.NewInt64Coin("token", 100)}, }, - }, []byte{}, 0) + }, "", 0) suite.Require().NoError(err) proposalRes, err := suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq) suite.Require().NoError(err) @@ -606,9 +604,8 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: acc.Address.String(), + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -660,9 +657,8 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: acc.Address.String(), + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) @@ -714,9 +710,8 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), - GroupId: groupRes.GroupId, - Metadata: nil, + Admin: acc.Address.String(), + GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour)) suite.Require().NoError(err) diff --git a/x/group/tx.pb.go b/x/group/tx.pb.go index 377615274d55..17ad30b00b1e 100644 --- a/x/group/tx.pb.go +++ b/x/group/tx.pb.go @@ -70,7 +70,7 @@ type MsgCreateGroup struct { // members defines the group members. Members []Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members"` // metadata is any arbitrary metadata to attached to the group. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *MsgCreateGroup) Reset() { *m = MsgCreateGroup{} } @@ -120,11 +120,11 @@ func (m *MsgCreateGroup) GetMembers() []Member { return nil } -func (m *MsgCreateGroup) GetMetadata() []byte { +func (m *MsgCreateGroup) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } // MsgCreateGroupResponse is the Msg/CreateGroup response type. @@ -383,7 +383,7 @@ type MsgUpdateGroupMetadata struct { // group_id is the unique ID of the group. GroupId uint64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // metadata is the updated group's metadata. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *MsgUpdateGroupMetadata) Reset() { *m = MsgUpdateGroupMetadata{} } @@ -433,11 +433,11 @@ func (m *MsgUpdateGroupMetadata) GetGroupId() uint64 { return 0 } -func (m *MsgUpdateGroupMetadata) GetMetadata() []byte { +func (m *MsgUpdateGroupMetadata) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } // MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. @@ -484,7 +484,7 @@ type MsgCreateGroupPolicy struct { // group_id is the unique ID of the group. GroupId uint64 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // metadata is any arbitrary metadata attached to the group policy. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // decision_policy specifies the group policy's decision policy. DecisionPolicy *types.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` } @@ -639,9 +639,9 @@ type MsgCreateGroupWithPolicy struct { // members defines the group members. Members []Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members"` // group_metadata is any arbitrary metadata attached to the group. - GroupMetadata []byte `protobuf:"bytes,3,opt,name=group_metadata,json=groupMetadata,proto3" json:"group_metadata,omitempty"` + GroupMetadata string `protobuf:"bytes,3,opt,name=group_metadata,json=groupMetadata,proto3" json:"group_metadata,omitempty"` // group_policy_metadata is any arbitrary metadata attached to the group policy. - GroupPolicyMetadata []byte `protobuf:"bytes,4,opt,name=group_policy_metadata,json=groupPolicyMetadata,proto3" json:"group_policy_metadata,omitempty"` + GroupPolicyMetadata string `protobuf:"bytes,4,opt,name=group_policy_metadata,json=groupPolicyMetadata,proto3" json:"group_policy_metadata,omitempty"` // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. GroupPolicyAsAdmin bool `protobuf:"varint,5,opt,name=group_policy_as_admin,json=groupPolicyAsAdmin,proto3" json:"group_policy_as_admin,omitempty"` // decision_policy specifies the group policy's decision policy. @@ -864,7 +864,7 @@ type MsgUpdateGroupPolicyMetadata struct { // address is the account address of group policy. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // metadata is the updated group policy metadata. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *MsgUpdateGroupPolicyMetadata) Reset() { *m = MsgUpdateGroupPolicyMetadata{} } @@ -914,11 +914,11 @@ func (m *MsgUpdateGroupPolicyMetadata) GetAddress() string { return "" } -func (m *MsgUpdateGroupPolicyMetadata) GetMetadata() []byte { +func (m *MsgUpdateGroupPolicyMetadata) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } // MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. @@ -966,7 +966,7 @@ type MsgSubmitProposal struct { // Proposers signatures will be counted as yes votes. Proposers []string `protobuf:"bytes,2,rep,name=proposers,proto3" json:"proposers,omitempty"` // metadata is any arbitrary metadata to attached to the proposal. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. Messages []*types.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"` // exec defines the mode of execution of the proposal, @@ -1155,7 +1155,7 @@ type MsgVote struct { // option is the voter's choice on the proposal. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.group.v1beta1.VoteOption" json:"option,omitempty"` // metadata is any arbitrary metadata to attached to the vote. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // exec defines whether the proposal should be executed // immediately after voting or not. Exec Exec `protobuf:"varint,5,opt,name=exec,proto3,enum=cosmos.group.v1beta1.Exec" json:"exec,omitempty"` @@ -1215,11 +1215,11 @@ func (m *MsgVote) GetOption() VoteOption { return VOTE_OPTION_UNSPECIFIED } -func (m *MsgVote) GetMetadata() []byte { +func (m *MsgVote) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } func (m *MsgVote) GetExec() Exec { @@ -1391,82 +1391,82 @@ func init() { func init() { proto.RegisterFile("cosmos/group/v1beta1/tx.proto", fileDescriptor_da0de9d603d844fb) } var fileDescriptor_da0de9d603d844fb = []byte{ - // 1199 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0xe3, 0x44, - 0x14, 0xcf, 0x34, 0xde, 0x7e, 0xbc, 0xec, 0x66, 0xbb, 0x6e, 0xba, 0xa4, 0xa6, 0x4d, 0x83, 0xe9, - 0x42, 0x29, 0xad, 0xbd, 0x4d, 0xf9, 0x58, 0x55, 0x2b, 0x44, 0xdb, 0x0d, 0x28, 0x88, 0x40, 0x71, - 0x59, 0xbe, 0x2e, 0x91, 0x13, 0x1b, 0xaf, 0x97, 0x26, 0xb6, 0x32, 0x4e, 0xdb, 0x9c, 0x90, 0xf6, - 0x04, 0xda, 0x0b, 0xff, 0x00, 0x12, 0x12, 0x12, 0x07, 0x4e, 0x1c, 0xf6, 0xc2, 0x95, 0xd3, 0x8a, - 0xd3, 0x8a, 0x13, 0x27, 0xb4, 0x6a, 0x0f, 0x1c, 0x40, 0x82, 0x1b, 0x57, 0xe4, 0x19, 0x7b, 0x12, - 0x27, 0x76, 0xe2, 0x64, 0xab, 0x3d, 0x25, 0xf6, 0xfc, 0xde, 0x7b, 0xbf, 0xdf, 0x7b, 0x6f, 0xde, - 0x4c, 0x02, 0x4b, 0x35, 0x0b, 0xd7, 0x2d, 0x2c, 0x1b, 0x4d, 0xab, 0x65, 0xcb, 0x47, 0x9b, 0x55, - 0xdd, 0x51, 0x37, 0x65, 0xe7, 0x44, 0xb2, 0x9b, 0x96, 0x63, 0xf1, 0x19, 0xba, 0x2c, 0x91, 0x65, - 0xc9, 0x5b, 0x16, 0x32, 0x86, 0x65, 0x58, 0x04, 0x20, 0xbb, 0xdf, 0x28, 0x56, 0x58, 0xa0, 0xd8, - 0x0a, 0x5d, 0xf0, 0x0c, 0xbd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x30, 0x36, 0x77, 0x21, 0xdd, 0x73, 0xc6, 0xbf, 0x18, 0xe9, 0x2d, 0x08, 0x14, 0xe4, 0x98, 0xc0, - 0xee, 0x09, 0xd0, 0x77, 0x30, 0x46, 0x4f, 0x80, 0x5e, 0xe8, 0x80, 0x09, 0x10, 0x75, 0x04, 0xf2, - 0xef, 0x02, 0x47, 0x8e, 0xbf, 0xa5, 0x48, 0x53, 0x77, 0x59, 0xb8, 0x36, 0x70, 0xb9, 0xdb, 0x1b, - 0x19, 0xe8, 0xd1, 0xde, 0xdc, 0xe5, 0x01, 0xde, 0xba, 0x8f, 0x87, 0xdd, 0x37, 0x1e, 0x9e, 0xe6, - 0xd0, 0xa3, 0xd3, 0x1c, 0x7a, 0x7c, 0x9a, 0x43, 0xdf, 0x9c, 0xe5, 0x12, 0x8f, 0xce, 0x72, 0x89, - 0xdf, 0xcf, 0x72, 0x89, 0xcf, 0x56, 0x0c, 0xd3, 0xb9, 0xd3, 0xaa, 0x4a, 0x35, 0xab, 0xee, 0xfd, - 0x55, 0xe6, 0x7d, 0x6c, 0x60, 0xed, 0x0b, 0xf9, 0x84, 0xfe, 0x1d, 0x56, 0x9d, 0x24, 0x77, 0xa0, - 0xad, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xbd, 0x11, 0x36, 0xa6, 0x13, 0x00, 0x00, + // 1198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0xe3, 0xc4, + 0x17, 0xcf, 0x34, 0xde, 0xfe, 0x78, 0xf9, 0x6e, 0xb6, 0x75, 0xd3, 0xfd, 0xa6, 0xa6, 0x4d, 0x83, + 0xe9, 0x42, 0x29, 0xad, 0xbd, 0x4d, 0xf9, 0xb1, 0xaa, 0x56, 0x88, 0xb6, 0x1b, 0x50, 0x10, 0x81, + 0xe2, 0xb2, 0xfc, 0xba, 0x44, 0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0xad, 0xa9, 0x63, 0x7c, + 0xe8, 0x34, 0xcd, 0x86, 0xa1, 0x50, 0x18, 0x7f, 0x13, 0xa6, 0xea, 0x7a, 0xbd, 0xaa, 0x37, 0x71, + 0x76, 0x22, 0x9f, 0x5c, 0x4b, 0x15, 0x96, 0xa4, 0x30, 0xc5, 0x52, 0x99, 0x80, 0xf6, 0xb8, 0x87, + 0xbf, 0xaf, 0x24, 0x14, 0xdf, 0x84, 0x17, 0x60, 0xba, 0xae, 0x3b, 0xaa, 0xa6, 0x3a, 0x6a, 0x36, + 0xe9, 0x06, 0x54, 0xd8, 0xf3, 0x0e, 0xdc, 0xfb, 0xe3, 0xc7, 0x75, 0x1a, 0x45, 0xdc, 0x86, 0xab, + 0x41, 0x9e, 0x8a, 0x8e, 0x6d, 0xab, 0x81, 0x75, 0x7e, 0x11, 0xa6, 0x49, 0xa0, 0x8a, 0xa9, 0x11, + 0xca, 0x9c, 0x32, 0x45, 0x9e, 0x4b, 0x9a, 0xf8, 0x13, 0x82, 0x85, 0x32, 0x36, 0x6e, 0xdb, 0x9a, + 0x6f, 0x55, 0xf6, 0xc2, 0x8e, 0x2a, 0xb2, 0x3b, 0xc8, 0x44, 0x20, 0x08, 0x5f, 0x82, 0x34, 0x15, + 0x53, 0x69, 0x91, 0x38, 0x38, 0x9b, 0x8c, 0x9d, 0x86, 0xcb, 0xd4, 0x92, 0x12, 0xc4, 0x01, 0xc1, + 0x2b, 0xb0, 0x1c, 0x4a, 0xdd, 0xd7, 0x2d, 0x7e, 0x87, 0x60, 0x3e, 0x88, 0xd8, 0x25, 0x54, 0x2f, + 0x50, 0xda, 0x2b, 0x30, 0xd3, 0xd0, 0x4f, 0x2a, 0xd4, 0x5d, 0x72, 0x88, 0xbb, 0xe9, 0x86, 0x7e, + 0x42, 0x18, 0x04, 0x64, 0x2c, 0xc3, 0x33, 0x21, 0x24, 0x99, 0x88, 0xfb, 0x88, 0xd4, 0x35, 0x20, + 0x93, 0x56, 0xff, 0x22,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x97, 0xf8, + 0xed, 0x3c, 0x97, 0xf8, 0x74, 0xd5, 0x30, 0x9d, 0x3b, 0xad, 0xaa, 0x54, 0xb3, 0xea, 0xde, 0x5f, + 0x65, 0xde, 0xc7, 0x26, 0xd6, 0x3e, 0x97, 0x4f, 0xe9, 0xdf, 0x61, 0xd5, 0x49, 0x72, 0x07, 0xda, + 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x75, 0x15, 0x0d, 0x97, 0xa6, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3523,7 +3523,7 @@ func (m *MsgCreateGroup) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3533,25 +3533,23 @@ func (m *MsgCreateGroup) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4095,7 +4093,7 @@ func (m *MsgUpdateGroupMetadata) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4105,25 +4103,23 @@ func (m *MsgUpdateGroupMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4280,7 +4276,7 @@ func (m *MsgCreateGroupPolicy) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4290,25 +4286,23 @@ func (m *MsgCreateGroupPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -4694,7 +4688,7 @@ func (m *MsgCreateGroupWithPolicy) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GroupMetadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4704,31 +4698,29 @@ func (m *MsgCreateGroupWithPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GroupMetadata = append(m.GroupMetadata[:0], dAtA[iNdEx:postIndex]...) - if m.GroupMetadata == nil { - m.GroupMetadata = []byte{} - } + m.GroupMetadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyMetadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4738,25 +4730,23 @@ func (m *MsgCreateGroupWithPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GroupPolicyMetadata = append(m.GroupPolicyMetadata[:0], dAtA[iNdEx:postIndex]...) - if m.GroupPolicyMetadata == nil { - m.GroupPolicyMetadata = []byte{} - } + m.GroupPolicyMetadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -5283,7 +5273,7 @@ func (m *MsgUpdateGroupPolicyMetadata) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5293,25 +5283,23 @@ func (m *MsgUpdateGroupPolicyMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5481,7 +5469,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5491,25 +5479,23 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -5908,7 +5894,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5918,25 +5904,23 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { diff --git a/x/group/types.go b/x/group/types.go index 92800652f778..5f8b16004707 100644 --- a/x/group/types.go +++ b/x/group/types.go @@ -190,7 +190,7 @@ func (p PercentageDecisionPolicy) Allow(tally TallyResult, totalPower string, vo var _ orm.Validateable = GroupPolicyInfo{} // NewGroupPolicyInfo creates a new GroupPolicyInfo instance -func NewGroupPolicyInfo(address sdk.AccAddress, group uint64, admin sdk.AccAddress, metadata []byte, +func NewGroupPolicyInfo(address sdk.AccAddress, group uint64, admin sdk.AccAddress, metadata string, version uint64, decisionPolicy DecisionPolicy, createdAt time.Time) (GroupPolicyInfo, error) { p := GroupPolicyInfo{ Address: address.String(), diff --git a/x/group/types.pb.go b/x/group/types.pb.go index c7c2780863e3..3f2aff68c94a 100644 --- a/x/group/types.pb.go +++ b/x/group/types.pb.go @@ -4,7 +4,6 @@ package group import ( - bytes "bytes" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" @@ -192,7 +191,7 @@ type Member struct { // weight is the member's voting weight that should be greater than 0. Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` // metadata is any arbitrary metadata to attached to the member. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // added_at is a timestamp specifying when a member was added. AddedAt time.Time `protobuf:"bytes,4,opt,name=added_at,json=addedAt,proto3,stdtime" json:"added_at"` } @@ -244,11 +243,11 @@ func (m *Member) GetWeight() string { return "" } -func (m *Member) GetMetadata() []byte { +func (m *Member) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } func (m *Member) GetAddedAt() time.Time { @@ -423,7 +422,7 @@ type GroupInfo struct { // admin is the account address of the group's admin. Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` // metadata is any arbitrary metadata to attached to the group. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // version is used to track changes to a group's membership structure that // would break existing proposals. Whenever any members weight is changed, // or any member is added or removed this version is incremented and will @@ -482,11 +481,11 @@ func (m *GroupInfo) GetAdmin() string { return "" } -func (m *GroupInfo) GetMetadata() []byte { +func (m *GroupInfo) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } func (m *GroupInfo) GetVersion() uint64 { @@ -574,7 +573,7 @@ type GroupPolicyInfo struct { // admin is the account address of the group admin. Admin string `protobuf:"bytes,3,opt,name=admin,proto3" json:"admin,omitempty"` // metadata is any arbitrary metadata to attached to the group policy. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // version is used to track changes to a group's GroupPolicyInfo structure that // would create a different result on a running proposal. Version uint64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` @@ -627,7 +626,7 @@ type Proposal struct { // address is the account address of group policy. Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // metadata is any arbitrary metadata to attached to the proposal. - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // proposers are the account addresses of the proposers. Proposers []string `protobuf:"bytes,4,rep,name=proposers,proto3" json:"proposers,omitempty"` // submit_time is a timestamp specifying when a proposal was submitted. @@ -746,7 +745,7 @@ type Vote struct { // option is the voter's choice on the proposal. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.group.v1beta1.VoteOption" json:"option,omitempty"` // metadata is any arbitrary metadata to attached to the vote. - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // submit_time is the timestamp when the vote was submitted. SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` } @@ -805,11 +804,11 @@ func (m *Vote) GetOption() VoteOption { return VOTE_OPTION_UNSPECIFIED } -func (m *Vote) GetMetadata() []byte { +func (m *Vote) GetMetadata() string { if m != nil { return m.Metadata } - return nil + return "" } func (m *Vote) GetSubmitTime() time.Time { @@ -839,7 +838,7 @@ func init() { func init() { proto.RegisterFile("cosmos/group/v1beta1/types.proto", fileDescriptor_e091dfce5c49c8b6) } var fileDescriptor_e091dfce5c49c8b6 = []byte{ - // 1278 bytes of a gzipped FileDescriptorProto + // 1274 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, 0x14, 0xf7, 0x3a, 0x8e, 0xff, 0x3c, 0xa7, 0x8e, 0x35, 0x8d, 0xda, 0x4d, 0x1a, 0x6c, 0xd7, 0xe4, 0x10, 0x15, 0x6a, 0xb7, 0x01, 0x21, 0x54, 0x95, 0xa2, 0xb5, 0xb3, 0x2d, 0x46, 0xa9, 0x6d, 0x76, @@ -856,70 +855,70 @@ var fileDescriptor_e091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7a, 0x56, 0x5a, 0x8a, 0xd2, 0x5b, 0xd5, 0xaa, 0xaa, 0xeb, 0xd9, 0xe8, 0x52, 0xd4, 0x4d, 0xa5, + 0x76, 0xd0, 0xd2, 0xd4, 0x90, 0x7c, 0xe5, 0xc6, 0x93, 0xd3, 0x9c, 0xf4, 0xf4, 0x34, 0x27, 0xfd, + 0x75, 0x9a, 0x93, 0x1e, 0x3e, 0xcb, 0x45, 0x9e, 0x3e, 0xcb, 0x45, 0x7e, 0x7f, 0x96, 0x8b, 0xdc, + 0xd9, 0xe9, 0x3a, 0xf4, 0x78, 0xd8, 0x2e, 0x75, 0x48, 0x5f, 0x7c, 0x31, 0x88, 0x9f, 0xcb, 0xbe, + 0xfd, 0x55, 0xf9, 0x3e, 0xff, 0xb4, 0x69, 0xc7, 0xd9, 0x05, 0x78, 0xef, 0xdf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7b, 0x95, 0x5a, 0x6f, 0xf1, 0x0c, 0x00, 0x00, } func (this *GroupPolicyInfo) Equal(that interface{}) bool { @@ -950,7 +949,7 @@ func (this *GroupPolicyInfo) Equal(that interface{}) bool { if this.Admin != that1.Admin { return false } - if !bytes.Equal(this.Metadata, that1.Metadata) { + if this.Metadata != that1.Metadata { return false } if this.Version != that1.Version { @@ -1890,7 +1889,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1900,25 +1899,23 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -2372,7 +2369,7 @@ func (m *GroupInfo) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2382,25 +2379,23 @@ func (m *GroupInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -2728,7 +2723,7 @@ func (m *GroupPolicyInfo) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2738,25 +2733,23 @@ func (m *GroupPolicyInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -2951,7 +2944,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2961,25 +2954,23 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -3543,7 +3534,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -3553,25 +3544,23 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 {