From f3d6e44af14719d2e5d38d221550dc22ea310fda Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 25 Jul 2024 16:25:52 +0530 Subject: [PATCH 1/4] Add fields for role and kyc id to participant type --- api/cerc/onboarding/v1/onboarding.pulsar.go | 268 +++++++++++++++++--- api/cerc/onboarding/v1/tx.pulsar.go | 204 ++++++++++++--- proto/cerc/onboarding/v1/onboarding.proto | 24 ++ proto/cerc/onboarding/v1/tx.proto | 2 + x/onboarding/onboarding.pb.go | 179 +++++++++++-- x/onboarding/tx.pb.go | 138 ++++++++-- 6 files changed, 698 insertions(+), 117 deletions(-) diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go index f044479a..30d02d0a 100644 --- a/api/cerc/onboarding/v1/onboarding.pulsar.go +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -427,6 +427,8 @@ var ( md_Participant protoreflect.MessageDescriptor fd_Participant_cosmos_address protoreflect.FieldDescriptor fd_Participant_nitro_address protoreflect.FieldDescriptor + fd_Participant_role protoreflect.FieldDescriptor + fd_Participant_kyc_id protoreflect.FieldDescriptor ) func init() { @@ -434,6 +436,8 @@ func init() { md_Participant = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Participant") fd_Participant_cosmos_address = md_Participant.Fields().ByName("cosmos_address") fd_Participant_nitro_address = md_Participant.Fields().ByName("nitro_address") + fd_Participant_role = md_Participant.Fields().ByName("role") + fd_Participant_kyc_id = md_Participant.Fields().ByName("kyc_id") } var _ protoreflect.Message = (*fastReflection_Participant)(nil) @@ -513,6 +517,18 @@ func (x *fastReflection_Participant) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Role != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if !f(fd_Participant_role, value) { + return + } + } + if x.KycId != "" { + value := protoreflect.ValueOfString(x.KycId) + if !f(fd_Participant_kyc_id, value) { + return + } + } } // Has reports whether a field is populated. @@ -532,6 +548,10 @@ func (x *fastReflection_Participant) Has(fd protoreflect.FieldDescriptor) bool { return x.CosmosAddress != "" case "cerc.onboarding.v1.Participant.nitro_address": return x.NitroAddress != "" + case "cerc.onboarding.v1.Participant.role": + return x.Role != 0 + case "cerc.onboarding.v1.Participant.kyc_id": + return x.KycId != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -552,6 +572,10 @@ func (x *fastReflection_Participant) Clear(fd protoreflect.FieldDescriptor) { x.CosmosAddress = "" case "cerc.onboarding.v1.Participant.nitro_address": x.NitroAddress = "" + case "cerc.onboarding.v1.Participant.role": + x.Role = 0 + case "cerc.onboarding.v1.Participant.kyc_id": + x.KycId = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -574,6 +598,12 @@ func (x *fastReflection_Participant) Get(descriptor protoreflect.FieldDescriptor case "cerc.onboarding.v1.Participant.nitro_address": value := x.NitroAddress return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.Participant.role": + value := x.Role + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "cerc.onboarding.v1.Participant.kyc_id": + value := x.KycId + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -598,6 +628,10 @@ func (x *fastReflection_Participant) Set(fd protoreflect.FieldDescriptor, value x.CosmosAddress = value.Interface().(string) case "cerc.onboarding.v1.Participant.nitro_address": x.NitroAddress = value.Interface().(string) + case "cerc.onboarding.v1.Participant.role": + x.Role = (Role)(value.Enum()) + case "cerc.onboarding.v1.Participant.kyc_id": + x.KycId = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -622,6 +656,10 @@ func (x *fastReflection_Participant) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field cosmos_address of message cerc.onboarding.v1.Participant is not mutable")) case "cerc.onboarding.v1.Participant.nitro_address": panic(fmt.Errorf("field nitro_address of message cerc.onboarding.v1.Participant is not mutable")) + case "cerc.onboarding.v1.Participant.role": + panic(fmt.Errorf("field role of message cerc.onboarding.v1.Participant is not mutable")) + case "cerc.onboarding.v1.Participant.kyc_id": + panic(fmt.Errorf("field kyc_id of message cerc.onboarding.v1.Participant is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -639,6 +677,10 @@ func (x *fastReflection_Participant) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfString("") case "cerc.onboarding.v1.Participant.nitro_address": return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.Participant.role": + return protoreflect.ValueOfEnum(0) + case "cerc.onboarding.v1.Participant.kyc_id": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -716,6 +758,13 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Role != 0 { + n += 1 + runtime.Sov(uint64(x.Role)) + } + l = len(x.KycId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -745,6 +794,18 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.KycId) > 0 { + i -= len(x.KycId) + copy(dAtA[i:], x.KycId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KycId))) + i-- + dAtA[i] = 0x22 + } + if x.Role != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + i-- + dAtA[i] = 0x18 + } if len(x.NitroAddress) > 0 { i -= len(x.NitroAddress) copy(dAtA[i:], x.NitroAddress) @@ -872,6 +933,57 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { } x.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + x.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Role |= Role(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.KycId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1404,6 +1516,59 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Participant Role +type Role int32 + +const ( + // ROLE_UNSPECIFIED indicates unknown role. + Role_ROLE_UNSPECIFIED Role = 0 + // ROLE_PARTICIPANT indicates the participant role. + Role_ROLE_PARTICIPANT Role = 1 + // ROLE_VALIDATOR indicates user participating as a validator. + Role_ROLE_VALIDATOR Role = 2 +) + +// Enum value maps for Role. +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "ROLE_PARTICIPANT", + 2: "ROLE_VALIDATOR", + } + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "ROLE_PARTICIPANT": 1, + "ROLE_VALIDATOR": 2, + } +) + +func (x Role) Enum() *Role { + p := new(Role) + *p = x + return p +} + +func (x Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Role) Descriptor() protoreflect.EnumDescriptor { + return file_cerc_onboarding_v1_onboarding_proto_enumTypes[0].Descriptor() +} + +func (Role) Type() protoreflect.EnumType { + return &file_cerc_onboarding_v1_onboarding_proto_enumTypes[0] +} + +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Role.Descriptor instead. +func (Role) EnumDescriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{0} +} + // Params defines the parameters of the onboarding module. type Params struct { state protoimpl.MessageState @@ -1447,8 +1612,14 @@ type Participant struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // participant's cosmos (laconic) address CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"` - NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"` + // participant's Nitro address + NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"` + // participant's role (participant | validator) + Role Role `protobuf:"varint,3,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + // participant's KYC receipt ID + KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } func (x *Participant) Reset() { @@ -1485,6 +1656,20 @@ func (x *Participant) GetNitroAddress() string { return "" } +func (x *Participant) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + +func (x *Participant) GetKycId() string { + if x != nil { + return x.KycId + } + return "" +} + // EthPayload defines the payload that is signed by the ethereum private key type EthPayload struct { state protoimpl.MessageState @@ -1544,7 +1729,7 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x6c, 0x65, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x52, 0x11, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x22, 0xb9, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x64, 0x22, 0xbc, 0x02, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x56, 0x0a, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xf2, 0xde, 0x1f, 0x2b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, @@ -1555,29 +1740,42 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x42, 0x2d, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, - 0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x76, 0x0a, - 0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xf2, 0xde, - 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, - 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0xd4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, + 0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, - 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, - 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, - 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, - 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, - 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x6f, 0x6c, + 0x65, 0x22, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6b, 0x79, 0x63, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, + 0x22, 0x76, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, + 0x73, 0x67, 0x22, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x2a, 0x4c, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, + 0x41, 0x52, 0x54, 0x49, 0x43, 0x49, 0x50, 0x41, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, + 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x02, + 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xd4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, + 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, + 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, + 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, + 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1592,18 +1790,21 @@ func file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP() []byte { return file_cerc_onboarding_v1_onboarding_proto_rawDescData } +var file_cerc_onboarding_v1_onboarding_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_cerc_onboarding_v1_onboarding_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cerc_onboarding_v1_onboarding_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: cerc.onboarding.v1.Params - (*Participant)(nil), // 1: cerc.onboarding.v1.Participant - (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload + (Role)(0), // 0: cerc.onboarding.v1.Role + (*Params)(nil), // 1: cerc.onboarding.v1.Params + (*Participant)(nil), // 2: cerc.onboarding.v1.Participant + (*EthPayload)(nil), // 3: cerc.onboarding.v1.EthPayload } var file_cerc_onboarding_v1_onboarding_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: cerc.onboarding.v1.Participant.role:type_name -> cerc.onboarding.v1.Role + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_onboarding_proto_init() } @@ -1654,13 +1855,14 @@ func file_cerc_onboarding_v1_onboarding_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_onboarding_v1_onboarding_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, GoTypes: file_cerc_onboarding_v1_onboarding_proto_goTypes, DependencyIndexes: file_cerc_onboarding_v1_onboarding_proto_depIdxs, + EnumInfos: file_cerc_onboarding_v1_onboarding_proto_enumTypes, MessageInfos: file_cerc_onboarding_v1_onboarding_proto_msgTypes, }.Build() File_cerc_onboarding_v1_onboarding_proto = out.File diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go index 0865e896..aff1ff44 100644 --- a/api/cerc/onboarding/v1/tx.pulsar.go +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -20,6 +20,8 @@ var ( fd_MsgOnboardParticipant_participant protoreflect.FieldDescriptor fd_MsgOnboardParticipant_eth_payload protoreflect.FieldDescriptor fd_MsgOnboardParticipant_eth_signature protoreflect.FieldDescriptor + fd_MsgOnboardParticipant_role protoreflect.FieldDescriptor + fd_MsgOnboardParticipant_kyc_id protoreflect.FieldDescriptor ) func init() { @@ -28,6 +30,8 @@ func init() { fd_MsgOnboardParticipant_participant = md_MsgOnboardParticipant.Fields().ByName("participant") fd_MsgOnboardParticipant_eth_payload = md_MsgOnboardParticipant.Fields().ByName("eth_payload") fd_MsgOnboardParticipant_eth_signature = md_MsgOnboardParticipant.Fields().ByName("eth_signature") + fd_MsgOnboardParticipant_role = md_MsgOnboardParticipant.Fields().ByName("role") + fd_MsgOnboardParticipant_kyc_id = md_MsgOnboardParticipant.Fields().ByName("kyc_id") } var _ protoreflect.Message = (*fastReflection_MsgOnboardParticipant)(nil) @@ -113,6 +117,18 @@ func (x *fastReflection_MsgOnboardParticipant) Range(f func(protoreflect.FieldDe return } } + if x.Role != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if !f(fd_MsgOnboardParticipant_role, value) { + return + } + } + if x.KycId != "" { + value := protoreflect.ValueOfString(x.KycId) + if !f(fd_MsgOnboardParticipant_kyc_id, value) { + return + } + } } // Has reports whether a field is populated. @@ -134,6 +150,10 @@ func (x *fastReflection_MsgOnboardParticipant) Has(fd protoreflect.FieldDescript return x.EthPayload != nil case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": return x.EthSignature != "" + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + return x.Role != 0 + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + return x.KycId != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -156,6 +176,10 @@ func (x *fastReflection_MsgOnboardParticipant) Clear(fd protoreflect.FieldDescri x.EthPayload = nil case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": x.EthSignature = "" + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + x.Role = 0 + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + x.KycId = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -181,6 +205,12 @@ func (x *fastReflection_MsgOnboardParticipant) Get(descriptor protoreflect.Field case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": value := x.EthSignature return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + value := x.Role + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + value := x.KycId + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -207,6 +237,10 @@ func (x *fastReflection_MsgOnboardParticipant) Set(fd protoreflect.FieldDescript x.EthPayload = value.Message().Interface().(*EthPayload) case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": x.EthSignature = value.Interface().(string) + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + x.Role = (Role)(value.Enum()) + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + x.KycId = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -236,6 +270,10 @@ func (x *fastReflection_MsgOnboardParticipant) Mutable(fd protoreflect.FieldDesc panic(fmt.Errorf("field participant of message cerc.onboarding.v1.MsgOnboardParticipant is not mutable")) case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": panic(fmt.Errorf("field eth_signature of message cerc.onboarding.v1.MsgOnboardParticipant is not mutable")) + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + panic(fmt.Errorf("field role of message cerc.onboarding.v1.MsgOnboardParticipant is not mutable")) + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + panic(fmt.Errorf("field kyc_id of message cerc.onboarding.v1.MsgOnboardParticipant is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -256,6 +294,10 @@ func (x *fastReflection_MsgOnboardParticipant) NewField(fd protoreflect.FieldDes return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.MsgOnboardParticipant.role": + return protoreflect.ValueOfEnum(0) + case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -337,6 +379,13 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Role != 0 { + n += 1 + runtime.Sov(uint64(x.Role)) + } + l = len(x.KycId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -366,6 +415,18 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.KycId) > 0 { + i -= len(x.KycId) + copy(dAtA[i:], x.KycId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KycId))) + i-- + dAtA[i] = 0x2a + } + if x.Role != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + i-- + dAtA[i] = 0x20 + } if len(x.EthSignature) > 0 { i -= len(x.EthSignature) copy(dAtA[i:], x.EthSignature) @@ -543,6 +604,57 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method } x.EthSignature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + x.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Role |= Role(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.KycId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -957,6 +1069,8 @@ type MsgOnboardParticipant struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` EthPayload *EthPayload `protobuf:"bytes,2,opt,name=eth_payload,json=ethPayload,proto3" json:"eth_payload,omitempty"` EthSignature string `protobuf:"bytes,3,opt,name=eth_signature,json=ethSignature,proto3" json:"eth_signature,omitempty"` + Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + KycId string `protobuf:"bytes,5,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } func (x *MsgOnboardParticipant) Reset() { @@ -1000,6 +1114,20 @@ func (x *MsgOnboardParticipant) GetEthSignature() string { return "" } +func (x *MsgOnboardParticipant) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + +func (x *MsgOnboardParticipant) GetKycId() string { + if x != nil { + return x.KycId + } + return "" +} + // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response // type. type MsgOnboardParticipantResponse struct { @@ -1041,7 +1169,7 @@ var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, @@ -1051,35 +1179,39 @@ var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x74, 0x68, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, - 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x10, 0x82, 0xe7, 0xb0, - 0x2a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x1f, 0x0a, - 0x1d, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb2, - 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0xa3, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x29, 0x2e, + 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, + 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x79, 0x63, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, + 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0xb2, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0xa3, 0x01, 0x0a, 0x12, + 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, - 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x29, 0x22, 0x27, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, - 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, - 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, - 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, - 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, - 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, - 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, - 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, - 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x27, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, + 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, + 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, + 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, + 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, + 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1099,16 +1231,18 @@ var file_cerc_onboarding_v1_tx_proto_goTypes = []interface{}{ (*MsgOnboardParticipant)(nil), // 0: cerc.onboarding.v1.MsgOnboardParticipant (*MsgOnboardParticipantResponse)(nil), // 1: cerc.onboarding.v1.MsgOnboardParticipantResponse (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload + (Role)(0), // 3: cerc.onboarding.v1.Role } var file_cerc_onboarding_v1_tx_proto_depIdxs = []int32{ 2, // 0: cerc.onboarding.v1.MsgOnboardParticipant.eth_payload:type_name -> cerc.onboarding.v1.EthPayload - 0, // 1: cerc.onboarding.v1.Msg.OnboardParticipant:input_type -> cerc.onboarding.v1.MsgOnboardParticipant - 1, // 2: cerc.onboarding.v1.Msg.OnboardParticipant:output_type -> cerc.onboarding.v1.MsgOnboardParticipantResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 3, // 1: cerc.onboarding.v1.MsgOnboardParticipant.role:type_name -> cerc.onboarding.v1.Role + 0, // 2: cerc.onboarding.v1.Msg.OnboardParticipant:input_type -> cerc.onboarding.v1.MsgOnboardParticipant + 1, // 3: cerc.onboarding.v1.Msg.OnboardParticipant:output_type -> cerc.onboarding.v1.MsgOnboardParticipantResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_tx_proto_init() } diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index 38ca1f4c..494ab0c7 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -16,14 +16,24 @@ message Params { // Participant defines the data that will be stored for each enrolled // participant message Participant { + // participant's cosmos (laconic) address string cosmos_address = 1 [ (gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\"" ]; + // participant's Nitro address string nitro_address = 2 [ (gogoproto.moretags) = "json:\"nitro_address\" yaml:\"nitro_address\"" ]; + + // participant's role (participant | validator) + Role role = 3 [ (gogoproto.moretags) = "json:\"role\" yaml:\"role\"" ]; + + // participant's KYC receipt ID + string kyc_id = 4 + [ (gogoproto.moretags) = "json:\"kyc_id\" yaml:\"kyc_id\"" ]; } + // EthPayload defines the payload that is signed by the ethereum private key message EthPayload { string address = 1 @@ -31,3 +41,17 @@ message EthPayload { string msg = 2 [ (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" ]; } + +// Participant Role +enum Role { + option (gogoproto.goproto_enum_prefix) = false; + + // ROLE_UNSPECIFIED indicates unknown role. + ROLE_UNSPECIFIED = 0; + + // ROLE_PARTICIPANT indicates the participant role. + ROLE_PARTICIPANT = 1; + + // ROLE_VALIDATOR indicates user participating as a validator. + ROLE_VALIDATOR = 2; +} diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto index 2c21614d..c0e7b6d7 100644 --- a/proto/cerc/onboarding/v1/tx.proto +++ b/proto/cerc/onboarding/v1/tx.proto @@ -28,6 +28,8 @@ message MsgOnboardParticipant { string participant = 1; EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ]; string eth_signature = 3; + Role role = 4; + string kyc_id = 5; } // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go index 56c781cb..f429f30c 100644 --- a/x/onboarding/onboarding.pb.go +++ b/x/onboarding/onboarding.pb.go @@ -23,6 +23,38 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Participant Role +type Role int32 + +const ( + // ROLE_UNSPECIFIED indicates unknown role. + ROLE_UNSPECIFIED Role = 0 + // ROLE_PARTICIPANT indicates the participant role. + ROLE_PARTICIPANT Role = 1 + // ROLE_VALIDATOR indicates user participating as a validator. + ROLE_VALIDATOR Role = 2 +) + +var Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "ROLE_PARTICIPANT", + 2: "ROLE_VALIDATOR", +} + +var Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "ROLE_PARTICIPANT": 1, + "ROLE_VALIDATOR": 2, +} + +func (x Role) String() string { + return proto.EnumName(Role_name, int32(x)) +} + +func (Role) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_59afed779274eaf0, []int{0} +} + // Params defines the parameters of the onboarding module. type Params struct { OnboardingEnabled bool `protobuf:"varint,1,opt,name=onboarding_enabled,json=onboardingEnabled,proto3" json:"onboarding_enabled,omitempty" json:"onboarding_enabled" yaml:"onboarding_enabled"` @@ -71,8 +103,14 @@ func (m *Params) GetOnboardingEnabled() bool { // Participant defines the data that will be stored for each enrolled // participant type Participant struct { + // participant's cosmos (laconic) address CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty" json:"cosmos_address" yaml:"cosmos_address"` - NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty" json:"nitro_address" yaml:"nitro_address"` + // participant's Nitro address + NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty" json:"nitro_address" yaml:"nitro_address"` + // participant's role (participant | validator) + Role Role `protobuf:"varint,3,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty" json:"role" yaml:"role"` + // participant's KYC receipt ID + KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty" json:"kyc_id" yaml:"kyc_id"` } func (m *Participant) Reset() { *m = Participant{} } @@ -122,6 +160,20 @@ func (m *Participant) GetNitroAddress() string { return "" } +func (m *Participant) GetRole() Role { + if m != nil { + return m.Role + } + return ROLE_UNSPECIFIED +} + +func (m *Participant) GetKycId() string { + if m != nil { + return m.KycId + } + return "" +} + // EthPayload defines the payload that is signed by the ethereum private key type EthPayload struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" json:"address" yaml:"address"` @@ -176,6 +228,7 @@ func (m *EthPayload) GetMsg() string { } func init() { + proto.RegisterEnum("cerc.onboarding.v1.Role", Role_name, Role_value) proto.RegisterType((*Params)(nil), "cerc.onboarding.v1.Params") proto.RegisterType((*Participant)(nil), "cerc.onboarding.v1.Participant") proto.RegisterType((*EthPayload)(nil), "cerc.onboarding.v1.EthPayload") @@ -186,29 +239,37 @@ func init() { } var fileDescriptor_59afed779274eaf0 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4a, 0xc3, 0x30, - 0x1c, 0xc7, 0x57, 0x85, 0xa9, 0xd1, 0x09, 0x06, 0x05, 0x15, 0x6c, 0x67, 0xbd, 0x4c, 0xc6, 0x5a, - 0xc6, 0x0e, 0x82, 0x9e, 0x2c, 0xec, 0x3e, 0x7a, 0xf0, 0xe0, 0x65, 0xa4, 0x7f, 0xac, 0x91, 0x36, - 0xbf, 0x91, 0x84, 0xe2, 0xde, 0xc2, 0xd7, 0xf1, 0x0d, 0x3c, 0xee, 0xe8, 0xa9, 0xc8, 0xf6, 0x06, - 0x7d, 0x02, 0x69, 0xb3, 0x6e, 0xeb, 0xf4, 0x96, 0xdf, 0xf7, 0xcf, 0xe7, 0x17, 0x48, 0xd0, 0x8d, - 0x1f, 0x72, 0xdf, 0x06, 0xe6, 0x01, 0xe1, 0x01, 0x65, 0x91, 0x9d, 0xf6, 0x37, 0x26, 0x6b, 0xc2, - 0x41, 0x02, 0xc6, 0x45, 0xc8, 0xda, 0x90, 0xd3, 0xfe, 0xe5, 0x69, 0x04, 0x11, 0x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85, 0xde, 0x98, 0x2d, 0xf4, 0xc6, 0xf7, 0x42, 0x6f, 0x3c, 0x77, 0x22, 0x2a, - 0xad, 0x34, 0xf0, 0x2c, 0x09, 0x76, 0xf1, 0xe8, 0x3d, 0x0a, 0x76, 0x4c, 0x7c, 0x60, 0xd4, 0x0f, - 0xec, 0xf7, 0x8d, 0x9f, 0xe1, 0x35, 0xcb, 0x07, 0x1f, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0x91, - 0x47, 0xeb, 0x34, 0x41, 0x02, 0x00, 0x00, + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xed, 0x34, 0x04, 0x58, 0x68, 0x14, 0x56, 0x45, 0x84, 0x56, 0xd8, 0x21, 0x5c, 0x02, + 0x55, 0x6d, 0x95, 0x4a, 0x20, 0xc1, 0xc9, 0x6e, 0x8d, 0x64, 0x29, 0x6a, 0xad, 0x25, 0xf4, 0xc0, + 0x25, 0xda, 0x78, 0x8d, 0x31, 0xb5, 0x3d, 0x91, 0x6d, 0x45, 0xe4, 0x0d, 0x38, 0xf2, 0x0e, 0xbc, + 0x06, 0x0f, 0xc0, 0xb1, 0x47, 0x4e, 0x16, 0x4a, 0xde, 0xc0, 0x4f, 0x80, 0xbc, 0x1b, 0xa7, 0x71, + 0xdb, 0xdb, 0xcc, 0x37, 0xf3, 0xff, 0xb3, 0x33, 0x5a, 0xf4, 0xc2, 0xf5, 0x12, 0x57, 0x87, 0x78, + 0x02, 0x34, 0x61, 0x41, 0xec, 0xeb, 0xb3, 0xc3, 0x8d, 0x4c, 0x9b, 0x26, 0x90, 0x01, 0xc6, 0x65, + 0x93, 0xb6, 0x81, 0x67, 0x87, 0xbb, 0x3b, 0x3e, 0xf8, 0xc0, 0xcb, 0x7a, 0x19, 0x89, 0xce, 0xfe, + 0x14, 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56, 0xf6, 0xd5, 0xa1, 0xf3, 0x10, 0x28, 0xc3, 0xef, 0xd1, + 0xdd, 0xfa, 0xd5, 0x9e, 0x17, 0xb9, 0xfa, 0x4c, 0xd8, 0x5c, 0x5b, 0x6c, 0xbd, 0x52, 0xa5, 0xc0, + 0xfb, 0x68, 0x2b, 0x4a, 0xfd, 0xd5, 0x5d, 0x9e, 0x16, 0xb9, 0xfa, 0x58, 0x08, 0xa3, 0xd4, 0xaf, + 0x44, 0x65, 0x48, 0xca, 0xae, 0x57, 0x43, 0xd4, 0x2c, 0x57, 0xc3, 0x3b, 0xa8, 0x43, 0xce, 0x86, + 0xd6, 0xf8, 0xd3, 0xe9, 0x47, 0xc7, 0x3a, 0xb6, 0x3f, 0xd8, 0xd6, 0x49, 0x47, 0x5a, 0x53, 0xc7, + 0x20, 0x23, 0xfb, 0xd8, 0x76, 0x8c, 0xd3, 0x51, 0x47, 0xc6, 0x18, 0xb5, 0x39, 0x3d, 0x37, 0x86, + 0xf6, 0x89, 0x31, 0x3a, 0x23, 0x9d, 0xc6, 0x6e, 0xf3, 0xc7, 0x2f, 0x45, 0x32, 0xcd, 0x3f, 0x0b, + 0x45, 0xbe, 0x5c, 0x28, 0xf2, 0xbf, 0x85, 0x22, 0xff, 0x5c, 0x2a, 0xd2, 0xe5, 0x52, 0x91, 0xfe, + 0x2e, 0x15, 0xe9, 0xf3, 0xc0, 0x0f, 0x32, 0x6d, 0xc6, 0x26, 0x5a, 0x06, 0x7a, 0x79, 0xde, 0x83, + 0x00, 0xf4, 0x90, 0xba, 0x10, 0x07, 0x2e, 0xd3, 0xbf, 0x6f, 0x7c, 0xf5, 0x49, 0x8b, 0xff, 0xe0, + 0xa3, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xaf, 0x40, 0xe4, 0x12, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -264,6 +325,18 @@ func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.KycId) > 0 { + i -= len(m.KycId) + copy(dAtA[i:], m.KycId) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.KycId))) + i-- + dAtA[i] = 0x22 + } + if m.Role != 0 { + i = encodeVarintOnboarding(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x18 + } if len(m.NitroAddress) > 0 { i -= len(m.NitroAddress) copy(dAtA[i:], m.NitroAddress) @@ -355,6 +428,13 @@ func (m *Participant) Size() (n int) { if l > 0 { n += 1 + l + sovOnboarding(uint64(l)) } + if m.Role != 0 { + n += 1 + sovOnboarding(uint64(m.Role)) + } + l = len(m.KycId) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) + } return n } @@ -544,6 +624,57 @@ func (m *Participant) Unmarshal(dAtA []byte) error { } m.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + m.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnboarding + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Role |= Role(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnboarding + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnboarding + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnboarding + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KycId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOnboarding(dAtA[iNdEx:]) diff --git a/x/onboarding/tx.pb.go b/x/onboarding/tx.pb.go index 8623b644..fe1ff267 100644 --- a/x/onboarding/tx.pb.go +++ b/x/onboarding/tx.pb.go @@ -36,6 +36,8 @@ type MsgOnboardParticipant struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` EthPayload EthPayload `protobuf:"bytes,2,opt,name=eth_payload,json=ethPayload,proto3" json:"eth_payload"` EthSignature string `protobuf:"bytes,3,opt,name=eth_signature,json=ethSignature,proto3" json:"eth_signature,omitempty"` + Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + KycId string `protobuf:"bytes,5,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } func (m *MsgOnboardParticipant) Reset() { *m = MsgOnboardParticipant{} } @@ -92,6 +94,20 @@ func (m *MsgOnboardParticipant) GetEthSignature() string { return "" } +func (m *MsgOnboardParticipant) GetRole() Role { + if m != nil { + return m.Role + } + return ROLE_UNSPECIFIED +} + +func (m *MsgOnboardParticipant) GetKycId() string { + if m != nil { + return m.KycId + } + return "" +} + // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response // type. type MsgOnboardParticipantResponse struct { @@ -138,31 +154,33 @@ func init() { func init() { proto.RegisterFile("cerc/onboarding/v1/tx.proto", fileDescriptor_6bfde34a550e231e) } var fileDescriptor_6bfde34a550e231e = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0x32, 0x41, - 0x18, 0xc7, 0x77, 0xf4, 0x7d, 0x5f, 0x78, 0xc7, 0x82, 0x58, 0x8a, 0x64, 0xab, 0x55, 0xd6, 0x43, - 0x2a, 0xb4, 0x83, 0x76, 0xeb, 0x28, 0x78, 0x94, 0xc4, 0x6e, 0x5d, 0x64, 0xdc, 0x1d, 0xc6, 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x97, 0x31, 0x4a, 0x70, 0x49, 0xf5, 0x4d, 0xc8, 0xb2, 0xe9, 0x08, - 0xb5, 0xc3, 0x74, 0xf7, 0x6a, 0xa3, 0x5d, 0xec, 0x8d, 0x16, 0xe3, 0x72, 0x9c, 0xee, 0xe4, 0xf0, - 0x49, 0xe2, 0xe2, 0x2d, 0xa6, 0x02, 0x90, 0x8a, 0x55, 0x9f, 0x10, 0x4e, 0x37, 0x14, 0x37, 0x1f, - 0x11, 0x36, 0x13, 0xfa, 0x95, 0x92, 0x16, 0x4d, 0x4c, 0xb4, 0x2a, 0xbf, 0xb6, 0x6e, 0xe0, 0x0e, - 0x19, 0xbd, 0x7c, 0x3c, 0xa4, 0x4a, 0xce, 0x29, 0xf9, 0xf9, 0x0a, 0xed, 0x58, 0x1d, 0xeb, 0xef, - 0xdd, 0x62, 0x5c, 0x46, 0xb5, 0xda, 0x64, 0x66, 0xa3, 0xe9, 0xcc, 0x46, 0xef, 0x33, 0x1b, 0xdd, - 0xcf, 0x6d, 0x63, 0x3a, 0xb7, 0x8d, 0xd7, 0xb9, 0x6d, 0x5c, 0x17, 0xb9, 0xd0, 0xee, 0xc0, 0xef, - 0xb8, 0x1a, 0xa2, 0xcc, 0x33, 0x01, 0xa4, 0x47, 0x3d, 0x90, 0xc2, 0xf3, 0xc9, 0x30, 0x46, 0xe8, - 0xfc, 0x8b, 0x4e, 0x7b, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x28, 0x7c, 0x8d, 0x55, 0x7f, 0x02, - 0x00, 0x00, + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x8a, 0xd3, 0x40, + 0x1c, 0xc6, 0x33, 0xbb, 0xed, 0x82, 0x53, 0x15, 0x19, 0x5c, 0x0c, 0x51, 0xb3, 0x21, 0x7b, 0x30, + 0xbb, 0x68, 0x86, 0xd6, 0x9b, 0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, 0xff, 0xff, 0xf4, 0x5a, 0xe1, 0xc6, 0xc4, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -267,6 +285,18 @@ func (m *MsgOnboardParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.KycId) > 0 { + i -= len(m.KycId) + copy(dAtA[i:], m.KycId) + i = encodeVarintTx(dAtA, i, uint64(len(m.KycId))) + i-- + dAtA[i] = 0x2a + } + if m.Role != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x20 + } if len(m.EthSignature) > 0 { i -= len(m.EthSignature) copy(dAtA[i:], m.EthSignature) @@ -344,6 +374,13 @@ func (m *MsgOnboardParticipant) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.Role != 0 { + n += 1 + sovTx(uint64(m.Role)) + } + l = len(m.KycId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -488,6 +525,57 @@ func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error { } m.EthSignature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + m.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Role |= Role(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KycId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) -- 2.45.2 From 9bc09b92591a1f3e4049dcca8f014e7a32939ffa Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 25 Jul 2024 16:34:40 +0530 Subject: [PATCH 2/4] Update keeper to onboard a participant --- x/onboarding/keeper/keeper.go | 2 ++ x/onboarding/module/autocli.go | 4 +++- x/onboarding/msgs.go | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index f86edf81..0f7be5b0 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -100,6 +100,8 @@ func (k Keeper) OnboardParticipant( participant := &onboardingTypes.Participant{ CosmosAddress: signerAddress.String(), NitroAddress: nitroAddress, + Role: msg.Role, + KycId: msg.KycId, } if err := k.StoreParticipant(ctx, participant); err != nil { diff --git a/x/onboarding/module/autocli.go b/x/onboarding/module/autocli.go index 29a651e0..f076dcfb 100644 --- a/x/onboarding/module/autocli.go +++ b/x/onboarding/module/autocli.go @@ -26,11 +26,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "OnboardParticipant", - Use: "enroll", + Use: "enroll [eth_payload] [eth_signature] [role] [kyc_id]", Short: "Enroll a testnet validator", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "eth_payload"}, {ProtoField: "eth_signature"}, + {ProtoField: "role"}, + {ProtoField: "kyc_id"}, }, }, }, diff --git a/x/onboarding/msgs.go b/x/onboarding/msgs.go index b6996b6f..75574f4a 100644 --- a/x/onboarding/msgs.go +++ b/x/onboarding/msgs.go @@ -18,7 +18,15 @@ func (msg MsgOnboardParticipant) ValidateBasic() error { } if len(msg.EthSignature) != 132 { - return errorsmod.Wrap(sdkerrors.ErrNoSignatures, "Invalid signature.") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid signature.") + } + + if msg.Role == ROLE_UNSPECIFIED { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Participant role not specified.") + } + + if len(msg.KycId) == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Empty KYC ID.") } return nil -- 2.45.2 From 34e56fa5feb761242a8d998ec78d6fa80a53de18 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 25 Jul 2024 17:16:36 +0530 Subject: [PATCH 3/4] Update GQL API --- gql/cerc-io/laconicd/schema.graphql | 2 + gql/generated.go | 122 ++++++++++++++++++++++++++++ gql/models_gen.go | 2 + gql/resolver.go | 2 + 4 files changed, 128 insertions(+) diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index 8bd8dd17..0e132745 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -33,6 +33,8 @@ type Account { type Participant { cosmosAddress: String! # Cosmos address of the participant who will be registered. nitroAddress: String! # Nitro addresss of the participant who will be registered. + role: Int! # Participant's role + kycId: String! # Participant's KYC receipt ID } # Value describes a DAG-JSON compatible value. diff --git a/gql/generated.go b/gql/generated.go index b7b2ed17..bc9f5a20 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -155,7 +155,9 @@ type ComplexityRoot struct { Participant struct { CosmosAddress func(childComplexity int) int + KycID func(childComplexity int) int NitroAddress func(childComplexity int) int + Role func(childComplexity int) int } PeerInfo struct { @@ -648,6 +650,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Participant.CosmosAddress(childComplexity), true + case "Participant.kycId": + if e.complexity.Participant.KycID == nil { + break + } + + return e.complexity.Participant.KycID(childComplexity), true + case "Participant.nitroAddress": if e.complexity.Participant.NitroAddress == nil { break @@ -655,6 +664,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Participant.NitroAddress(childComplexity), true + case "Participant.role": + if e.complexity.Participant.Role == nil { + break + } + + return e.complexity.Participant.Role(childComplexity), true + case "PeerInfo.isOutbound": if e.complexity.PeerInfo.IsOutbound == nil { break @@ -3924,6 +3940,94 @@ func (ec *executionContext) fieldContext_Participant_nitroAddress(ctx context.Co return fc, nil } +func (ec *executionContext) _Participant_role(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_role(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Role, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Participant_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Participant", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Participant_kycId(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_kycId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KycID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Participant_kycId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Participant", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _PeerInfo_node(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { fc, err := ec.fieldContext_PeerInfo_node(ctx, field) if err != nil { @@ -4836,6 +4940,10 @@ func (ec *executionContext) fieldContext_Query_getParticipants(ctx context.Conte return ec.fieldContext_Participant_cosmosAddress(ctx, field) case "nitroAddress": return ec.fieldContext_Participant_nitroAddress(ctx, field) + case "role": + return ec.fieldContext_Participant_role(ctx, field) + case "kycId": + return ec.fieldContext_Participant_kycId(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name) }, @@ -8798,6 +8906,20 @@ func (ec *executionContext) _Participant(ctx context.Context, sel ast.SelectionS out.Values[i] = ec._Participant_nitroAddress(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "role": + + out.Values[i] = ec._Participant_role(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kycId": + + out.Values[i] = ec._Participant_kycId(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } diff --git a/gql/models_gen.go b/gql/models_gen.go index 8584ba62..aedaedfd 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -138,6 +138,8 @@ type OwnerBonds struct { type Participant struct { CosmosAddress string `json:"cosmosAddress"` NitroAddress string `json:"nitroAddress"` + Role int `json:"role"` + KycID string `json:"kycId"` } type PeerInfo struct { diff --git a/gql/resolver.go b/gql/resolver.go index 5538e6d7..b5c264ef 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -373,6 +373,8 @@ func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, err participants[i] = &Participant{ CosmosAddress: p.CosmosAddress, NitroAddress: p.NitroAddress, + Role: int(p.GetRole()), + KycID: p.KycId, } } -- 2.45.2 From 34c1297fda9d9b830e3e57a753945edc84fb2708 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 26 Jul 2024 15:57:30 +0530 Subject: [PATCH 4/4] Use string type for role field --- api/cerc/onboarding/v1/onboarding.pulsar.go | 194 ++++++++------------ api/cerc/onboarding/v1/tx.pulsar.go | 135 ++++++++------ gql/cerc-io/laconicd/schema.graphql | 2 +- gql/generated.go | 6 +- gql/models_gen.go | 2 +- gql/resolver.go | 2 +- proto/cerc/onboarding/v1/onboarding.proto | 16 +- proto/cerc/onboarding/v1/tx.proto | 2 +- x/onboarding/msgs.go | 20 +- x/onboarding/onboarding.pb.go | 128 ++++++------- x/onboarding/tx.pb.go | 92 ++++++---- 11 files changed, 278 insertions(+), 321 deletions(-) diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go index 30d02d0a..692bdaf6 100644 --- a/api/cerc/onboarding/v1/onboarding.pulsar.go +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -517,8 +517,8 @@ func (x *fastReflection_Participant) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Role != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if x.Role != "" { + value := protoreflect.ValueOfString(x.Role) if !f(fd_Participant_role, value) { return } @@ -549,7 +549,7 @@ func (x *fastReflection_Participant) Has(fd protoreflect.FieldDescriptor) bool { case "cerc.onboarding.v1.Participant.nitro_address": return x.NitroAddress != "" case "cerc.onboarding.v1.Participant.role": - return x.Role != 0 + return x.Role != "" case "cerc.onboarding.v1.Participant.kyc_id": return x.KycId != "" default: @@ -573,7 +573,7 @@ func (x *fastReflection_Participant) Clear(fd protoreflect.FieldDescriptor) { case "cerc.onboarding.v1.Participant.nitro_address": x.NitroAddress = "" case "cerc.onboarding.v1.Participant.role": - x.Role = 0 + x.Role = "" case "cerc.onboarding.v1.Participant.kyc_id": x.KycId = "" default: @@ -600,7 +600,7 @@ func (x *fastReflection_Participant) Get(descriptor protoreflect.FieldDescriptor return protoreflect.ValueOfString(value) case "cerc.onboarding.v1.Participant.role": value := x.Role - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "cerc.onboarding.v1.Participant.kyc_id": value := x.KycId return protoreflect.ValueOfString(value) @@ -629,7 +629,7 @@ func (x *fastReflection_Participant) Set(fd protoreflect.FieldDescriptor, value case "cerc.onboarding.v1.Participant.nitro_address": x.NitroAddress = value.Interface().(string) case "cerc.onboarding.v1.Participant.role": - x.Role = (Role)(value.Enum()) + x.Role = value.Interface().(string) case "cerc.onboarding.v1.Participant.kyc_id": x.KycId = value.Interface().(string) default: @@ -678,7 +678,7 @@ func (x *fastReflection_Participant) NewField(fd protoreflect.FieldDescriptor) p case "cerc.onboarding.v1.Participant.nitro_address": return protoreflect.ValueOfString("") case "cerc.onboarding.v1.Participant.role": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "cerc.onboarding.v1.Participant.kyc_id": return protoreflect.ValueOfString("") default: @@ -758,8 +758,9 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Role != 0 { - n += 1 + runtime.Sov(uint64(x.Role)) + l = len(x.Role) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.KycId) if l > 0 { @@ -801,10 +802,12 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if x.Role != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + if len(x.Role) > 0 { + i -= len(x.Role) + copy(dAtA[i:], x.Role) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(x.NitroAddress) > 0 { i -= len(x.NitroAddress) @@ -934,10 +937,10 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { x.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - x.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -947,11 +950,24 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Role |= Role(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Role = 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 KycId", wireType) @@ -1516,59 +1532,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Participant Role -type Role int32 - -const ( - // ROLE_UNSPECIFIED indicates unknown role. - Role_ROLE_UNSPECIFIED Role = 0 - // ROLE_PARTICIPANT indicates the participant role. - Role_ROLE_PARTICIPANT Role = 1 - // ROLE_VALIDATOR indicates user participating as a validator. - Role_ROLE_VALIDATOR Role = 2 -) - -// Enum value maps for Role. -var ( - Role_name = map[int32]string{ - 0: "ROLE_UNSPECIFIED", - 1: "ROLE_PARTICIPANT", - 2: "ROLE_VALIDATOR", - } - Role_value = map[string]int32{ - "ROLE_UNSPECIFIED": 0, - "ROLE_PARTICIPANT": 1, - "ROLE_VALIDATOR": 2, - } -) - -func (x Role) Enum() *Role { - p := new(Role) - *p = x - return p -} - -func (x Role) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Role) Descriptor() protoreflect.EnumDescriptor { - return file_cerc_onboarding_v1_onboarding_proto_enumTypes[0].Descriptor() -} - -func (Role) Type() protoreflect.EnumType { - return &file_cerc_onboarding_v1_onboarding_proto_enumTypes[0] -} - -func (x Role) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Role.Descriptor instead. -func (Role) EnumDescriptor() ([]byte, []int) { - return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{0} -} - // Params defines the parameters of the onboarding module. type Params struct { state protoimpl.MessageState @@ -1617,7 +1580,7 @@ type Participant struct { // participant's Nitro address NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"` // participant's role (participant | validator) - Role Role `protobuf:"varint,3,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` // participant's KYC receipt ID KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } @@ -1656,11 +1619,11 @@ func (x *Participant) GetNitroAddress() string { return "" } -func (x *Participant) GetRole() Role { +func (x *Participant) GetRole() string { if x != nil { return x.Role } - return Role_ROLE_UNSPECIFIED + return "" } func (x *Participant) GetKycId() string { @@ -1729,7 +1692,7 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x6c, 0x65, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x52, 0x11, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x22, 0xbc, 0x02, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x64, 0x22, 0xa2, 0x02, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x56, 0x0a, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xf2, 0xde, 0x1f, 0x2b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, @@ -1740,42 +1703,35 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x42, 0x2d, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, - 0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x65, - 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x6f, 0x6c, - 0x65, 0x22, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6b, 0x79, 0x63, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, - 0x22, 0x76, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, - 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, - 0x73, 0x67, 0x22, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x2a, 0x4c, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, - 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, - 0x41, 0x52, 0x54, 0x49, 0x43, 0x49, 0x50, 0x41, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x02, - 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xd4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, - 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, - 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, - 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, - 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, - 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, - 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0c, 0x6e, 0x69, 0x74, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, + 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x36, + 0x0a, 0x06, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, + 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, + 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x22, 0x52, + 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, 0x22, 0x76, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, + 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x20, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x73, 0x67, 0x22, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0xd4, + 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, + 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, + 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, + 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, + 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, + 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1790,21 +1746,18 @@ func file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP() []byte { return file_cerc_onboarding_v1_onboarding_proto_rawDescData } -var file_cerc_onboarding_v1_onboarding_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_cerc_onboarding_v1_onboarding_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cerc_onboarding_v1_onboarding_proto_goTypes = []interface{}{ - (Role)(0), // 0: cerc.onboarding.v1.Role - (*Params)(nil), // 1: cerc.onboarding.v1.Params - (*Participant)(nil), // 2: cerc.onboarding.v1.Participant - (*EthPayload)(nil), // 3: cerc.onboarding.v1.EthPayload + (*Params)(nil), // 0: cerc.onboarding.v1.Params + (*Participant)(nil), // 1: cerc.onboarding.v1.Participant + (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload } var file_cerc_onboarding_v1_onboarding_proto_depIdxs = []int32{ - 0, // 0: cerc.onboarding.v1.Participant.role:type_name -> cerc.onboarding.v1.Role - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_onboarding_proto_init() } @@ -1855,14 +1808,13 @@ func file_cerc_onboarding_v1_onboarding_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_onboarding_v1_onboarding_proto_rawDesc, - NumEnums: 1, + NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, GoTypes: file_cerc_onboarding_v1_onboarding_proto_goTypes, DependencyIndexes: file_cerc_onboarding_v1_onboarding_proto_depIdxs, - EnumInfos: file_cerc_onboarding_v1_onboarding_proto_enumTypes, MessageInfos: file_cerc_onboarding_v1_onboarding_proto_msgTypes, }.Build() File_cerc_onboarding_v1_onboarding_proto = out.File diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go index aff1ff44..e35da0f5 100644 --- a/api/cerc/onboarding/v1/tx.pulsar.go +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -117,8 +117,8 @@ func (x *fastReflection_MsgOnboardParticipant) Range(f func(protoreflect.FieldDe return } } - if x.Role != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if x.Role != "" { + value := protoreflect.ValueOfString(x.Role) if !f(fd_MsgOnboardParticipant_role, value) { return } @@ -151,7 +151,7 @@ func (x *fastReflection_MsgOnboardParticipant) Has(fd protoreflect.FieldDescript case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": return x.EthSignature != "" case "cerc.onboarding.v1.MsgOnboardParticipant.role": - return x.Role != 0 + return x.Role != "" case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": return x.KycId != "" default: @@ -177,7 +177,7 @@ func (x *fastReflection_MsgOnboardParticipant) Clear(fd protoreflect.FieldDescri case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": x.EthSignature = "" case "cerc.onboarding.v1.MsgOnboardParticipant.role": - x.Role = 0 + x.Role = "" case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": x.KycId = "" default: @@ -207,7 +207,7 @@ func (x *fastReflection_MsgOnboardParticipant) Get(descriptor protoreflect.Field return protoreflect.ValueOfString(value) case "cerc.onboarding.v1.MsgOnboardParticipant.role": value := x.Role - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + return protoreflect.ValueOfString(value) case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": value := x.KycId return protoreflect.ValueOfString(value) @@ -238,7 +238,7 @@ func (x *fastReflection_MsgOnboardParticipant) Set(fd protoreflect.FieldDescript case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": x.EthSignature = value.Interface().(string) case "cerc.onboarding.v1.MsgOnboardParticipant.role": - x.Role = (Role)(value.Enum()) + x.Role = value.Interface().(string) case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": x.KycId = value.Interface().(string) default: @@ -295,7 +295,7 @@ func (x *fastReflection_MsgOnboardParticipant) NewField(fd protoreflect.FieldDes case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": return protoreflect.ValueOfString("") case "cerc.onboarding.v1.MsgOnboardParticipant.role": - return protoreflect.ValueOfEnum(0) + return protoreflect.ValueOfString("") case "cerc.onboarding.v1.MsgOnboardParticipant.kyc_id": return protoreflect.ValueOfString("") default: @@ -379,8 +379,9 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Role != 0 { - n += 1 + runtime.Sov(uint64(x.Role)) + l = len(x.Role) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.KycId) if l > 0 { @@ -422,10 +423,12 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method i-- dAtA[i] = 0x2a } - if x.Role != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + if len(x.Role) > 0 { + i -= len(x.Role) + copy(dAtA[i:], x.Role) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } if len(x.EthSignature) > 0 { i -= len(x.EthSignature) @@ -605,10 +608,10 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method x.EthSignature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - x.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -618,11 +621,24 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method } b := dAtA[iNdEx] iNdEx++ - x.Role |= Role(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) @@ -1069,7 +1085,7 @@ type MsgOnboardParticipant struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` EthPayload *EthPayload `protobuf:"bytes,2,opt,name=eth_payload,json=ethPayload,proto3" json:"eth_payload,omitempty"` EthSignature string `protobuf:"bytes,3,opt,name=eth_signature,json=ethSignature,proto3" json:"eth_signature,omitempty"` - Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` KycId string `protobuf:"bytes,5,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } @@ -1114,11 +1130,11 @@ func (x *MsgOnboardParticipant) GetEthSignature() string { return "" } -func (x *MsgOnboardParticipant) GetRole() Role { +func (x *MsgOnboardParticipant) GetRole() string { if x != nil { return x.Role } - return Role_ROLE_UNSPECIFIED + return "" } func (x *MsgOnboardParticipant) GetKycId() string { @@ -1169,7 +1185,7 @@ var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, @@ -1179,39 +1195,38 @@ var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x74, 0x68, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, - 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x72, - 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, - 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x79, 0x63, - 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, - 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xb2, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0xa3, 0x01, 0x0a, 0x12, - 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, - 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x31, 0x2e, - 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x27, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, - 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, - 0x74, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, - 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, - 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, - 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, - 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, - 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x6b, 0x79, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6b, 0x79, 0x63, 0x49, 0x64, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x4f, + 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb2, 0x01, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0xa3, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, + 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x27, + 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcc, + 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, + 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, + 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, + 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, + 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1231,18 +1246,16 @@ var file_cerc_onboarding_v1_tx_proto_goTypes = []interface{}{ (*MsgOnboardParticipant)(nil), // 0: cerc.onboarding.v1.MsgOnboardParticipant (*MsgOnboardParticipantResponse)(nil), // 1: cerc.onboarding.v1.MsgOnboardParticipantResponse (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload - (Role)(0), // 3: cerc.onboarding.v1.Role } var file_cerc_onboarding_v1_tx_proto_depIdxs = []int32{ 2, // 0: cerc.onboarding.v1.MsgOnboardParticipant.eth_payload:type_name -> cerc.onboarding.v1.EthPayload - 3, // 1: cerc.onboarding.v1.MsgOnboardParticipant.role:type_name -> cerc.onboarding.v1.Role - 0, // 2: cerc.onboarding.v1.Msg.OnboardParticipant:input_type -> cerc.onboarding.v1.MsgOnboardParticipant - 1, // 3: cerc.onboarding.v1.Msg.OnboardParticipant:output_type -> cerc.onboarding.v1.MsgOnboardParticipantResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // 1: cerc.onboarding.v1.Msg.OnboardParticipant:input_type -> cerc.onboarding.v1.MsgOnboardParticipant + 1, // 2: cerc.onboarding.v1.Msg.OnboardParticipant:output_type -> cerc.onboarding.v1.MsgOnboardParticipantResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_tx_proto_init() } diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index 0e132745..483dcd1d 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -33,7 +33,7 @@ type Account { type Participant { cosmosAddress: String! # Cosmos address of the participant who will be registered. nitroAddress: String! # Nitro addresss of the participant who will be registered. - role: Int! # Participant's role + role: String! # Participant's role kycId: String! # Participant's KYC receipt ID } diff --git a/gql/generated.go b/gql/generated.go index bc9f5a20..74dbbe8d 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -3966,9 +3966,9 @@ func (ec *executionContext) _Participant_role(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Participant_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3978,7 +3978,7 @@ func (ec *executionContext) fieldContext_Participant_role(ctx context.Context, f IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil diff --git a/gql/models_gen.go b/gql/models_gen.go index aedaedfd..460e8233 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -138,7 +138,7 @@ type OwnerBonds struct { type Participant struct { CosmosAddress string `json:"cosmosAddress"` NitroAddress string `json:"nitroAddress"` - Role int `json:"role"` + Role string `json:"role"` KycID string `json:"kycId"` } diff --git a/gql/resolver.go b/gql/resolver.go index b5c264ef..ef77e002 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -373,7 +373,7 @@ func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, err participants[i] = &Participant{ CosmosAddress: p.CosmosAddress, NitroAddress: p.NitroAddress, - Role: int(p.GetRole()), + Role: p.Role, KycID: p.KycId, } } diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index 494ab0c7..002dc6ae 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -27,7 +27,7 @@ message Participant { "json:\"nitro_address\" yaml:\"nitro_address\"" ]; // participant's role (participant | validator) - Role role = 3 [ (gogoproto.moretags) = "json:\"role\" yaml:\"role\"" ]; + string role = 3 [ (gogoproto.moretags) = "json:\"role\" yaml:\"role\"" ]; // participant's KYC receipt ID string kyc_id = 4 @@ -41,17 +41,3 @@ message EthPayload { string msg = 2 [ (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" ]; } - -// Participant Role -enum Role { - option (gogoproto.goproto_enum_prefix) = false; - - // ROLE_UNSPECIFIED indicates unknown role. - ROLE_UNSPECIFIED = 0; - - // ROLE_PARTICIPANT indicates the participant role. - ROLE_PARTICIPANT = 1; - - // ROLE_VALIDATOR indicates user participating as a validator. - ROLE_VALIDATOR = 2; -} diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto index c0e7b6d7..6e0eab6e 100644 --- a/proto/cerc/onboarding/v1/tx.proto +++ b/proto/cerc/onboarding/v1/tx.proto @@ -28,7 +28,7 @@ message MsgOnboardParticipant { string participant = 1; EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ]; string eth_signature = 3; - Role role = 4; + string role = 4; string kyc_id = 5; } diff --git a/x/onboarding/msgs.go b/x/onboarding/msgs.go index 75574f4a..c9f5a8c2 100644 --- a/x/onboarding/msgs.go +++ b/x/onboarding/msgs.go @@ -1,11 +1,15 @@ package onboarding import ( + "fmt" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +var PERMITTED_ROLES = []string{"participant", "validator"} + var _ sdk.Msg = &MsgOnboardParticipant{} func (msg MsgOnboardParticipant) ValidateBasic() error { @@ -21,13 +25,21 @@ func (msg MsgOnboardParticipant) ValidateBasic() error { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid signature.") } - if msg.Role == ROLE_UNSPECIFIED { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Participant role not specified.") - } - if len(msg.KycId) == 0 { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Empty KYC ID.") } + isRoleValid := false + for _, v := range PERMITTED_ROLES { + if msg.Role == v { + isRoleValid = true + break + } + } + + if !isRoleValid { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("Participant role has to be one of: %v", PERMITTED_ROLES)) + } + return nil } diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go index f429f30c..da16f232 100644 --- a/x/onboarding/onboarding.pb.go +++ b/x/onboarding/onboarding.pb.go @@ -23,38 +23,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Participant Role -type Role int32 - -const ( - // ROLE_UNSPECIFIED indicates unknown role. - ROLE_UNSPECIFIED Role = 0 - // ROLE_PARTICIPANT indicates the participant role. - ROLE_PARTICIPANT Role = 1 - // ROLE_VALIDATOR indicates user participating as a validator. - ROLE_VALIDATOR Role = 2 -) - -var Role_name = map[int32]string{ - 0: "ROLE_UNSPECIFIED", - 1: "ROLE_PARTICIPANT", - 2: "ROLE_VALIDATOR", -} - -var Role_value = map[string]int32{ - "ROLE_UNSPECIFIED": 0, - "ROLE_PARTICIPANT": 1, - "ROLE_VALIDATOR": 2, -} - -func (x Role) String() string { - return proto.EnumName(Role_name, int32(x)) -} - -func (Role) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_59afed779274eaf0, []int{0} -} - // Params defines the parameters of the onboarding module. type Params struct { OnboardingEnabled bool `protobuf:"varint,1,opt,name=onboarding_enabled,json=onboardingEnabled,proto3" json:"onboarding_enabled,omitempty" json:"onboarding_enabled" yaml:"onboarding_enabled"` @@ -108,7 +76,7 @@ type Participant struct { // participant's Nitro address NitroAddress string `protobuf:"bytes,2,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty" json:"nitro_address" yaml:"nitro_address"` // participant's role (participant | validator) - Role Role `protobuf:"varint,3,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty" json:"role" yaml:"role"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty" json:"role" yaml:"role"` // participant's KYC receipt ID KycId string `protobuf:"bytes,4,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty" json:"kyc_id" yaml:"kyc_id"` } @@ -160,11 +128,11 @@ func (m *Participant) GetNitroAddress() string { return "" } -func (m *Participant) GetRole() Role { +func (m *Participant) GetRole() string { if m != nil { return m.Role } - return ROLE_UNSPECIFIED + return "" } func (m *Participant) GetKycId() string { @@ -228,7 +196,6 @@ func (m *EthPayload) GetMsg() string { } func init() { - proto.RegisterEnum("cerc.onboarding.v1.Role", Role_name, Role_value) proto.RegisterType((*Params)(nil), "cerc.onboarding.v1.Params") proto.RegisterType((*Participant)(nil), "cerc.onboarding.v1.Participant") proto.RegisterType((*EthPayload)(nil), "cerc.onboarding.v1.EthPayload") @@ -239,37 +206,32 @@ func init() { } var fileDescriptor_59afed779274eaf0 = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xed, 0x34, 0x04, 0x58, 0x68, 0x14, 0x56, 0x45, 0x84, 0x56, 0xd8, 0x21, 0x5c, 0x02, - 0x55, 0x6d, 0x95, 0x4a, 0x20, 0xc1, 0xc9, 0x6e, 0x8d, 0x64, 0x29, 0x6a, 0xad, 0x25, 0xf4, 0xc0, - 0x25, 0xda, 0x78, 0x8d, 0x31, 0xb5, 0x3d, 0x91, 0x6d, 0x45, 0xe4, 0x0d, 0x38, 0xf2, 0x0e, 0xbc, - 0x06, 0x0f, 0xc0, 0xb1, 0x47, 0x4e, 0x16, 0x4a, 0xde, 0xc0, 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xc0, 0x0f, 0x32, 0x6d, 0xc6, 0x26, 0x5a, 0x06, 0x7a, 0x79, 0xde, 0x83, - 0x00, 0xf4, 0x90, 0xba, 0x10, 0x07, 0x2e, 0xd3, 0xbf, 0x6f, 0x7c, 0xf5, 0x49, 0x8b, 0xff, 0xe0, - 0xa3, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xaf, 0x40, 0xe4, 0x12, 0x03, 0x00, 0x00, + // 399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0xce, 0xd2, 0x40, + 0x14, 0x85, 0xe9, 0x0f, 0xa2, 0x8e, 0x62, 0xe2, 0x44, 0x23, 0x4a, 0xec, 0x60, 0xdd, 0x60, 0x08, + 0x9d, 0x10, 0x12, 0x4d, 0x74, 0x65, 0x13, 0x16, 0xee, 0x48, 0x17, 0x2e, 0xdc, 0x90, 0xe9, 0x4c, + 0xad, 0x23, 0x6d, 0x87, 0xcc, 0x34, 0x8d, 0x7d, 0x0b, 0x9f, 0xc1, 0xa7, 0x71, 0xc9, 0xd2, 0x55, + 0x63, 0xe0, 0x0d, 0xfa, 0x04, 0xa6, 0x33, 0x14, 0x28, 0xfe, 0xbb, 0x7b, 0xcf, 0x3d, 0xe7, 0xbb, + 0xd3, 0xe6, 0x82, 0xd7, 0x34, 0x94, 0x14, 0x8b, 0x34, 0x10, 0x44, 0x32, 0x9e, 0x46, 0x38, 0x9f, + 0x5f, 0x74, 0xee, 0x56, 0x8a, 0x4c, 0x40, 0x58, 0x9b, 0xdc, 0x0b, 0x39, 0x9f, 0xbf, 0x78, 0x12, + 0x89, 0x48, 0xe8, 0x31, 0xae, 0x2b, 0xe3, 0x74, 0xb6, 0xa0, 0xbf, 0x22, 0x92, 0x24, 0x0a, 0x7e, + 0x05, 0xf0, 0x1c, 0x58, 0x87, 0x29, 0x09, 0xe2, 0x90, 0x0d, 0x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f, 0x5e, 0x95, 0xe8, 0xa9, 0x09, 0x26, 0x2a, 0x6a, 0x42, 0x75, 0xe9, 0xd7, 0x2e, 0xcf, 0xfb, + 0xbd, 0xb7, 0xad, 0xdd, 0xde, 0xb6, 0xfe, 0xee, 0x6d, 0xeb, 0xe7, 0xc1, 0xee, 0xec, 0x0e, 0x76, + 0xe7, 0xcf, 0xc1, 0xee, 0x7c, 0x99, 0x44, 0x3c, 0x73, 0x73, 0x16, 0xb8, 0x99, 0xc0, 0xf5, 0x75, + 0xcd, 0xb8, 0xc0, 0x31, 0xa1, 0x22, 0xe5, 0x94, 0xe1, 0x1f, 0x17, 0x27, 0x18, 0xf4, 0xf5, 0x65, + 0x2d, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x87, 0xe5, 0xd5, 0x6b, 0xaa, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -332,10 +294,12 @@ func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Role != 0 { - i = encodeVarintOnboarding(dAtA, i, uint64(m.Role)) + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Role))) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if len(m.NitroAddress) > 0 { i -= len(m.NitroAddress) @@ -428,8 +392,9 @@ func (m *Participant) Size() (n int) { if l > 0 { n += 1 + l + sovOnboarding(uint64(l)) } - if m.Role != 0 { - n += 1 + sovOnboarding(uint64(m.Role)) + l = len(m.Role) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) } l = len(m.KycId) if l > 0 { @@ -625,10 +590,10 @@ func (m *Participant) Unmarshal(dAtA []byte) error { m.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - m.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOnboarding @@ -638,11 +603,24 @@ func (m *Participant) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Role |= Role(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnboarding + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnboarding + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) diff --git a/x/onboarding/tx.pb.go b/x/onboarding/tx.pb.go index fe1ff267..8c2f3d20 100644 --- a/x/onboarding/tx.pb.go +++ b/x/onboarding/tx.pb.go @@ -36,7 +36,7 @@ type MsgOnboardParticipant struct { Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"` EthPayload EthPayload `protobuf:"bytes,2,opt,name=eth_payload,json=ethPayload,proto3" json:"eth_payload"` EthSignature string `protobuf:"bytes,3,opt,name=eth_signature,json=ethSignature,proto3" json:"eth_signature,omitempty"` - Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=cerc.onboarding.v1.Role" json:"role,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` KycId string `protobuf:"bytes,5,opt,name=kyc_id,json=kycId,proto3" json:"kyc_id,omitempty"` } @@ -94,11 +94,11 @@ func (m *MsgOnboardParticipant) GetEthSignature() string { return "" } -func (m *MsgOnboardParticipant) GetRole() Role { +func (m *MsgOnboardParticipant) GetRole() string { if m != nil { return m.Role } - return ROLE_UNSPECIFIED + return "" } func (m *MsgOnboardParticipant) GetKycId() string { @@ -154,33 +154,33 @@ func init() { func init() { proto.RegisterFile("cerc/onboarding/v1/tx.proto", fileDescriptor_6bfde34a550e231e) } var fileDescriptor_6bfde34a550e231e = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x8a, 0xd3, 0x40, - 0x1c, 0xc6, 0x33, 0xbb, 0xed, 0x82, 0x53, 0x15, 0x19, 0x5c, 0x0c, 0x51, 0xb3, 0x21, 0x7b, 0x30, - 0xbb, 0x68, 0x86, 0xd6, 0x9b, 0xc7, 0xc2, 0x1e, 0x3c, 0x2c, 0x2e, 0xf1, 0xe6, 0xa5, 0x4c, 0x27, - 0xc3, 0x74, 0xd8, 0x74, 0xfe, 0x21, 0x33, 0x96, 0xed, 0x4d, 0xf6, 0x09, 0x04, 0x1f, 0xc1, 0x17, - 0x58, 0x7c, 0x8a, 0x3d, 0x16, 0xbc, 0x78, 0x12, 0x69, 0x85, 0xbe, 0x84, 0x07, 0xe9, 0xb4, 0xb5, - 0x01, 0x23, 0x78, 0xfb, 0xe7, 0xfb, 0x7f, 0x7c, 0xbf, 0x7c, 0x33, 0x83, 0x1f, 0x73, 0x51, 0x71, - 0x0a, 0x7a, 0x08, 0xac, 0xca, 0x95, 0x96, 0x74, 0xd2, 0xa5, 0xf6, 0x2a, 0x2d, 0x2b, 0xb0, 0x40, - 0xc8, 0x6a, 0x99, 0xee, 0x96, 0xe9, 0xa4, 0x1b, 0x3c, 0xe2, 0x60, 0xc6, 0x60, 0xe8, 0xd8, 0x38, - 0xef, 0xd8, 0xc8, 0xb5, 0x39, 0x78, 0x22, 0x01, 0x64, 0x21, 0x28, 0x2b, 0x15, 0x65, 0x5a, 0x83, - 0x65, 0x56, 0x81, 0x36, 0x9b, 0xed, 0x43, 0x09, 0x12, 0xdc, 0x48, 0x57, 0xd3, 0x46, 0x3d, 0x6e, - 0xa0, 0xd7, 0x70, 0xce, 0x14, 0xff, 0x42, 0xf8, 0xf0, 0xdc, 0xc8, 0x37, 0x6b, 0xfd, 0x82, 0x55, - 0x56, 0x71,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, 0x43, 0xf4, 0x71, 0x11, 0x7a, 0xb3, 0x45, - 0xe8, 0x7d, 0x5b, 0x84, 0xde, 0xbb, 0x44, 0x2a, 0x9b, 0x4e, 0xf2, 0x61, 0x6a, 0xc1, 0x65, 0xbe, - 0x50, 0x40, 0x0b, 0xc6, 0x41, 0x2b, 0x9e, 0xd3, 0xab, 0x1a, 0x61, 0x78, 0xe0, 0xde, 0xc7, 0xcb, - 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x5a, 0xe1, 0xc6, 0xc4, 0x02, 0x00, 0x00, + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x8a, 0x13, 0x31, + 0x1c, 0xc6, 0x27, 0xbb, 0xed, 0x82, 0xa9, 0x82, 0x04, 0x17, 0x87, 0x51, 0x67, 0xcb, 0xec, 0xc1, + 0xee, 0x82, 0x13, 0xba, 0xde, 0x3c, 0x16, 0xf6, 0xe0, 0x61, 0xb1, 0xd4, 0x9b, 0x97, 0x92, 0x66, + 0x42, 0x1a, 0x3a, 0xcd, 0x7f, 0x98, 0xc4, 0xd2, 0xde, 0xa4, 0x4f, 0x20, 0xf8, 0x08, 0xbe, 0x40, + 0xf1, 0x29, 0x7a, 0x2c, 0x78, 0xf1, 0x24, 0x32, 0x15, 0xfa, 0x1a, 0xd2, 0xb4, 0xb5, 0x03, 0x8e, + 0xb0, 0xb7, 0xff, 0xfc, 0xbe, 0x8f, 0xff, 0x37, 0x5f, 0x12, 0xfc, 0x8c, 0x8b, 0x9c, 0x53, 0xd0, + 0x03, 0x60, 0x79, 0xa2, 0xb4, 0xa4, 0x93, 0x36, 0xb5, 0xd3, 0x38, 0xcb, 0xc1, 0x02, 0x21, 0x5b, + 0x31, 0x3e, 0x8a, 0xf1, 0xa4, 0x1d, 0x3c, 0xe5, 0x60, 0xc6, 0x60, 0xe8, 0xd8, 0x38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0xab, 0xaa, 0x4e, 0x95, 0x1b, 0x83, 0xf6, 0xbd, 0xad, 0x87, 0xf0, 0x88, 0xce, 0xbf, + 0xff, 0xfe, 0x72, 0x72, 0x15, 0xbd, 0xa4, 0xff, 0xbf, 0xb0, 0x7e, 0xa9, 0x4e, 0x50, 0xff, 0xb4, + 0x59, 0x5c, 0xa3, 0x4e, 0x67, 0x59, 0x84, 0x68, 0x55, 0x84, 0xe8, 0x57, 0x11, 0xa2, 0xcf, 0xeb, + 0xd0, 0x5b, 0xad, 0x43, 0xef, 0xc7, 0x3a, 0xf4, 0x3e, 0xb4, 0xa4, 0xb2, 0xf1, 0x24, 0x19, 0xc4, + 0x16, 0xdc, 0xce, 0x57, 0x0a, 0x68, 0xca, 0x38, 0x68, 0xc5, 0x13, 0x3a, 0x2d, 0x25, 0x0c, 0xce, + 0xdc, 0x2b, 0x78, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x75, 0x86, 0x6d, 0xd1, 0xaa, 0x02, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -292,10 +292,12 @@ func (m *MsgOnboardParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.Role != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Role)) + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintTx(dAtA, i, uint64(len(m.Role))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } if len(m.EthSignature) > 0 { i -= len(m.EthSignature) @@ -374,8 +376,9 @@ func (m *MsgOnboardParticipant) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Role != 0 { - n += 1 + sovTx(uint64(m.Role)) + l = len(m.Role) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } l = len(m.KycId) if l > 0 { @@ -526,10 +529,10 @@ func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error { m.EthSignature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } - m.Role = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -539,11 +542,24 @@ func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Role |= Role(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KycId", wireType) -- 2.45.2