Compare commits

..
Author SHA1 Message Date
IshaVenikar bb9d7f56fe Configure pagination in gql query 2024-08-29 15:47:36 +05:30
prathamesh debfb82205 Integrate slashing module in the app (#53)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Add `slashing` module for penalizing / jailing offline validators
Reference: https://docs.cosmos.network/main/build/modules/slashing#liveness-tracking

Note: Breaking change, an existing chain cannot be run with the updated binary

Reviewed-on: cerc-io/laconicd#53
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-08-16 06:23:56 +00:00
prathamesh 3c5cd002e1 Add env variables to configure authority auctions in initialization script (#50)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Reviewed-on: cerc-io/laconicd#50
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-08-08 07:14:36 +00:00
prathamesh b5a76a920e Update node initialization script (#49)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Reviewed-on: cerc-io/laconicd#49
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-08-07 11:25:01 +00:00
nabarunandIshaVenikar f176a5889e Implement GQL query for listing authorities (#48)
Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8)

Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Reviewed-on: cerc-io/laconicd#48
2024-08-02 09:15:08 +00:00
nabarunandAdw8 5e7d5fc47c Update init script to use existing genesis file (#47)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Co-authored-by: Adw8 <adwaitgharpure@gmail.com>
Reviewed-on: cerc-io/laconicd#47
2024-08-01 11:52:47 +00:00
prathameshandzramsay c162396298 Change token denom from photon to lnt and alnt (#46)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Co-authored-by: zramsay <zach@bluecollarcoding.ca>
Reviewed-on: cerc-io/laconicd#46
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-30 11:05:58 +00:00
prathameshandIshaVenikar 7a88c82816 Add queries to get participant by laconic or nitro address (#44)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Reviewed-on: cerc-io/laconicd#44
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-29 10:28:30 +00:00
prathamesh 9fab3f8326 Add fields for role and KYC ID for onboarded participants (#43)
Part of [Sumsub KYC integration in onboarding app](https://www.notion.so/Sumsub-KYC-integration-in-onboarding-app-607b598c9c1d4d12adc71725e2ab5e7e)

Reviewed-on: cerc-io/laconicd#43
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-26 14:42:40 +00:00
33 changed files with 4846 additions and 237 deletions
+3
View File
@@ -25,6 +25,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Copy over binary from the builder
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
# Copy over init script from builder
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/scripts/init.sh scripts/init.sh
WORKDIR /
# Run laconicd by default
+179 -25
View File
@@ -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 != "" {
value := protoreflect.ValueOfString(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 != ""
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 = ""
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.ValueOfString(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 = value.Interface().(string)
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.ValueOfString("")
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,14 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods {
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Role)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.KycId)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
@@ -745,6 +795,20 @@ 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 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] = 0x1a
}
if len(x.NitroAddress) > 0 {
i -= len(x.NitroAddress)
copy(dAtA[i:], x.NitroAddress)
@@ -872,6 +936,70 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods {
}
x.NitroAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", 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.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)
}
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:])
@@ -1447,8 +1575,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 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"`
}
func (x *Participant) Reset() {
@@ -1485,6 +1619,20 @@ func (x *Participant) GetNitroAddress() string {
return ""
}
func (x *Participant) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
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 +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, 0xb9, 0x01, 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,
@@ -1555,29 +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, 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,
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 (
File diff suppressed because it is too large Load Diff
+79 -1
View File
@@ -19,7 +19,9 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
Query_Participants_FullMethodName = "/cerc.onboarding.v1.Query/Participants"
Query_Participants_FullMethodName = "/cerc.onboarding.v1.Query/Participants"
Query_GetParticipantByAddress_FullMethodName = "/cerc.onboarding.v1.Query/GetParticipantByAddress"
Query_GetParticipantByNitroAddress_FullMethodName = "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress"
)
// QueryClient is the client API for Query service.
@@ -28,6 +30,10 @@ const (
type QueryClient interface {
// Participants queries Participants list
Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error)
// GetParticipantByAddress queries a participant by cosmos (laconic) address
GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error)
// GetParticipantByNitroAddress queries a participant by nitro address
GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error)
}
type queryClient struct {
@@ -47,12 +53,34 @@ func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsReq
return out, nil
}
func (c *queryClient) GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error) {
out := new(QueryGetParticipantByAddressResponse)
err := c.cc.Invoke(ctx, Query_GetParticipantByAddress_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error) {
out := new(QueryGetParticipantByNitroAddressResponse)
err := c.cc.Invoke(ctx, Query_GetParticipantByNitroAddress_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Participants queries Participants list
Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error)
// GetParticipantByAddress queries a participant by cosmos (laconic) address
GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error)
// GetParticipantByNitroAddress queries a participant by nitro address
GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error)
mustEmbedUnimplementedQueryServer()
}
@@ -63,6 +91,12 @@ type UnimplementedQueryServer struct {
func (UnimplementedQueryServer) Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented")
}
func (UnimplementedQueryServer) GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByAddress not implemented")
}
func (UnimplementedQueryServer) GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByNitroAddress not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
@@ -94,6 +128,42 @@ func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Query_GetParticipantByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetParticipantByAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetParticipantByAddress(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetParticipantByAddress_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetParticipantByAddress(ctx, req.(*QueryGetParticipantByAddressRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetParticipantByNitroAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetParticipantByNitroAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetParticipantByNitroAddress_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, req.(*QueryGetParticipantByNitroAddressRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -105,6 +175,14 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Participants",
Handler: _Query_Participants_Handler,
},
{
MethodName: "GetParticipantByAddress",
Handler: _Query_GetParticipantByAddress_Handler,
},
{
MethodName: "GetParticipantByNitroAddress",
Handler: _Query_GetParticipantByNitroAddress_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cerc/onboarding/v1/query.proto",
+175 -28
View File
@@ -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 != "" {
value := protoreflect.ValueOfString(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 != ""
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 = ""
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.ValueOfString(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 = value.Interface().(string)
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.ValueOfString("")
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,14 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Role)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.KycId)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
@@ -366,6 +416,20 @@ 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 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] = 0x22
}
if len(x.EthSignature) > 0 {
i -= len(x.EthSignature)
copy(dAtA[i:], x.EthSignature)
@@ -543,6 +607,70 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method
}
x.EthSignature = 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 Role", 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.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)
}
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 +1085,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 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"`
}
func (x *MsgOnboardParticipant) Reset() {
@@ -1000,6 +1130,20 @@ func (x *MsgOnboardParticipant) GetEthSignature() string {
return ""
}
func (x *MsgOnboardParticipant) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
func (x *MsgOnboardParticipant) GetKycId() string {
if x != nil {
return x.KycId
}
return ""
}
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
// type.
type MsgOnboardParticipantResponse struct {
@@ -1041,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, 0xb7, 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,
@@ -1051,35 +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, 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,
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, 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,
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 (
+4
View File
@@ -34,6 +34,7 @@ import (
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
@@ -48,6 +49,7 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
)
@@ -76,6 +78,7 @@ type LaconicApp struct {
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
DistrKeeper distrkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
ConsensusParamsKeeper consensuskeeper.Keeper
@@ -142,6 +145,7 @@ func NewLaconicApp(
&app.AccountKeeper,
&app.BankKeeper,
&app.StakingKeeper,
&app.SlashingKeeper,
&app.DistrKeeper,
&app.CrisisKeeper,
&app.ConsensusParamsKeeper,
+5 -2
View File
@@ -6,11 +6,11 @@ modules:
# During begin block slashing happens after distr.BeginBlocker so that
# there is nothing left over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
# NOTE: staking module is required if HistoricalEntries param > 0
begin_blockers: [distribution, staking]
begin_blockers: [distribution, slashing, staking]
end_blockers: [crisis, staking, auction, registry]
# NOTE: The genutils module must occur after staking so that pools are properly initialized with tokens from genesis accounts.
# NOTE: The genutils module must also occur after auth so that it can access the params from auth.
init_genesis: [auth, bank, distribution, staking, crisis, genutil, auction, bond, registry, onboarding]
init_genesis: [auth, bank, distribution, staking, slashing, crisis, genutil, auction, bond, registry, onboarding]
override_store_keys:
- module_name: auth
kv_store_key: acc
@@ -39,6 +39,9 @@ modules:
- name: staking
config:
"@type": cosmos.staking.module.v1.Module
- name: slashing
config:
"@type": cosmos.slashing.module.v1.Module
- name: distribution
config:
"@type": cosmos.distribution.module.v1.Module
+13
View File
@@ -10,6 +10,7 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)
@@ -221,4 +222,16 @@ func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
if err != nil {
log.Fatal(err)
}
/* Handle slashing state. */
// reset start height on signing infos
app.SlashingKeeper.IterateValidatorSigningInfos(
ctx,
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
info.StartHeight = 0
app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
return false
},
)
}
+9 -2
View File
@@ -10,9 +10,11 @@ import (
)
const (
CoinUnit = "photon"
CoinUnit = "lnt"
BaseCoinUnit = "alnt"
LntExponent = 18
DefaultBondDenom = CoinUnit
DefaultBondDenom = BaseCoinUnit
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
Bech32PrefixAccAddr = "laconic"
@@ -41,6 +43,11 @@ func RegisterDenoms() {
if err != nil {
panic(err)
}
err = sdk.RegisterDenom(BaseCoinUnit, math.LegacyNewDecWithPrec(1, LntExponent))
if err != nil {
panic(err)
}
}
func SetAddressPrefixes() {
+1 -1
View File
@@ -98,7 +98,7 @@ func NewRootCmd() *cobra.Command {
// overwrite the minimum gas price from the app configuration
srvCfg := serverconfig.DefaultConfig()
srvCfg.MinGasPrices = "0photon"
srvCfg.MinGasPrices = "0alnt"
// overwrite the block timeout
cmtCfg := cmtcfg.DefaultConfig()
+1
View File
@@ -61,6 +61,7 @@ require (
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
+14
View File
@@ -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: String! # Participant's role
kycId: String! # Participant's KYC receipt ID
}
# Value describes a DAG-JSON compatible value.
@@ -195,6 +197,11 @@ type AuthorityRecord {
auction: Auction # Authority auction.
}
type Authority {
name: String!
entry: AuthorityRecord!
}
# Name record entry, created at a particular height.
type NameRecordEntry {
id: String! # Target record ID.
@@ -239,12 +246,17 @@ type Query {
# Whether to query all records, not just named ones (false by default).
all: Boolean
limit: Int
offset: Int
): [Record]
#
# Naming API.
#
# Get authorities list.
getAuthorities(owner: String): [Authority]
# Lookup authority information.
lookupAuthorities(names: [String!]): [AuthorityRecord]!
@@ -263,4 +275,6 @@ type Query {
# Query participants.
getParticipants: [Participant]!
getParticipantByAddress(address: String!): Participant!
getParticipantByNitroAddress(nitroAddress: String!): Participant!
}
+726 -15
View File
@@ -87,6 +87,11 @@ type ComplexityRoot struct {
Status func(childComplexity int) int
}
Authority struct {
Entry func(childComplexity int) int
Name func(childComplexity int) int
}
AuthorityRecord struct {
Auction func(childComplexity int) int
BondID func(childComplexity int) int
@@ -155,7 +160,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 {
@@ -165,18 +172,21 @@ type ComplexityRoot struct {
}
Query struct {
GetAccounts func(childComplexity int, addresses []string) int
GetAuctionsByIds func(childComplexity int, ids []string) int
GetBondsByIds func(childComplexity int, ids []string) int
GetParticipants func(childComplexity int) int
GetRecordsByIds func(childComplexity int, ids []string) int
GetStatus func(childComplexity int) int
LookupAuthorities func(childComplexity int, names []string) int
LookupNames func(childComplexity int, names []string) int
QueryBonds func(childComplexity int, attributes []*KeyValueInput) int
QueryBondsByOwner func(childComplexity int, ownerAddresses []string) int
QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool) int
ResolveNames func(childComplexity int, names []string) int
GetAccounts func(childComplexity int, addresses []string) int
GetAuctionsByIds func(childComplexity int, ids []string) int
GetAuthorities func(childComplexity int, owner *string) int
GetBondsByIds func(childComplexity int, ids []string) int
GetParticipantByAddress func(childComplexity int, address string) int
GetParticipantByNitroAddress func(childComplexity int, nitroAddress string) int
GetParticipants func(childComplexity int) int
GetRecordsByIds func(childComplexity int, ids []string) int
GetStatus func(childComplexity int) int
LookupAuthorities func(childComplexity int, names []string) int
LookupNames func(childComplexity int, names []string) int
QueryBonds func(childComplexity int, attributes []*KeyValueInput) int
QueryBondsByOwner func(childComplexity int, ownerAddresses []string) int
QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool, limit *int, offset *int) int
ResolveNames func(childComplexity int, names []string) int
}
Record struct {
@@ -226,12 +236,15 @@ type QueryResolver interface {
QueryBonds(ctx context.Context, attributes []*KeyValueInput) ([]*Bond, error)
QueryBondsByOwner(ctx context.Context, ownerAddresses []string) ([]*OwnerBonds, error)
GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error)
QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error)
QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool, limit *int, offset *int) ([]*Record, error)
GetAuthorities(ctx context.Context, owner *string) ([]*Authority, error)
LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error)
LookupNames(ctx context.Context, names []string) ([]*NameRecord, error)
ResolveNames(ctx context.Context, names []string) ([]*Record, error)
GetAuctionsByIds(ctx context.Context, ids []string) ([]*Auction, error)
GetParticipants(ctx context.Context) ([]*Participant, error)
GetParticipantByAddress(ctx context.Context, address string) (*Participant, error)
GetParticipantByNitroAddress(ctx context.Context, nitroAddress string) (*Participant, error)
}
type executableSchema struct {
@@ -452,6 +465,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.AuctionBid.Status(childComplexity), true
case "Authority.entry":
if e.complexity.Authority.Entry == nil {
break
}
return e.complexity.Authority.Entry(childComplexity), true
case "Authority.name":
if e.complexity.Authority.Name == nil {
break
}
return e.complexity.Authority.Name(childComplexity), true
case "AuthorityRecord.auction":
if e.complexity.AuthorityRecord.Auction == nil {
break
@@ -648,6 +675,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 +689,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
@@ -700,6 +741,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Query.GetAuctionsByIds(childComplexity, args["ids"].([]string)), true
case "Query.getAuthorities":
if e.complexity.Query.GetAuthorities == nil {
break
}
args, err := ec.field_Query_getAuthorities_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.GetAuthorities(childComplexity, args["owner"].(*string)), true
case "Query.getBondsByIds":
if e.complexity.Query.GetBondsByIds == nil {
break
@@ -712,6 +765,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Query.GetBondsByIds(childComplexity, args["ids"].([]string)), true
case "Query.getParticipantByAddress":
if e.complexity.Query.GetParticipantByAddress == nil {
break
}
args, err := ec.field_Query_getParticipantByAddress_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.GetParticipantByAddress(childComplexity, args["address"].(string)), true
case "Query.getParticipantByNitroAddress":
if e.complexity.Query.GetParticipantByNitroAddress == nil {
break
}
args, err := ec.field_Query_getParticipantByNitroAddress_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.GetParticipantByNitroAddress(childComplexity, args["nitroAddress"].(string)), true
case "Query.getParticipants":
if e.complexity.Query.GetParticipants == nil {
break
@@ -796,7 +873,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return 0, false
}
return e.complexity.Query.QueryRecords(childComplexity, args["attributes"].([]*KeyValueInput), args["all"].(*bool)), true
return e.complexity.Query.QueryRecords(childComplexity, args["attributes"].([]*KeyValueInput), args["all"].(*bool), args["limit"].(*int), args["offset"].(*int)), true
case "Query.resolveNames":
if e.complexity.Query.ResolveNames == nil {
@@ -1097,6 +1174,21 @@ func (ec *executionContext) field_Query_getAuctionsByIds_args(ctx context.Contex
return args, nil
}
func (ec *executionContext) field_Query_getAuthorities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["owner"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("owner"))
arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
if err != nil {
return nil, err
}
}
args["owner"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_getBondsByIds_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
@@ -1112,6 +1204,36 @@ func (ec *executionContext) field_Query_getBondsByIds_args(ctx context.Context,
return args, nil
}
func (ec *executionContext) field_Query_getParticipantByAddress_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["address"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["address"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_getParticipantByNitroAddress_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 string
if tmp, ok := rawArgs["nitroAddress"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nitroAddress"))
arg0, err = ec.unmarshalNString2string(ctx, tmp)
if err != nil {
return nil, err
}
}
args["nitroAddress"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_getRecordsByIds_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
@@ -1208,6 +1330,24 @@ func (ec *executionContext) field_Query_queryRecords_args(ctx context.Context, r
}
}
args["all"] = arg1
var arg2 *int
if tmp, ok := rawArgs["limit"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
if err != nil {
return nil, err
}
}
args["limit"] = arg2
var arg3 *int
if tmp, ok := rawArgs["offset"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
if err != nil {
return nil, err
}
}
args["offset"] = arg3
return args, nil
}
@@ -2600,6 +2740,110 @@ func (ec *executionContext) fieldContext_AuctionBid_bidAmount(ctx context.Contex
return fc, nil
}
func (ec *executionContext) _Authority_name(ctx context.Context, field graphql.CollectedField, obj *Authority) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Authority_name(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.Name, 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_Authority_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Authority",
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) _Authority_entry(ctx context.Context, field graphql.CollectedField, obj *Authority) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Authority_entry(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.Entry, 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.(*AuthorityRecord)
fc.Result = res
return ec.marshalNAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Authority_entry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Authority",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "ownerAddress":
return ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field)
case "ownerPublicKey":
return ec.fieldContext_AuthorityRecord_ownerPublicKey(ctx, field)
case "height":
return ec.fieldContext_AuthorityRecord_height(ctx, field)
case "status":
return ec.fieldContext_AuthorityRecord_status(ctx, field)
case "bondId":
return ec.fieldContext_AuthorityRecord_bondId(ctx, field)
case "expiryTime":
return ec.fieldContext_AuthorityRecord_expiryTime(ctx, field)
case "auction":
return ec.fieldContext_AuthorityRecord_auction(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type AuthorityRecord", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _AuthorityRecord_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field)
if err != nil {
@@ -3924,6 +4168,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.(string)
fc.Result = 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) {
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) _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 {
@@ -4452,7 +4784,7 @@ func (ec *executionContext) _Query_queryRecords(ctx context.Context, field graph
}()
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return ec.resolvers.Query().QueryRecords(rctx, fc.Args["attributes"].([]*KeyValueInput), fc.Args["all"].(*bool))
return ec.resolvers.Query().QueryRecords(rctx, fc.Args["attributes"].([]*KeyValueInput), fc.Args["all"].(*bool), fc.Args["limit"].(*int), fc.Args["offset"].(*int))
})
if err != nil {
ec.Error(ctx, err)
@@ -4508,6 +4840,64 @@ func (ec *executionContext) fieldContext_Query_queryRecords(ctx context.Context,
return fc, nil
}
func (ec *executionContext) _Query_getAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query_getAuthorities(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 ec.resolvers.Query().GetAuthorities(rctx, fc.Args["owner"].(*string))
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.([]*Authority)
fc.Result = res
return ec.marshalOAuthority2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Query_getAuthorities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext_Authority_name(ctx, field)
case "entry":
return ec.fieldContext_Authority_entry(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Authority", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_getAuthorities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return
}
return fc, nil
}
func (ec *executionContext) _Query_lookupAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query_lookupAuthorities(ctx, field)
if err != nil {
@@ -4836,6 +5226,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)
},
@@ -4843,6 +5237,136 @@ func (ec *executionContext) fieldContext_Query_getParticipants(ctx context.Conte
return fc, nil
}
func (ec *executionContext) _Query_getParticipantByAddress(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query_getParticipantByAddress(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 ec.resolvers.Query().GetParticipantByAddress(rctx, fc.Args["address"].(string))
})
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.(*Participant)
fc.Result = res
return ec.marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Query_getParticipantByAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "cosmosAddress":
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)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_getParticipantByAddress_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return
}
return fc, nil
}
func (ec *executionContext) _Query_getParticipantByNitroAddress(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query_getParticipantByNitroAddress(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 ec.resolvers.Query().GetParticipantByNitroAddress(rctx, fc.Args["nitroAddress"].(string))
})
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.(*Participant)
fc.Result = res
return ec.marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Query_getParticipantByNitroAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "cosmosAddress":
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)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_getParticipantByNitroAddress_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return
}
return fc, nil
}
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query___type(ctx, field)
if err != nil {
@@ -8327,6 +8851,41 @@ func (ec *executionContext) _AuctionBid(ctx context.Context, sel ast.SelectionSe
return out
}
var authorityImplementors = []string{"Authority"}
func (ec *executionContext) _Authority(ctx context.Context, sel ast.SelectionSet, obj *Authority) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, authorityImplementors)
out := graphql.NewFieldSet(fields)
var invalids uint32
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Authority")
case "name":
out.Values[i] = ec._Authority_name(ctx, field, obj)
if out.Values[i] == graphql.Null {
invalids++
}
case "entry":
out.Values[i] = ec._Authority_entry(ctx, field, obj)
if out.Values[i] == graphql.Null {
invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch()
if invalids > 0 {
return graphql.Null
}
return out
}
var authorityRecordImplementors = []string{"AuthorityRecord"}
func (ec *executionContext) _AuthorityRecord(ctx context.Context, sel ast.SelectionSet, obj *AuthorityRecord) graphql.Marshaler {
@@ -8798,6 +9357,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++
}
@@ -9013,6 +9586,26 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
}
out.Concurrently(i, func() graphql.Marshaler {
return rrm(innerCtx)
})
case "getAuthorities":
field := field
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_getAuthorities(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
}
out.Concurrently(i, func() graphql.Marshaler {
return rrm(innerCtx)
})
@@ -9125,6 +9718,52 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
}
out.Concurrently(i, func() graphql.Marshaler {
return rrm(innerCtx)
})
case "getParticipantByAddress":
field := field
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_getParticipantByAddress(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
}
out.Concurrently(i, func() graphql.Marshaler {
return rrm(innerCtx)
})
case "getParticipantByNitroAddress":
field := field
innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_getParticipantByNitroAddress(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc)
}
out.Concurrently(i, func() graphql.Marshaler {
return rrm(innerCtx)
})
@@ -9813,6 +10452,16 @@ func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgitᚗvdbᚗtoᚋcerc
return ret
}
func (ec *executionContext) marshalNAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._AuthorityRecord(ctx, sel, v)
}
func (ec *executionContext) marshalNBond2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
@@ -9951,6 +10600,10 @@ func (ec *executionContext) marshalNNodeInfo2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlac
return ec._NodeInfo(ctx, sel, v)
}
func (ec *executionContext) marshalNParticipant2gitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v Participant) graphql.Marshaler {
return ec._Participant(ctx, sel, &v)
}
func (ec *executionContext) marshalNParticipant2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v []*Participant) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
@@ -9989,6 +10642,16 @@ func (ec *executionContext) marshalNParticipant2ᚕᚖgitᚗvdbᚗtoᚋcercᚑio
return ret
}
func (ec *executionContext) marshalNParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v *Participant) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Participant(ctx, sel, v)
}
func (ec *executionContext) marshalNRecord2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
@@ -10586,6 +11249,54 @@ func (ec *executionContext) marshalOAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋl
return ec._AuctionBid(ctx, sel, v)
}
func (ec *executionContext) marshalOAuthority2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v []*Authority) graphql.Marshaler {
if v == nil {
return graphql.Null
}
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalOAuthority2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
return ret
}
func (ec *executionContext) marshalOAuthority2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v *Authority) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._Authority(ctx, sel, v)
}
func (ec *executionContext) marshalOAuthorityRecord2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler {
if v == nil {
return graphql.Null
+7
View File
@@ -52,6 +52,11 @@ type AuctionBid struct {
BidAmount *Coin `json:"bidAmount"`
}
type Authority struct {
Name string `json:"name"`
Entry *AuthorityRecord `json:"entry"`
}
type AuthorityRecord struct {
OwnerAddress string `json:"ownerAddress"`
OwnerPublicKey string `json:"ownerPublicKey"`
@@ -138,6 +143,8 @@ type OwnerBonds struct {
type Participant struct {
CosmosAddress string `json:"cosmosAddress"`
NitroAddress string `json:"nitroAddress"`
Role string `json:"role"`
KycID string `json:"kycId"`
}
type PeerInfo struct {
+77 -20
View File
@@ -8,6 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
types "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
@@ -35,6 +36,36 @@ func (r *Resolver) Query() QueryResolver {
type queryResolver struct{ *Resolver }
func (q queryResolver) GetAuthorities(ctx context.Context, owner *string) ([]*Authority, error) {
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
authoritiesReq := &registrytypes.QueryAuthoritiesRequest{}
if owner != nil {
authoritiesReq.Owner = *owner
}
authoritiesResp, err := nsQueryClient.Authorities(ctx, authoritiesReq)
if err != nil {
return nil, err
}
authorities := make([]*Authority, len(authoritiesResp.GetAuthorities()))
for i, a := range authoritiesResp.Authorities {
entry, err := getAuthorityRecord(*a.Entry, auctionQueryClient)
if err != nil {
return nil, err
}
authorities[i] = &Authority{
Name: a.Name,
Entry: entry,
}
}
return authorities, nil
}
func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) {
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
@@ -52,29 +83,11 @@ func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([
}
nameAuthority := res.GetNameAuthority()
gqlNameAuthorityRecord, err := GetGQLNameAuthorityRecord(&nameAuthority)
gqlNameAuthorityRecord, err := getAuthorityRecord(nameAuthority, auctionQueryClient)
if err != nil {
return nil, err
}
if nameAuthority.AuctionId != "" {
auctionResp, err := auctionQueryClient.GetAuction(context.Background(), &auctiontypes.QueryGetAuctionRequest{Id: nameAuthority.GetAuctionId()})
if err != nil {
return nil, err
}
bidsResp, err := auctionQueryClient.GetBids(context.Background(), &auctiontypes.QueryGetBidsRequest{AuctionId: nameAuthority.GetAuctionId()})
if err != nil {
return nil, err
}
gqlAuctionRecord, err := GetGQLAuction(auctionResp.GetAuction(), bidsResp.GetBids())
if err != nil {
return nil, err
}
gqlNameAuthorityRecord.Auction = gqlAuctionRecord
}
gqlResponse = append(gqlResponse, gqlNameAuthorityRecord)
}
@@ -124,14 +137,20 @@ func (q queryResolver) LookupNames(ctx context.Context, names []string) ([]*Name
return gqlResponse, nil
}
func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error) {
func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool, limit *int, offset *int) ([]*Record, error) {
nsQueryClient := registrytypes.NewQueryClient(q.ctx)
pagination := &query.PageRequest{
Limit: uint64(*limit),
Offset: uint64(*offset),
}
res, err := nsQueryClient.Records(
context.Background(),
&registrytypes.QueryRecordsRequest{
Attributes: toRPCAttributes(attributes),
All: (all != nil && *all),
Pagination: pagination,
},
)
if err != nil {
@@ -373,8 +392,46 @@ func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, err
participants[i] = &Participant{
CosmosAddress: p.CosmosAddress,
NitroAddress: p.NitroAddress,
Role: p.Role,
KycID: p.KycId,
}
}
return participants, nil
}
func (q queryResolver) GetParticipantByAddress(ctx context.Context, address string) (*Participant, error) {
onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx)
participantResp, err := onboardingQueryClient.GetParticipantByAddress(ctx, &onboardingTypes.QueryGetParticipantByAddressRequest{Address: address})
if err != nil {
return nil, err
}
p := participantResp.Participant
participant := &Participant{
CosmosAddress: p.CosmosAddress,
NitroAddress: p.NitroAddress,
Role: p.Role,
KycID: p.KycId,
}
return participant, nil
}
func (q queryResolver) GetParticipantByNitroAddress(ctx context.Context, nitroAddress string) (*Participant, error) {
onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx)
participantResp, err := onboardingQueryClient.GetParticipantByNitroAddress(ctx, &onboardingTypes.QueryGetParticipantByNitroAddressRequest{NitroAddress: nitroAddress})
if err != nil {
return nil, err
}
p := participantResp.Participant
participant := &Participant{
CosmosAddress: p.CosmosAddress,
NitroAddress: p.NitroAddress,
Role: p.Role,
KycID: p.KycId,
}
return participant, nil
}
+27
View File
@@ -303,3 +303,30 @@ func toRPCAttributes(attrs []*KeyValueInput) []*registrytypes.QueryRecordsReques
return kvPairs
}
func getAuthorityRecord(nameAuthority registrytypes.NameAuthority, auctionQueryClient auctiontypes.QueryClient) (*AuthorityRecord, error) {
gqlNameAuthorityRecord, err := GetGQLNameAuthorityRecord(&nameAuthority)
if err != nil {
return nil, err
}
if nameAuthority.AuctionId != "" {
auctionResp, err := auctionQueryClient.GetAuction(context.Background(), &auctiontypes.QueryGetAuctionRequest{Id: nameAuthority.GetAuctionId()})
if err != nil {
return nil, err
}
bidsResp, err := auctionQueryClient.GetBids(context.Background(), &auctiontypes.QueryGetBidsRequest{AuctionId: nameAuthority.GetAuctionId()})
if err != nil {
return nil, err
}
gqlAuctionRecord, err := GetGQLAuction(auctionResp.GetAuction(), bidsResp.GetBids())
if err != nil {
return nil, err
}
gqlNameAuthorityRecord.Auction = gqlAuctionRecord
}
return gqlNameAuthorityRecord, nil
}
+10
View File
@@ -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)
string 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
+42 -1
View File
@@ -16,6 +16,19 @@ service Query {
returns (QueryParticipantsResponse) {
option (google.api.http).get = "/cerc/onboarding/v1/participants";
}
// GetParticipantByAddress queries a participant by cosmos (laconic) address
rpc GetParticipantByAddress(QueryGetParticipantByAddressRequest)
returns (QueryGetParticipantByAddressResponse) {
option (google.api.http).get = "/cerc/onboarding/v1/participants/{address}";
}
// GetParticipantByNitroAddress queries a participant by nitro address
rpc GetParticipantByNitroAddress(QueryGetParticipantByNitroAddressRequest)
returns (QueryGetParticipantByNitroAddressResponse) {
option (google.api.http).get =
"/cerc/onboarding/v1/participants/{nitro_address}";
}
}
// QueryParticipantsRequest queries participants
@@ -24,7 +37,7 @@ message QueryParticipantsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryParticipantsResponse is response type for get the participants
// QueryParticipantsResponse is response type for querying the participants
message QueryParticipantsResponse {
repeated Participant participants = 1
[ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ];
@@ -32,3 +45,31 @@ message QueryParticipantsResponse {
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryGetParticipantByAddressRequest queries participant by the laconic
// address
message QueryGetParticipantByAddressRequest {
// Laconic address
string address = 1;
}
// QueryGetParticipantByAddressResponse is response type for querying
// participant by the laconic address
message QueryGetParticipantByAddressResponse {
// Participant details
Participant participant = 1;
}
// QueryGetParticipantByNitroAddressRequest queries participant by the nitro
// address
message QueryGetParticipantByNitroAddressRequest {
// Nitro address
string nitro_address = 1;
}
// QueryGetParticipantByNitroAddressResponse is response type for querying
// participant by the nitro address
message QueryGetParticipantByNitroAddressResponse {
// Participant details
Participant participant = 1;
}
+2
View File
@@ -28,6 +28,8 @@ message MsgOnboardParticipant {
string participant = 1;
EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ];
string eth_signature = 3;
string role = 4;
string kyc_id = 5;
}
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
+40 -9
View File
@@ -1,10 +1,14 @@
#!/bin/bash
KEY="alice"
CHAINID="laconic_9000-1"
MONIKER="localtestnet"
KEYRING="test"
LOGLEVEL="${LOGLEVEL:-info}"
CHAINID=${CHAINID:-"laconic_9000-1"}
MONIKER=${MONIKER:-"localtestnet"}
KEYRING=${KEYRING:-"test"}
DENOM=${DENOM:-"alnt"}
STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"}
LOGLEVEL=${LOGLEVEL:-"info"}
input_genesis_file=${GENESIS_FILE}
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
# validate dependencies are installed
@@ -27,7 +31,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
laconicd keys add $KEY --keyring-backend $KEYRING
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
laconicd init $MONIKER --chain-id $CHAINID --default-denom photon
laconicd init $MONIKER --chain-id $CHAINID --default-denom $DENOM
if [[ -f ${input_genesis_file} ]]; then
# Use provided genesis config
cp $input_genesis_file $HOME/.laconicd/config/genesis.json
fi
update_genesis() {
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
@@ -58,6 +67,26 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
update_genesis '.app_state["onboarding"]["params"]["onboarding_enabled"]=true'
fi
if [[ "$AUTHORITY_AUCTION_ENABLED" == "true" ]]; then
echo "Enabling authority auctions."
update_genesis '.app_state["registry"]["params"]["authority_auction_enabled"]=true'
fi
if [[ -n $AUTHORITY_AUCTION_COMMITS_DURATION ]]; then
echo "Setting authority_auction_commits_duration to $AUTHORITY_AUCTION_COMMITS_DURATION seconds."
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_commits_duration\"]=\"${AUTHORITY_AUCTION_COMMITS_DURATION}s\""
fi
if [[ -n $AUTHORITY_AUCTION_REVEALS_DURATION ]]; then
echo "Setting authority_auction_reveals_duration to $AUTHORITY_AUCTION_REVEALS_DURATION seconds."
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_reveals_duration\"]=\"${AUTHORITY_AUCTION_REVEALS_DURATION}s\""
fi
if [[ -n $AUTHORITY_GRACE_PERIOD ]]; then
echo "Setting authority_grace_period to $AUTHORITY_GRACE_PERIOD seconds."
update_genesis ".app_state[\"registry\"][\"params\"][\"authority_grace_period\"]=\"${AUTHORITY_GRACE_PERIOD}s\""
fi
# increase block time (?)
update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"'
@@ -70,7 +99,7 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
else
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
fi
# Run this to allow requests from any origin
sed -i 's/cors_allowed_origins.*$/cors_allowed_origins = ["*"]/' $HOME/.laconicd/config/config.toml
@@ -86,10 +115,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
fi
# Allocate genesis accounts (cosmos formatted addresses)
laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING
# 10^30 alnt | 10^12 lnt
laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING
# Sign genesis transaction
laconicd genesis gentx $KEY 1000000000000000000000photon --keyring-backend $KEYRING --chain-id $CHAINID
# 10^15 alnt
laconicd genesis gentx $KEY $STAKING_AMOUNT$DENOM --keyring-backend $KEYRING --chain-id $CHAINID
# Collect genesis tx
laconicd genesis collect-gentxs
@@ -104,7 +135,7 @@ fi
laconicd start \
--pruning=nothing \
--log_level $LOGLEVEL \
--minimum-gas-prices=0.0001photon \
--minimum-gas-prices=1$DENOM \
--api.enable \
--rpc.laddr="tcp://0.0.0.0:26657" \
--gql-server --gql-playground
@@ -324,7 +324,7 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au
}
// Create funded account(s)
accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(100))
accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(1000000))
params, err := k.GetParams(ctx)
if err != nil {
@@ -49,7 +49,7 @@ func (kts *KeeperTestSuite) createBond() (*bondTypes.Bond, error) {
ctx := kts.SdkCtx
// Create a funded account
kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(100000000000))
kts.accounts = simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, 1, math.NewInt(1000000000000))
bond, err := kts.BondKeeper.CreateBond(ctx, kts.accounts[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000000))))
if err != nil {
+7 -6
View File
@@ -13,9 +13,10 @@ import (
var (
DefaultCommitsDuration = 5 * time.Minute
DefaultRevealsDuration = 5 * time.Minute
DefaultCommitFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom}
DefaultRevealFee = sdk.Coin{Amount: sdkmath.NewInt(10), Denom: sdk.DefaultBondDenom}
DefaultMinimumBid = sdk.Coin{Amount: sdkmath.NewInt(1000), Denom: sdk.DefaultBondDenom}
DefaultCommitFee = sdkmath.NewInt(1000) // 10^3 alnt
DefaultRevealFee = sdkmath.NewInt(1000) // 10^3 alnt
DefaultMinimumBid = sdkmath.NewInt(1000000) // 10^6 alnt
)
func NewParams(commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params {
@@ -33,9 +34,9 @@ func DefaultParams() Params {
return Params{
CommitsDuration: DefaultCommitsDuration,
RevealsDuration: DefaultRevealsDuration,
CommitFee: DefaultCommitFee,
RevealFee: DefaultRevealFee,
MinimumBid: DefaultMinimumBid,
CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee),
RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee),
MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid),
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ import (
)
// DefaultMaxBondAmountTokens are the default parameter values.
var DefaultMaxBondAmountTokens = sdkmath.NewInt(100000000000)
var DefaultMaxBondAmountTokens = sdkmath.NewInt(1000000000000) // 10^12 alnt
func NewParams(maxBondAmount sdk.Coin) Params {
return Params{MaxBondAmount: maxBondAmount}
+35
View File
@@ -2,6 +2,7 @@ package keeper
import (
"encoding/json"
"errors"
"fmt"
"cosmossdk.io/collections"
@@ -100,6 +101,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 {
@@ -134,3 +137,35 @@ func (k Keeper) ListParticipants(ctx sdk.Context) ([]*onboardingTypes.Participan
return participants, nil
}
// GetParticipantByAddress - get participant by cosmos (laconic) address.
func (k Keeper) GetParticipantByAddress(ctx sdk.Context, address string) (onboardingTypes.Participant, error) {
participant, err := k.Participants.Get(ctx, address)
if err != nil {
if errors.Is(err, collections.ErrNotFound) {
return onboardingTypes.Participant{}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "participant with given address not found.")
}
return onboardingTypes.Participant{}, err
}
return participant, nil
}
// GetParticipantByNitroAddress - get participant by nitro address.
func (k Keeper) GetParticipantByNitroAddress(ctx sdk.Context, nitroAddress string) (onboardingTypes.Participant, error) {
var participant onboardingTypes.Participant
err := k.Participants.Walk(ctx, nil, func(key string, value onboardingTypes.Participant) (bool, error) {
if value.NitroAddress == nitroAddress {
participant = value
return true, nil
}
return false, nil
})
if err != nil {
return onboardingTypes.Participant{}, err
}
return participant, nil
}
+40
View File
@@ -3,7 +3,9 @@ package keeper
import (
"context"
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
onboardingtypes "git.vdb.to/cerc-io/laconicd/x/onboarding"
)
@@ -33,3 +35,41 @@ func (qs queryServer) Participants(
return &onboardingtypes.QueryParticipantsResponse{Participants: resp}, nil
}
// GetParticipantByAddress implements the GetParticipantByAddress query.
func (qs queryServer) GetParticipantByAddress(
c context.Context,
req *onboardingtypes.QueryGetParticipantByAddressRequest,
) (*onboardingtypes.QueryGetParticipantByAddressResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
if req.Address == "" {
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cosmos (laconic) address is required")
}
participant, err := qs.k.GetParticipantByAddress(ctx, req.Address)
if err != nil {
return nil, err
}
return &onboardingtypes.QueryGetParticipantByAddressResponse{Participant: &participant}, nil
}
// GetParticipantByNitroAddress implements the GetParticipantByNitroAddress query.
func (qs queryServer) GetParticipantByNitroAddress(
c context.Context,
req *onboardingtypes.QueryGetParticipantByNitroAddressRequest,
) (*onboardingtypes.QueryGetParticipantByNitroAddressResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
if req.NitroAddress == "" {
return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "nitro address is required")
}
participant, err := qs.k.GetParticipantByNitroAddress(ctx, req.NitroAddress)
if err != nil {
return nil, err
}
return &onboardingtypes.QueryGetParticipantByNitroAddressResponse{Participant: &participant}, nil
}
+19 -1
View File
@@ -18,6 +18,22 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Short: "List participants",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
},
{
RpcMethod: "GetParticipantByAddress",
Use: "get-by-address [address]",
Short: "Get participant by address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "address"},
},
},
{
RpcMethod: "GetParticipantByNitroAddress",
Use: "get-by-nitro-address [nitro_address]",
Short: "Get participant by nitro address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "nitro_address"},
},
},
},
},
// TODO: Use JSON file for input
@@ -26,11 +42,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"},
},
},
},
+21 -1
View File
@@ -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 {
@@ -18,7 +22,23 @@ 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 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
+133 -24
View File
@@ -71,8 +71,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 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"`
}
func (m *Participant) Reset() { *m = Participant{} }
@@ -122,6 +128,20 @@ func (m *Participant) GetNitroAddress() string {
return ""
}
func (m *Participant) GetRole() string {
if m != nil {
return m.Role
}
return ""
}
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"`
@@ -186,29 +206,32 @@ 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, 0x94, 0xb6, 0x5d,
0x9c, 0x54, 0xd2, 0x9c, 0xa0, 0xe6, 0x88, 0x70, 0x92, 0x08, 0xfc, 0x82, 0xf0, 0xba, 0x30, 0x0e,
0x19, 0xf1, 0xe2, 0x30, 0x38, 0xd7, 0xda, 0x5a, 0x67, 0xdf, 0xb9, 0xcb, 0x33, 0x63, 0xf0, 0x26,
0x80, 0xdd, 0x9b, 0x7f, 0x33, 0x66, 0x7b, 0x4a, 0x92, 0xf8, 0x5f, 0xc7, 0x3d, 0x59, 0x8b, 0xc3,
0xa5, 0xf6, 0xa9, 0xa1, 0xc3, 0x11, 0xe1, 0x92, 0xfa, 0x74, 0x42, 0x98, 0xc4, 0x4f, 0xe8, 0xd8,
0x07, 0x91, 0x80, 0x18, 0x93, 0x20, 0xe0, 0xa1, 0x10, 0xe5, 0xce, 0x03, 0xc7, 0xce, 0x33, 0xa3,
0xab, 0x76, 0xd6, 0xfd, 0x6a, 0xdf, 0x96, 0xea, 0xb6, 0x94, 0xf0, 0xa8, 0x66, 0xec, 0xa2, 0x16,
0xa3, 0x92, 0xc3, 0x0a, 0xbb, 0x53, 0x62, 0x7b, 0x79, 0x66, 0xdc, 0x2a, 0x6c, 0xcd, 0xae, 0xa8,
0x75, 0xd1, 0x3d, 0x2a, 0xe7, 0x25, 0xd3, 0x4c, 0x11, 0x1a, 0xca, 0xd7, 0x11, 0x99, 0xc6, 0x40,
0x02, 0xfc, 0x80, 0xf6, 0xea, 0x57, 0xbe, 0xce, 0x33, 0xe3, 0x4a, 0xb1, 0xb7, 0xa8, 0x2b, 0x5e,
0xd5, 0xc0, 0x5d, 0xb4, 0x9b, 0x88, 0x68, 0x79, 0xa9, 0x8b, 0x3c, 0x33, 0xce, 0x54, 0x31, 0x11,
0x51, 0x55, 0x2a, 0x8e, 0x6e, 0x91, 0x72, 0x9c, 0xaf, 0xb9, 0xae, 0xcd, 0xe6, 0xba, 0xf6, 0x33,
0xd7, 0xb5, 0x8f, 0x85, 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,
// 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, 0xad, 0xb1, 0x35, 0xb9, 0xe7, 0xbd,
0xab, 0x4a, 0xb4, 0xf8, 0xae, 0x44, 0xfa, 0xde, 0xf9, 0xdf, 0xe3, 0x8c, 0x0b, 0x92, 0xc4, 0xb7,
0x4e, 0xfc, 0xc7, 0x67, 0x71, 0x79, 0xd4, 0x7e, 0xdd, 0x80, 0x07, 0x2b, 0x22, 0x33, 0x4e, 0xf9,
0x96, 0xa4, 0x19, 0xfc, 0x0c, 0x1e, 0x51, 0xa1, 0x12, 0xa1, 0xd6, 0x84, 0x31, 0x19, 0x2a, 0xa5,
0x77, 0xde, 0xf7, 0x70, 0x55, 0xa2, 0xa9, 0xd9, 0xd9, 0x9e, 0x37, 0xfb, 0xae, 0x54, 0x7f, 0x60,
0x84, 0x8f, 0xa6, 0x87, 0x3e, 0x18, 0xa4, 0x3c, 0x93, 0xe2, 0x84, 0xbd, 0xd1, 0xd8, 0x59, 0x55,
0xa2, 0x37, 0x06, 0xdb, 0x1a, 0x37, 0xd4, 0xb6, 0xe8, 0x3f, 0xd4, 0x7d, 0xc3, 0xc4, 0xa0, 0x27,
0x45, 0x1c, 0x0e, 0xbb, 0x1a, 0x35, 0xaa, 0x4a, 0xf4, 0xcc, 0xa0, 0x6a, 0xb5, 0x21, 0xe8, 0xda,
0xd7, 0x46, 0xf8, 0x16, 0xf4, 0x37, 0x05, 0x5d, 0x73, 0x36, 0xec, 0xe9, 0x08, 0xaa, 0x4a, 0x34,
0x32, 0x11, 0xa3, 0x37, 0xa1, 0x63, 0xe7, 0xdf, 0xd9, 0x14, 0xf4, 0x13, 0x73, 0x72, 0x00, 0x96,
0xd9, 0xb7, 0x15, 0x29, 0x62, 0x41, 0x18, 0xfc, 0x00, 0xee, 0xb6, 0xff, 0xcd, 0xab, 0xaa, 0x44,
0x2f, 0x0d, 0xe6, 0xea, 0xf9, 0xa7, 0x87, 0x37, 0x09, 0x38, 0x05, 0xdd, 0x44, 0x45, 0xc7, 0xaf,
0x7f, 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) {
@@ -264,6 +287,20 @@ 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 len(m.Role) > 0 {
i -= len(m.Role)
copy(dAtA[i:], m.Role)
i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Role)))
i--
dAtA[i] = 0x1a
}
if len(m.NitroAddress) > 0 {
i -= len(m.NitroAddress)
copy(dAtA[i:], m.NitroAddress)
@@ -355,6 +392,14 @@ func (m *Participant) Size() (n int) {
if l > 0 {
n += 1 + l + sovOnboarding(uint64(l))
}
l = len(m.Role)
if l > 0 {
n += 1 + l + sovOnboarding(uint64(l))
}
l = len(m.KycId)
if l > 0 {
n += 1 + l + sovOnboarding(uint64(l))
}
return n
}
@@ -544,6 +589,70 @@ func (m *Participant) Unmarshal(dAtA []byte) error {
}
m.NitroAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Role", 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.Role = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
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:])
+828 -26
View File
@@ -76,7 +76,7 @@ func (m *QueryParticipantsRequest) GetPagination() *query.PageRequest {
return nil
}
// QueryParticipantsResponse is response type for get the participants
// QueryParticipantsResponse is response type for querying the participants
type QueryParticipantsResponse struct {
Participants []*Participant `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty" json:"participants" yaml:"participants"`
// pagination defines the pagination in the response.
@@ -130,39 +130,247 @@ func (m *QueryParticipantsResponse) GetPagination() *query.PageResponse {
return nil
}
// QueryGetParticipantByAddressRequest queries participant by the laconic
// address
type QueryGetParticipantByAddressRequest struct {
// Laconic address
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}
func (m *QueryGetParticipantByAddressRequest) Reset() { *m = QueryGetParticipantByAddressRequest{} }
func (m *QueryGetParticipantByAddressRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetParticipantByAddressRequest) ProtoMessage() {}
func (*QueryGetParticipantByAddressRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_80831d904221d27d, []int{2}
}
func (m *QueryGetParticipantByAddressRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetParticipantByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetParticipantByAddressRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *QueryGetParticipantByAddressRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetParticipantByAddressRequest.Merge(m, src)
}
func (m *QueryGetParticipantByAddressRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryGetParticipantByAddressRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetParticipantByAddressRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetParticipantByAddressRequest proto.InternalMessageInfo
func (m *QueryGetParticipantByAddressRequest) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
// QueryGetParticipantByAddressResponse is response type for querying
// participant by the laconic address
type QueryGetParticipantByAddressResponse struct {
// Participant details
Participant *Participant `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
}
func (m *QueryGetParticipantByAddressResponse) Reset() { *m = QueryGetParticipantByAddressResponse{} }
func (m *QueryGetParticipantByAddressResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetParticipantByAddressResponse) ProtoMessage() {}
func (*QueryGetParticipantByAddressResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_80831d904221d27d, []int{3}
}
func (m *QueryGetParticipantByAddressResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetParticipantByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetParticipantByAddressResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *QueryGetParticipantByAddressResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetParticipantByAddressResponse.Merge(m, src)
}
func (m *QueryGetParticipantByAddressResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryGetParticipantByAddressResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetParticipantByAddressResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetParticipantByAddressResponse proto.InternalMessageInfo
func (m *QueryGetParticipantByAddressResponse) GetParticipant() *Participant {
if m != nil {
return m.Participant
}
return nil
}
// QueryGetParticipantByNitroAddressRequest queries participant by the nitro
// address
type QueryGetParticipantByNitroAddressRequest struct {
// Nitro address
NitroAddress string `protobuf:"bytes,1,opt,name=nitro_address,json=nitroAddress,proto3" json:"nitro_address,omitempty"`
}
func (m *QueryGetParticipantByNitroAddressRequest) Reset() {
*m = QueryGetParticipantByNitroAddressRequest{}
}
func (m *QueryGetParticipantByNitroAddressRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetParticipantByNitroAddressRequest) ProtoMessage() {}
func (*QueryGetParticipantByNitroAddressRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_80831d904221d27d, []int{4}
}
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.Merge(m, src)
}
func (m *QueryGetParticipantByNitroAddressRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryGetParticipantByNitroAddressRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetParticipantByNitroAddressRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetParticipantByNitroAddressRequest proto.InternalMessageInfo
func (m *QueryGetParticipantByNitroAddressRequest) GetNitroAddress() string {
if m != nil {
return m.NitroAddress
}
return ""
}
// QueryGetParticipantByNitroAddressResponse is response type for querying
// participant by the nitro address
type QueryGetParticipantByNitroAddressResponse struct {
// Participant details
Participant *Participant `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
}
func (m *QueryGetParticipantByNitroAddressResponse) Reset() {
*m = QueryGetParticipantByNitroAddressResponse{}
}
func (m *QueryGetParticipantByNitroAddressResponse) String() string {
return proto.CompactTextString(m)
}
func (*QueryGetParticipantByNitroAddressResponse) ProtoMessage() {}
func (*QueryGetParticipantByNitroAddressResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_80831d904221d27d, []int{5}
}
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.Merge(m, src)
}
func (m *QueryGetParticipantByNitroAddressResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryGetParticipantByNitroAddressResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetParticipantByNitroAddressResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetParticipantByNitroAddressResponse proto.InternalMessageInfo
func (m *QueryGetParticipantByNitroAddressResponse) GetParticipant() *Participant {
if m != nil {
return m.Participant
}
return nil
}
func init() {
proto.RegisterType((*QueryParticipantsRequest)(nil), "cerc.onboarding.v1.QueryParticipantsRequest")
proto.RegisterType((*QueryParticipantsResponse)(nil), "cerc.onboarding.v1.QueryParticipantsResponse")
proto.RegisterType((*QueryGetParticipantByAddressRequest)(nil), "cerc.onboarding.v1.QueryGetParticipantByAddressRequest")
proto.RegisterType((*QueryGetParticipantByAddressResponse)(nil), "cerc.onboarding.v1.QueryGetParticipantByAddressResponse")
proto.RegisterType((*QueryGetParticipantByNitroAddressRequest)(nil), "cerc.onboarding.v1.QueryGetParticipantByNitroAddressRequest")
proto.RegisterType((*QueryGetParticipantByNitroAddressResponse)(nil), "cerc.onboarding.v1.QueryGetParticipantByNitroAddressResponse")
}
func init() { proto.RegisterFile("cerc/onboarding/v1/query.proto", fileDescriptor_80831d904221d27d) }
var fileDescriptor_80831d904221d27d = []byte{
// 380 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0x6a, 0x1b, 0x31,
0x1c, 0xc7, 0x2d, 0x97, 0x76, 0x90, 0x3d, 0x89, 0x0e, 0xae, 0x29, 0xe7, 0xe3, 0x0a, 0xf5, 0xd1,
0xd6, 0x12, 0xe7, 0x6e, 0x1d, 0x3d, 0xb4, 0xab, 0xeb, 0xb1, 0x9b, 0xee, 0x2c, 0x84, 0x8a, 0xad,
0xdf, 0xf9, 0x24, 0x1f, 0xf5, 0xda, 0x27, 0x28, 0x94, 0xce, 0x7d, 0x9d, 0x8c, 0x86, 0x40, 0xc8,
0x14, 0x82, 0x9d, 0x27, 0xc8, 0x13, 0x84, 0x3b, 0x19, 0x2c, 0x27, 0x17, 0x92, 0x4d, 0xe8, 0xf7,
0xfb, 0xfe, 0xf9, 0x08, 0xe1, 0x20, 0x13, 0x45, 0xc6, 0x40, 0xa7, 0xc0, 0x8b, 0xb9, 0xd2, 0x92,
0x95, 0x09, 0x5b, 0xad, 0x45, 0xb1, 0xa1, 0x79, 0x01, 0x16, 0x08, 0xa9, 0xe6, 0xf4, 0x38, 0xa7,
0x65, 0xd2, 0x7f, 0x2d, 0x41, 0x42, 0x3d, 0x66, 0xd5, 0xc9, 0x6d, 0xf6, 0x3f, 0x64, 0x60, 0x96,
0x60, 0x58, 0xca, 0x8d, 0x70, 0x16, 0xac, 0x4c, 0x52, 0x61, 0x79, 0xc2, 0x72, 0x2e, 0x95, 0xe6,
0x56, 0x81, 0x3e, 0xec, 0xbe, 0x6b, 0x48, 0xf5, 0x32, 0xdc, 0xd2, 0x5b, 0x09, 0x20, 0x17, 0x82,
0xf1, 0x5c, 0x31, 0xae, 0x35, 0xd8, 0xda, 0xc1, 0xb8, 0x69, 0x94, 0xe2, 0xde, 0xf7, 0x2a, 0x64,
0xca, 0x0b, 0xab, 0x32, 0x95, 0x73, 0x6d, 0xcd, 0x4c, 0xac, 0xd6, 0xc2, 0x58, 0xf2, 0x15, 0xe3,
0x63, 0x64, 0x0f, 0x85, 0x28, 0xee, 0x8c, 0xdf, 0x53, 0xd7, 0x8f, 0x56, 0xfd, 0xa8, 0x43, 0x3c,
0xf4, 0xa3, 0x53, 0x2e, 0xc5, 0x41, 0x3b, 0xf3, 0x94, 0xd1, 0x05, 0xc2, 0x6f, 0x1a, 0x42, 0x4c,
0x0e, 0xda, 0x08, 0x92, 0xe3, 0x6e, 0xee, 0xdd, 0xf7, 0x50, 0xf8, 0x22, 0xee, 0x8c, 0x07, 0xf4,
0xe1, 0x8b, 0x51, 0x4f, 0x3f, 0xf9, 0x78, 0x7b, 0x35, 0x18, 0xfe, 0x34, 0xa0, 0xbf, 0x44, 0xbe,
0x3c, 0x0a, 0x37, 0x7c, 0xb9, 0xb8, 0x77, 0x37, 0x3b, 0x49, 0x20, 0xdf, 0x4e, 0xb8, 0xda, 0x35,
0xd7, 0xf0, 0x49, 0x2e, 0x57, 0xd7, 0x07, 0x1b, 0xff, 0x47, 0xf8, 0x65, 0x0d, 0x46, 0xfe, 0x21,
0xdc, 0xf5, 0xe9, 0xc8, 0xa7, 0xa6, 0xfe, 0x8f, 0xbd, 0x74, 0x7f, 0xf4, 0xcc, 0x6d, 0xd7, 0x21,
0x8a, 0x7f, 0x9f, 0xdf, 0xfc, 0x6d, 0x47, 0x24, 0x64, 0x0d, 0x1f, 0xc0, 0x47, 0x9d, 0x4c, 0xce,
0x76, 0x01, 0xda, 0xee, 0x02, 0x74, 0xbd, 0x0b, 0xd0, 0x9f, 0x7d, 0xd0, 0xda, 0xee, 0x83, 0xd6,
0xe5, 0x3e, 0x68, 0xfd, 0x88, 0xa5, 0xb2, 0xb4, 0x9c, 0xa7, 0xd4, 0x42, 0xed, 0x32, 0x52, 0xc0,
0x16, 0x3c, 0x03, 0xad, 0xb2, 0x39, 0xfb, 0xe5, 0x79, 0xa6, 0xaf, 0xea, 0x9f, 0xf2, 0xf9, 0x2e,
0x00, 0x00, 0xff, 0xff, 0x3b, 0xb7, 0xca, 0x13, 0xe4, 0x02, 0x00, 0x00,
// 535 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xce, 0x96, 0x3f, 0xb1, 0x09, 0x97, 0x15, 0x12, 0x21, 0xaa, 0xdc, 0xc8, 0x41, 0xd4, 0x94,
0x76, 0x97, 0x98, 0x03, 0x15, 0x02, 0xa1, 0xe6, 0x40, 0x6f, 0x50, 0x7c, 0xe4, 0x82, 0xd6, 0xf6,
0xca, 0x5a, 0x94, 0xee, 0xba, 0xde, 0x6d, 0x44, 0x84, 0x7a, 0xe1, 0x09, 0x90, 0x10, 0x2f, 0xc3,
0x89, 0x23, 0xc7, 0x4a, 0x08, 0xc4, 0x09, 0xa1, 0x84, 0x27, 0xe0, 0x09, 0x90, 0xd7, 0x86, 0xae,
0x8b, 0xf3, 0x03, 0xe2, 0x66, 0xcf, 0xcc, 0x37, 0xdf, 0xf7, 0xcd, 0x8c, 0x0d, 0x9d, 0x88, 0x65,
0x11, 0x91, 0x22, 0x94, 0x34, 0x8b, 0xb9, 0x48, 0xc8, 0xa8, 0x4f, 0x0e, 0x0e, 0x59, 0x36, 0xc6,
0x69, 0x26, 0xb5, 0x44, 0x28, 0xcf, 0xe3, 0x93, 0x3c, 0x1e, 0xf5, 0x3b, 0x97, 0x13, 0x99, 0x48,
0x93, 0x26, 0xf9, 0x53, 0x51, 0xd9, 0xd9, 0x88, 0xa4, 0xda, 0x97, 0x8a, 0x84, 0x54, 0xb1, 0xa2,
0x05, 0x19, 0xf5, 0x43, 0xa6, 0x69, 0x9f, 0xa4, 0x34, 0xe1, 0x82, 0x6a, 0x2e, 0x45, 0x59, 0xdb,
0xab, 0x61, 0xb5, 0x38, 0x8a, 0xa2, 0xd5, 0x44, 0xca, 0x64, 0xc8, 0x08, 0x4d, 0x39, 0xa1, 0x42,
0x48, 0x6d, 0x3a, 0xa8, 0x22, 0xeb, 0x86, 0xb0, 0xfd, 0x24, 0x27, 0xd9, 0xa3, 0x99, 0xe6, 0x11,
0x4f, 0xa9, 0xd0, 0x2a, 0x60, 0x07, 0x87, 0x4c, 0x69, 0xf4, 0x10, 0xc2, 0x13, 0xca, 0x36, 0xe8,
0x02, 0xaf, 0xe9, 0x5f, 0xc7, 0x85, 0x3e, 0x9c, 0xeb, 0xc3, 0x85, 0xc5, 0x52, 0x1f, 0xde, 0xa3,
0x09, 0x2b, 0xb1, 0x81, 0x85, 0x74, 0x3f, 0x03, 0x78, 0xb5, 0x86, 0x44, 0xa5, 0x52, 0x28, 0x86,
0x52, 0xd8, 0x4a, 0xad, 0x78, 0x1b, 0x74, 0xcf, 0x78, 0x4d, 0x7f, 0x0d, 0xff, 0x39, 0x31, 0x6c,
0xe1, 0x07, 0x37, 0x7f, 0x7c, 0x5d, 0x5b, 0x7f, 0xae, 0xa4, 0xb8, 0xeb, 0xda, 0x70, 0xb7, 0x3b,
0xa6, 0xfb, 0xc3, 0x53, 0xb1, 0xa0, 0xc2, 0x80, 0x76, 0x2b, 0xbe, 0x56, 0x8c, 0xaf, 0xf5, 0x85,
0xbe, 0x0a, 0xb9, 0x15, 0x63, 0x0f, 0x60, 0xcf, 0xf8, 0xda, 0x65, 0xda, 0x96, 0x36, 0xde, 0x89,
0xe3, 0x8c, 0xa9, 0xdf, 0x73, 0x6c, 0xc3, 0x0b, 0xb4, 0x88, 0x98, 0x21, 0x5e, 0x0c, 0x7e, 0xbd,
0xba, 0x1c, 0x5e, 0x9b, 0xdf, 0xa0, 0x9c, 0xd1, 0x0e, 0x6c, 0x5a, 0x0e, 0xca, 0x55, 0x2c, 0x1a,
0x51, 0x60, 0x63, 0xdc, 0xc7, 0xd0, 0xab, 0xa5, 0x7a, 0xc4, 0x75, 0x26, 0x4f, 0x09, 0xee, 0xc1,
0x4b, 0x22, 0x0f, 0x3f, 0xab, 0xca, 0x6e, 0x09, 0xab, 0xd6, 0x15, 0xf0, 0xc6, 0x12, 0x0d, 0xff,
0x9b, 0x01, 0xff, 0xdd, 0x59, 0x78, 0xce, 0x10, 0xa2, 0xb7, 0x00, 0xb6, 0xec, 0x53, 0x42, 0x9b,
0x75, 0x8d, 0x66, 0x9d, 0x75, 0x67, 0x6b, 0xc9, 0xea, 0x42, 0xba, 0xeb, 0xbd, 0xfa, 0xf8, 0xfd,
0xcd, 0x8a, 0x8b, 0xba, 0xa4, 0xe6, 0x6b, 0xab, 0xdc, 0xd5, 0x7b, 0x00, 0xaf, 0xcc, 0xd8, 0x24,
0xba, 0x33, 0x93, 0x74, 0xfe, 0xf1, 0x74, 0xb6, 0xff, 0x1e, 0x58, 0x0a, 0xf7, 0x8d, 0xf0, 0x4d,
0xb4, 0xb1, 0x48, 0x38, 0x79, 0x59, 0xee, 0xf9, 0x08, 0x7d, 0x02, 0x70, 0x75, 0xde, 0x42, 0xd1,
0xbd, 0xa5, 0xe5, 0xd4, 0x1c, 0x56, 0xe7, 0xfe, 0x3f, 0xa2, 0x4b, 0x47, 0xdb, 0xc6, 0x91, 0x8f,
0x6e, 0x2d, 0x76, 0x54, 0xb9, 0xdf, 0xa3, 0xc1, 0xe0, 0xc3, 0xc4, 0x01, 0xc7, 0x13, 0x07, 0x7c,
0x9b, 0x38, 0xe0, 0xf5, 0xd4, 0x69, 0x1c, 0x4f, 0x9d, 0xc6, 0x97, 0xa9, 0xd3, 0x78, 0xea, 0x25,
0x5c, 0xe3, 0x51, 0x1c, 0x62, 0x2d, 0x4d, 0xd7, 0x2d, 0x2e, 0xc9, 0x90, 0x46, 0x52, 0xf0, 0x28,
0x26, 0x2f, 0x2c, 0x8e, 0xf0, 0xbc, 0xf9, 0x63, 0xde, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x80,
0xc2, 0x03, 0x70, 0xec, 0x05, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -179,6 +387,10 @@ const _ = grpc.SupportPackageIsVersion4
type QueryClient interface {
// Participants queries Participants list
Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error)
// GetParticipantByAddress queries a participant by cosmos (laconic) address
GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error)
// GetParticipantByNitroAddress queries a participant by nitro address
GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error)
}
type queryClient struct {
@@ -198,10 +410,32 @@ func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsReq
return out, nil
}
func (c *queryClient) GetParticipantByAddress(ctx context.Context, in *QueryGetParticipantByAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByAddressResponse, error) {
out := new(QueryGetParticipantByAddressResponse)
err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Query/GetParticipantByAddress", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetParticipantByNitroAddress(ctx context.Context, in *QueryGetParticipantByNitroAddressRequest, opts ...grpc.CallOption) (*QueryGetParticipantByNitroAddressResponse, error) {
out := new(QueryGetParticipantByNitroAddressResponse)
err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
type QueryServer interface {
// Participants queries Participants list
Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error)
// GetParticipantByAddress queries a participant by cosmos (laconic) address
GetParticipantByAddress(context.Context, *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error)
// GetParticipantByNitroAddress queries a participant by nitro address
GetParticipantByNitroAddress(context.Context, *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@@ -211,6 +445,12 @@ type UnimplementedQueryServer struct {
func (*UnimplementedQueryServer) Participants(ctx context.Context, req *QueryParticipantsRequest) (*QueryParticipantsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented")
}
func (*UnimplementedQueryServer) GetParticipantByAddress(ctx context.Context, req *QueryGetParticipantByAddressRequest) (*QueryGetParticipantByAddressResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByAddress not implemented")
}
func (*UnimplementedQueryServer) GetParticipantByNitroAddress(ctx context.Context, req *QueryGetParticipantByNitroAddressRequest) (*QueryGetParticipantByNitroAddressResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetParticipantByNitroAddress not implemented")
}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
@@ -234,6 +474,42 @@ func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _Query_GetParticipantByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetParticipantByAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetParticipantByAddress(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/cerc.onboarding.v1.Query/GetParticipantByAddress",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetParticipantByAddress(ctx, req.(*QueryGetParticipantByAddressRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetParticipantByNitroAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetParticipantByNitroAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/cerc.onboarding.v1.Query/GetParticipantByNitroAddress",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetParticipantByNitroAddress(ctx, req.(*QueryGetParticipantByNitroAddressRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "cerc.onboarding.v1.Query",
HandlerType: (*QueryServer)(nil),
@@ -242,6 +518,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Participants",
Handler: _Query_Participants_Handler,
},
{
MethodName: "GetParticipantByAddress",
Handler: _Query_GetParticipantByAddress_Handler,
},
{
MethodName: "GetParticipantByNitroAddress",
Handler: _Query_GetParticipantByNitroAddress_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cerc/onboarding/v1/query.proto",
@@ -331,6 +615,136 @@ func (m *QueryParticipantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro
return len(dAtA) - i, nil
}
func (m *QueryGetParticipantByAddressRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *QueryGetParticipantByAddressRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetParticipantByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintQuery(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *QueryGetParticipantByAddressResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *QueryGetParticipantByAddressResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetParticipantByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Participant != nil {
{
size, err := m.Participant.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintQuery(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *QueryGetParticipantByNitroAddressRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *QueryGetParticipantByNitroAddressRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetParticipantByNitroAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.NitroAddress) > 0 {
i -= len(m.NitroAddress)
copy(dAtA[i:], m.NitroAddress)
i = encodeVarintQuery(dAtA, i, uint64(len(m.NitroAddress)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *QueryGetParticipantByNitroAddressResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *QueryGetParticipantByNitroAddressResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetParticipantByNitroAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Participant != nil {
{
size, err := m.Participant.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintQuery(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
offset -= sovQuery(v)
base := offset
@@ -374,6 +788,58 @@ func (m *QueryParticipantsResponse) Size() (n int) {
return n
}
func (m *QueryGetParticipantByAddressRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Address)
if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func (m *QueryGetParticipantByAddressResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Participant != nil {
l = m.Participant.Size()
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func (m *QueryGetParticipantByNitroAddressRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.NitroAddress)
if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func (m *QueryGetParticipantByNitroAddressResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Participant != nil {
l = m.Participant.Size()
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -586,6 +1052,342 @@ func (m *QueryParticipantsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *QueryGetParticipantByAddressRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryGetParticipantByAddressRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetParticipantByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
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 ErrInvalidLengthQuery
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryGetParticipantByAddressResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryGetParticipantByAddressResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetParticipantByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Participant", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Participant == nil {
m.Participant = &Participant{}
}
if err := m.Participant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryGetParticipantByNitroAddressRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field NitroAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
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 ErrInvalidLengthQuery
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.NitroAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryGetParticipantByNitroAddressResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetParticipantByNitroAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Participant", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Participant == nil {
m.Participant = &Participant{}
}
if err := m.Participant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipQuery(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
+202
View File
@@ -69,6 +69,114 @@ func local_request_Query_Participants_0(ctx context.Context, marshaler runtime.M
}
func request_Query_GetParticipantByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetParticipantByAddressRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := client.GetParticipantByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_GetParticipantByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetParticipantByAddressRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address")
}
protoReq.Address, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
}
msg, err := server.GetParticipantByAddress(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_GetParticipantByNitroAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetParticipantByNitroAddressRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["nitro_address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nitro_address")
}
protoReq.NitroAddress, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nitro_address", err)
}
msg, err := client.GetParticipantByNitroAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_GetParticipantByNitroAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetParticipantByNitroAddressRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["nitro_address"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nitro_address")
}
protoReq.NitroAddress, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nitro_address", err)
}
msg, err := server.GetParticipantByNitroAddress(ctx, &protoReq)
return msg, metadata, err
}
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -98,6 +206,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
mux.Handle("GET", pattern_Query_GetParticipantByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_GetParticipantByAddress_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_GetParticipantByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_GetParticipantByNitroAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_GetParticipantByNitroAddress_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_GetParticipantByNitroAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -159,13 +313,61 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
mux.Handle("GET", pattern_Query_GetParticipantByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_GetParticipantByAddress_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_GetParticipantByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_GetParticipantByNitroAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_GetParticipantByNitroAddress_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_GetParticipantByNitroAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Query_Participants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "onboarding", "v1", "participants"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_GetParticipantByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cerc", "onboarding", "v1", "participants", "address"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_GetParticipantByNitroAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cerc", "onboarding", "v1", "participants", "nitro_address"}, "", runtime.AssumeColonVerbOpt(false)))
)
var (
forward_Query_Participants_0 = runtime.ForwardResponseMessage
forward_Query_GetParticipantByAddress_0 = runtime.ForwardResponseMessage
forward_Query_GetParticipantByNitroAddress_0 = runtime.ForwardResponseMessage
)
+129 -25
View File
@@ -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 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"`
}
func (m *MsgOnboardParticipant) Reset() { *m = MsgOnboardParticipant{} }
@@ -92,6 +94,20 @@ func (m *MsgOnboardParticipant) GetEthSignature() string {
return ""
}
func (m *MsgOnboardParticipant) GetRole() string {
if m != nil {
return m.Role
}
return ""
}
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, 0x01,
0x9d, 0x67, 0xd9, 0x99, 0xc4, 0x6e, 0xe1, 0x27, 0x08, 0xfa, 0x08, 0x7d, 0x01, 0xe9, 0xd2, 0x57,
0xf0, 0x28, 0x74, 0xe9, 0x14, 0xa1, 0x81, 0x5f, 0x23, 0x5c, 0x35, 0x17, 0xda, 0xa0, 0xdb, 0xcc,
0xff, 0xf9, 0xf3, 0xff, 0x3d, 0x7f, 0x1e, 0x7c, 0xe4, 0xb1, 0xd0, 0x23, 0x20, 0x3b, 0x40, 0x43,
0x5f, 0x48, 0x4e, 0x06, 0x15, 0xa2, 0x87, 0x6e, 0x10, 0x82, 0x06, 0xd3, 0x5c, 0x0e, 0xdd, 0xed,
0xd0, 0x1d, 0x54, 0xac, 0x43, 0x0f, 0x54, 0x1f, 0x14, 0xe9, 0xab, 0xc8, 0xdb, 0x57, 0x7c, 0x65,
0xb6, 0x8e, 0x39, 0x00, 0xef, 0x31, 0x42, 0x03, 0x41, 0xa8, 0x94, 0xa0, 0xa9, 0x16, 0x20, 0xd5,
0x7a, 0xba, 0xcf, 0x81, 0x43, 0xf4, 0x24, 0xcb, 0xd7, 0x5a, 0x2d, 0x24, 0xd0, 0x63, 0xb8, 0xc8,
0xe4, 0x3c, 0x23, 0x7c, 0xd0, 0x50, 0xfc, 0x72, 0xa5, 0x37, 0x69, 0xa8, 0x85, 0x27, 0x02, 0x2a,
0xb5, 0x99, 0xc7, 0x99, 0x60, 0xfb, 0xcd, 0xa2, 0x3c, 0x2a, 0xfe, 0x6f, 0xc5, 0x25, 0xb3, 0x8e,
0x33, 0x4c, 0x77, 0xdb, 0x01, 0xbd, 0xed, 0x01, 0xf5, 0xb3, 0xa9, 0x3c, 0x2a, 0x66, 0xaa, 0xb6,
0xfb, 0xbd, 0x97, 0x5b, 0xd7, 0xdd, 0xe6, 0xca, 0x55, 0xfb, 0x33, 0x79, 0xcb, 0x19, 0x2d, 0xcc,
0xbe, 0x14, 0xb3, 0x80, 0x77, 0x97, 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,
// 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, 0xef, 0xd8,
0xc8, 0x9d, 0x39, 0x78, 0x2e, 0x01, 0x64, 0x2a, 0x28, 0xcb, 0x14, 0x65, 0x5a, 0x83, 0x65, 0x56,
0x81, 0x36, 0x7b, 0xf5, 0x89, 0x04, 0x09, 0x6e, 0xa4, 0xdb, 0x69, 0x4f, 0x2f, 0x2b, 0xd2, 0x4b,
0x71, 0xce, 0x14, 0x15, 0x08, 0x9f, 0xdf, 0x19, 0xf9, 0x6e, 0xc7, 0xbb, 0x2c, 0xb7, 0x8a, 0xab,
0x8c, 0x69, 0x4b, 0x9a, 0xb8, 0x91, 0x1d, 0x3f, 0x7d, 0xd4, 0x44, 0xad, 0x07, 0xbd, 0x32, 0x22,
0xb7, 0xb8, 0x21, 0xec, 0xb0, 0x9f, 0xb1, 0x59, 0x0a, 0x2c, 0xf1, 0x4f, 0x9a, 0xa8, 0xd5, 0xb8,
0x09, 0xe3, 0x7f, 0x7b, 0xc5, 0xb7, 0x76, 0xd8, 0xdd, 0xb9, 0x3a, 0xb5, 0xe5, 0xcf, 0x0b, 0xaf,
0x87, 0xc5, 0x5f, 0x42, 0x2e, 0xf1, 0xa3, 0xed, 0x1a, 0xa3, 0xa4, 0x66, 0xf6, 0x63, 0x2e, 0xfc,
0x53, 0x17, 0xf5, 0x50, 0xd8, 0xe1, 0xfb, 0x03, 0x23, 0x04, 0xd7, 0x72, 0x48, 0x85, 0x5f, 0x73,
0x9a, 0x9b, 0xc9, 0x39, 0x3e, 0x1b, 0xcd, 0x78, 0x5f, 0x25, 0x7e, 0xdd, 0xd1, 0xfa, 0x68, 0xc6,
0xdf, 0x26, 0x6f, 0x1e, 0xcf, 0x37, 0x8b, 0xeb, 0xf2, 0x8f, 0x46, 0x17, 0xf8, 0x45, 0x65, 0xc7,
0x9e, 0x30, 0x19, 0x68, 0x23, 0x6e, 0xbe, 0x21, 0x7c, 0x7a, 0x67, 0x24, 0xf9, 0x8a, 0x30, 0xa9,
0x38, 0x8a, 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.
@@ -267,6 +285,20 @@ 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 len(m.Role) > 0 {
i -= len(m.Role)
copy(dAtA[i:], m.Role)
i = encodeVarintTx(dAtA, i, uint64(len(m.Role)))
i--
dAtA[i] = 0x22
}
if len(m.EthSignature) > 0 {
i -= len(m.EthSignature)
copy(dAtA[i:], m.EthSignature)
@@ -344,6 +376,14 @@ func (m *MsgOnboardParticipant) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Role)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.KycId)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
return n
}
@@ -488,6 +528,70 @@ func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error {
}
m.EthSignature = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Role", 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.Role = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
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:])
+5 -5
View File
@@ -11,21 +11,21 @@ import (
// Default parameter values.
var (
// DefaultRecordRent is the default record rent for 1 time period (see expiry time).
DefaultRecordRent = sdkmath.NewInt(1000000)
DefaultRecordRent = sdkmath.NewInt(1000000) // 10^6 alnt
// DefaultRecordExpiryTime is the default record expiry time (1 year).
DefaultRecordExpiryTime = time.Hour * 24 * 365
DefaultAuthorityRent = sdkmath.NewInt(1000000)
DefaultAuthorityRent = sdkmath.NewInt(1000000) // 10^6 alnt
DefaultAuthorityExpiryTime = time.Hour * 24 * 365
DefaultAuthorityGracePeriod = time.Hour * 24 * 2
DefaultAuthorityAuctionEnabled = false
DefaultCommitsDuration = time.Hour * 24
DefaultRevealsDuration = time.Hour * 24
DefaultCommitFee = sdkmath.NewInt(1000000)
DefaultRevealFee = sdkmath.NewInt(1000000)
DefaultMinimumBid = sdkmath.NewInt(5000000)
DefaultCommitFee = sdkmath.NewInt(1000000) // 10^6 alnt
DefaultRevealFee = sdkmath.NewInt(1000000) // 10^6 alnt
DefaultMinimumBid = sdkmath.NewInt(5000000) // 5 * 10^6 alnt
)
// NewParams creates a new Params instance