From 7369264f0a9542c91c2b2a350fd056f8e520ceb4 Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:35:28 +0530 Subject: [PATCH 1/8] Create skeleton for onboarding module (#2) * Add proto files for onboarding module * Add general files for onboarding module * Add keeper files for onboarding module * Add module files for onboarding module * Update proto files * Add generated proto bindings * Use Keeper pointer in depinject * Fix lint errors --- .../onboarding/module/v1/module.pulsar.go | 581 +++++++++++++++++ api/cerc/onboarding/v1/genesis.pulsar.go | 595 ++++++++++++++++++ api/cerc/onboarding/v1/onboarding.pulsar.go | 501 +++++++++++++++ api/cerc/onboarding/v1/query.pulsar.go | 76 +++ api/cerc/onboarding/v1/tx.pulsar.go | 76 +++ app/app.go | 34 +- app/app.yaml | 5 +- proto/cerc/onboarding/module/v1/module.proto | 15 + proto/cerc/onboarding/v1/genesis.proto | 13 + proto/cerc/onboarding/v1/onboarding.proto | 10 + proto/cerc/onboarding/v1/query.proto | 3 + proto/cerc/onboarding/v1/tx.proto | 3 + x/onboarding/codec.go | 10 + x/onboarding/genesis.go | 17 + x/onboarding/genesis.pb.go | 321 ++++++++++ x/onboarding/keeper/genesis.go | 28 + x/onboarding/keeper/keeper.go | 54 ++ x/onboarding/keys.go | 9 + x/onboarding/module/autocli.go | 13 + x/onboarding/module/depinject.go | 59 ++ x/onboarding/module/module.go | 118 ++++ x/onboarding/onboarding.pb.go | 269 ++++++++ x/onboarding/params.go | 14 + 23 files changed, 2808 insertions(+), 16 deletions(-) create mode 100644 api/cerc/onboarding/module/v1/module.pulsar.go create mode 100644 api/cerc/onboarding/v1/genesis.pulsar.go create mode 100644 api/cerc/onboarding/v1/onboarding.pulsar.go create mode 100644 api/cerc/onboarding/v1/query.pulsar.go create mode 100644 api/cerc/onboarding/v1/tx.pulsar.go create mode 100644 proto/cerc/onboarding/module/v1/module.proto create mode 100644 proto/cerc/onboarding/v1/genesis.proto create mode 100644 proto/cerc/onboarding/v1/onboarding.proto create mode 100644 proto/cerc/onboarding/v1/query.proto create mode 100644 proto/cerc/onboarding/v1/tx.proto create mode 100644 x/onboarding/codec.go create mode 100644 x/onboarding/genesis.go create mode 100644 x/onboarding/genesis.pb.go create mode 100644 x/onboarding/keeper/genesis.go create mode 100644 x/onboarding/keeper/keeper.go create mode 100644 x/onboarding/keys.go create mode 100644 x/onboarding/module/autocli.go create mode 100644 x/onboarding/module/depinject.go create mode 100644 x/onboarding/module/module.go create mode 100644 x/onboarding/onboarding.pb.go create mode 100644 x/onboarding/params.go diff --git a/api/cerc/onboarding/module/v1/module.pulsar.go b/api/cerc/onboarding/module/v1/module.pulsar.go new file mode 100644 index 00000000..411b0797 --- /dev/null +++ b/api/cerc/onboarding/module/v1/module.pulsar.go @@ -0,0 +1,581 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_module_v1_module_proto_init() + md_Module = File_cerc_onboarding_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message cerc.onboarding.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.module.v1.Module")) + } + panic(fmt.Errorf("message cerc.onboarding.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cerc/onboarding/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_cerc_onboarding_module_v1_module_proto protoreflect.FileDescriptor + +var file_cerc_onboarding_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, + 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x30, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x2a, 0x0a, 0x28, 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, 0x78, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x42, + 0xf7, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x42, 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, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x4d, 0xaa, 0x02, 0x19, 0x43, 0x65, 0x72, + 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x25, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x43, 0x65, 0x72, + 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cerc_onboarding_module_v1_module_proto_rawDescOnce sync.Once + file_cerc_onboarding_module_v1_module_proto_rawDescData = file_cerc_onboarding_module_v1_module_proto_rawDesc +) + +func file_cerc_onboarding_module_v1_module_proto_rawDescGZIP() []byte { + file_cerc_onboarding_module_v1_module_proto_rawDescOnce.Do(func() { + file_cerc_onboarding_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_module_v1_module_proto_rawDescData) + }) + return file_cerc_onboarding_module_v1_module_proto_rawDescData +} + +var file_cerc_onboarding_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cerc_onboarding_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cerc.onboarding.module.v1.Module +} +var file_cerc_onboarding_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cerc_onboarding_module_v1_module_proto_init() } +func file_cerc_onboarding_module_v1_module_proto_init() { + if File_cerc_onboarding_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cerc_onboarding_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerc_onboarding_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cerc_onboarding_module_v1_module_proto_goTypes, + DependencyIndexes: file_cerc_onboarding_module_v1_module_proto_depIdxs, + MessageInfos: file_cerc_onboarding_module_v1_module_proto_msgTypes, + }.Build() + File_cerc_onboarding_module_v1_module_proto = out.File + file_cerc_onboarding_module_v1_module_proto_rawDesc = nil + file_cerc_onboarding_module_v1_module_proto_goTypes = nil + file_cerc_onboarding_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cerc/onboarding/v1/genesis.pulsar.go b/api/cerc/onboarding/v1/genesis.pulsar.go new file mode 100644 index 00000000..b0e85dad --- /dev/null +++ b/api/cerc/onboarding/v1/genesis.pulsar.go @@ -0,0 +1,595 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package onboardingv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_genesis_proto_init() + md_GenesisState = File_cerc_onboarding_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cerc/onboarding/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_cerc_onboarding_v1_genesis_proto protoreflect.FileDescriptor + +var file_cerc_onboarding_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 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, 0x48, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xd1, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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_cerc_onboarding_v1_genesis_proto_rawDescOnce sync.Once + file_cerc_onboarding_v1_genesis_proto_rawDescData = file_cerc_onboarding_v1_genesis_proto_rawDesc +) + +func file_cerc_onboarding_v1_genesis_proto_rawDescGZIP() []byte { + file_cerc_onboarding_v1_genesis_proto_rawDescOnce.Do(func() { + file_cerc_onboarding_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_v1_genesis_proto_rawDescData) + }) + return file_cerc_onboarding_v1_genesis_proto_rawDescData +} + +var file_cerc_onboarding_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cerc_onboarding_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cerc.onboarding.v1.GenesisState + (*Params)(nil), // 1: cerc.onboarding.v1.Params +} +var file_cerc_onboarding_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: cerc.onboarding.v1.GenesisState.params:type_name -> cerc.onboarding.v1.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cerc_onboarding_v1_genesis_proto_init() } +func file_cerc_onboarding_v1_genesis_proto_init() { + if File_cerc_onboarding_v1_genesis_proto != nil { + return + } + file_cerc_onboarding_v1_onboarding_proto_init() + if !protoimpl.UnsafeEnabled { + file_cerc_onboarding_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerc_onboarding_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cerc_onboarding_v1_genesis_proto_goTypes, + DependencyIndexes: file_cerc_onboarding_v1_genesis_proto_depIdxs, + MessageInfos: file_cerc_onboarding_v1_genesis_proto_msgTypes, + }.Build() + File_cerc_onboarding_v1_genesis_proto = out.File + file_cerc_onboarding_v1_genesis_proto_rawDesc = nil + file_cerc_onboarding_v1_genesis_proto_goTypes = nil + file_cerc_onboarding_v1_genesis_proto_depIdxs = nil +} diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go new file mode 100644 index 00000000..2dbe94fc --- /dev/null +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package onboardingv1 + +import ( + _ "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor +) + +func init() { + file_cerc_onboarding_v1_onboarding_proto_init() + md_Params = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Params") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cerc/onboarding/v1/onboarding.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters of the onboarding module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{0} +} + +var File_cerc_onboarding_v1_onboarding_proto protoreflect.FileDescriptor + +var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ + 0x0a, 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, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 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_cerc_onboarding_v1_onboarding_proto_rawDescOnce sync.Once + file_cerc_onboarding_v1_onboarding_proto_rawDescData = file_cerc_onboarding_v1_onboarding_proto_rawDesc +) + +func file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP() []byte { + file_cerc_onboarding_v1_onboarding_proto_rawDescOnce.Do(func() { + file_cerc_onboarding_v1_onboarding_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_v1_onboarding_proto_rawDescData) + }) + return file_cerc_onboarding_v1_onboarding_proto_rawDescData +} + +var file_cerc_onboarding_v1_onboarding_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cerc_onboarding_v1_onboarding_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: cerc.onboarding.v1.Params +} +var file_cerc_onboarding_v1_onboarding_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cerc_onboarding_v1_onboarding_proto_init() } +func file_cerc_onboarding_v1_onboarding_proto_init() { + if File_cerc_onboarding_v1_onboarding_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cerc_onboarding_v1_onboarding_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerc_onboarding_v1_onboarding_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cerc_onboarding_v1_onboarding_proto_goTypes, + DependencyIndexes: file_cerc_onboarding_v1_onboarding_proto_depIdxs, + MessageInfos: file_cerc_onboarding_v1_onboarding_proto_msgTypes, + }.Build() + File_cerc_onboarding_v1_onboarding_proto = out.File + file_cerc_onboarding_v1_onboarding_proto_rawDesc = nil + file_cerc_onboarding_v1_onboarding_proto_goTypes = nil + file_cerc_onboarding_v1_onboarding_proto_depIdxs = nil +} diff --git a/api/cerc/onboarding/v1/query.pulsar.go b/api/cerc/onboarding/v1/query.pulsar.go new file mode 100644 index 00000000..f6533f42 --- /dev/null +++ b/api/cerc/onboarding/v1/query.pulsar.go @@ -0,0 +1,76 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package onboardingv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cerc/onboarding/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_cerc_onboarding_v1_query_proto protoreflect.FileDescriptor + +var file_cerc_onboarding_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x42, 0xcf, 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, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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_cerc_onboarding_v1_query_proto_goTypes = []interface{}{} +var file_cerc_onboarding_v1_query_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cerc_onboarding_v1_query_proto_init() } +func file_cerc_onboarding_v1_query_proto_init() { + if File_cerc_onboarding_v1_query_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerc_onboarding_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cerc_onboarding_v1_query_proto_goTypes, + DependencyIndexes: file_cerc_onboarding_v1_query_proto_depIdxs, + }.Build() + File_cerc_onboarding_v1_query_proto = out.File + file_cerc_onboarding_v1_query_proto_rawDesc = nil + file_cerc_onboarding_v1_query_proto_goTypes = nil + file_cerc_onboarding_v1_query_proto_depIdxs = nil +} diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go new file mode 100644 index 00000000..58a10e42 --- /dev/null +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -0,0 +1,76 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package onboardingv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cerc/onboarding/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_cerc_onboarding_v1_tx_proto protoreflect.FileDescriptor + +var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, + 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 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 file_cerc_onboarding_v1_tx_proto_goTypes = []interface{}{} +var file_cerc_onboarding_v1_tx_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cerc_onboarding_v1_tx_proto_init() } +func file_cerc_onboarding_v1_tx_proto_init() { + if File_cerc_onboarding_v1_tx_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerc_onboarding_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cerc_onboarding_v1_tx_proto_goTypes, + DependencyIndexes: file_cerc_onboarding_v1_tx_proto_depIdxs, + }.Build() + File_cerc_onboarding_v1_tx_proto = out.File + file_cerc_onboarding_v1_tx_proto_rawDesc = nil + file_cerc_onboarding_v1_tx_proto_goTypes = nil + file_cerc_onboarding_v1_tx_proto_depIdxs = nil +} diff --git a/app/app.go b/app/app.go index 9afea91a..b320a5e4 100644 --- a/app/app.go +++ b/app/app.go @@ -15,6 +15,7 @@ import ( auctionkeeper "git.vdb.to/cerc-io/laconicd/x/auction/keeper" bondkeeper "git.vdb.to/cerc-io/laconicd/x/bond/keeper" + onboardingkeeper "git.vdb.to/cerc-io/laconicd/x/onboarding/keeper" registrykeeper "git.vdb.to/cerc-io/laconicd/x/registry/keeper" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -35,18 +36,19 @@ import ( genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - _ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects - _ "git.vdb.to/cerc-io/laconicd/x/auction/module" // import for side-effects - _ "git.vdb.to/cerc-io/laconicd/x/bond/module" // import for side-effects - _ "git.vdb.to/cerc-io/laconicd/x/registry/module" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects - _ "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/staking" // import for side-effects + _ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects + _ "git.vdb.to/cerc-io/laconicd/x/auction/module" // import for side-effects + _ "git.vdb.to/cerc-io/laconicd/x/bond/module" // import for side-effects + _ "git.vdb.to/cerc-io/laconicd/x/onboarding/module" // import for side-effects + _ "git.vdb.to/cerc-io/laconicd/x/registry/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects + _ "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/staking" // import for side-effects ) // DefaultNodeHome default home directories for the application daemon @@ -79,9 +81,10 @@ type LaconicApp struct { ConsensusParamsKeeper consensuskeeper.Keeper // laconic keepers - AuctionKeeper *auctionkeeper.Keeper // (Use * as per ProvideModule implementation) - BondKeeper *bondkeeper.Keeper - RegistryKeeper registrykeeper.Keeper + AuctionKeeper *auctionkeeper.Keeper // (Use * as per ProvideModule implementation) + BondKeeper *bondkeeper.Keeper + RegistryKeeper registrykeeper.Keeper + OnboardingKeeper *onboardingkeeper.Keeper // simulation manager sm *module.SimulationManager @@ -145,6 +148,7 @@ func NewLaconicApp( &app.AuctionKeeper, &app.BondKeeper, &app.RegistryKeeper, + &app.OnboardingKeeper, ); err != nil { return nil, err } diff --git a/app/app.yaml b/app/app.yaml index 5d1601af..3d05d67c 100644 --- a/app/app.yaml +++ b/app/app.yaml @@ -10,7 +10,7 @@ modules: 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] + init_genesis: [auth, bank, distribution, staking, crisis, genutil, auction, bond, registry, onboarding] override_store_keys: - module_name: auth kv_store_key: acc @@ -63,3 +63,6 @@ modules: - name: registry config: "@type": cerc.registry.module.v1.Module + - name: onboarding + config: + "@type": cerc.onboarding.module.v1.Module diff --git a/proto/cerc/onboarding/module/v1/module.proto b/proto/cerc/onboarding/module/v1/module.proto new file mode 100644 index 00000000..e921a6cb --- /dev/null +++ b/proto/cerc/onboarding/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cerc.onboarding.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import : "git.vdb.to/cerc-io/laconicd/x/onboarding" + }; + + string authority = 1; +} diff --git a/proto/cerc/onboarding/v1/genesis.proto b/proto/cerc/onboarding/v1/genesis.proto new file mode 100644 index 00000000..8f7cacec --- /dev/null +++ b/proto/cerc/onboarding/v1/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package cerc.onboarding.v1; + +import "gogoproto/gogo.proto"; +import "cerc/onboarding/v1/onboarding.proto"; + +option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; + +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto new file mode 100644 index 00000000..b42f5cb1 --- /dev/null +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package cerc.onboarding.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; + +// Params defines the parameters of the onboarding module. +message Params {} diff --git a/proto/cerc/onboarding/v1/query.proto b/proto/cerc/onboarding/v1/query.proto new file mode 100644 index 00000000..06533faf --- /dev/null +++ b/proto/cerc/onboarding/v1/query.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; + +package cerc.onboarding.v1; diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto new file mode 100644 index 00000000..06533faf --- /dev/null +++ b/proto/cerc/onboarding/v1/tx.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; + +package cerc.onboarding.v1; diff --git a/x/onboarding/codec.go b/x/onboarding/codec.go new file mode 100644 index 00000000..afcf7ed9 --- /dev/null +++ b/x/onboarding/codec.go @@ -0,0 +1,10 @@ +package onboarding + +import ( + types "github.com/cosmos/cosmos-sdk/codec/types" +) + +// RegisterInterfaces registers the interfaces types with the interface registry. +func RegisterInterfaces(registry types.InterfaceRegistry) { + // TODO: Implement +} diff --git a/x/onboarding/genesis.go b/x/onboarding/genesis.go new file mode 100644 index 00000000..5b096ccd --- /dev/null +++ b/x/onboarding/genesis.go @@ -0,0 +1,17 @@ +package onboarding + +// NewGenesisState creates a new genesis state with default values. +func NewGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +func (gs *GenesisState) Validate() error { + if err := gs.Params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/onboarding/genesis.pb.go b/x/onboarding/genesis.pb.go new file mode 100644 index 00000000..b0fd4581 --- /dev/null +++ b/x/onboarding/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cerc/onboarding/v1/genesis.proto + +package onboarding + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_d21793296c3d9d75, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cerc.onboarding.v1.GenesisState") +} + +func init() { proto.RegisterFile("cerc/onboarding/v1/genesis.proto", fileDescriptor_d21793296c3d9d75) } + +var fileDescriptor_d21793296c3d9d75 = []byte{ + // 200 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x4e, 0x2d, 0x4a, + 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x4f, + 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xa9, + 0xd0, 0x43, 0xa8, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, + 0x58, 0x10, 0x95, 0x52, 0xca, 0x58, 0xcc, 0x42, 0xd2, 0x07, 0x56, 0xa4, 0xe4, 0xc1, 0xc5, 0xe3, + 0x0e, 0x31, 0x3f, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x82, 0x8b, 0xad, 0x20, 0xb1, 0x28, 0x31, + 0xb7, 0x58, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4a, 0x0f, 0xd3, 0x3e, 0xbd, 0x00, 0xb0, + 0x0a, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xea, 0x9d, 0x9c, 0x4e, 0x3c, 0x92, 0x63, + 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, + 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x23, 0x3d, 0xb3, 0x44, 0xaf, 0x2c, 0x25, 0x49, 0xaf, + 0x24, 0x5f, 0x1f, 0x64, 0x9a, 0x6e, 0x66, 0xbe, 0x7e, 0x4e, 0x62, 0x72, 0x7e, 0x5e, 0x66, 0x72, + 0x8a, 0x7e, 0x05, 0x92, 0x9b, 0x92, 0xd8, 0xc0, 0x8e, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x79, 0x00, 0xd0, 0xb1, 0x07, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onboarding/keeper/genesis.go b/x/onboarding/keeper/genesis.go new file mode 100644 index 00000000..54542bf2 --- /dev/null +++ b/x/onboarding/keeper/genesis.go @@ -0,0 +1,28 @@ +package keeper + +import ( + "context" + + "git.vdb.to/cerc-io/laconicd/x/onboarding" +) + +// InitGenesis initializes the module state from a genesis state. +func (k *Keeper) InitGenesis(ctx context.Context, data *onboarding.GenesisState) error { + if err := k.Params.Set(ctx, data.Params); err != nil { + return err + } + + return nil +} + +// ExportGenesis exports the module state to a genesis state. +func (k *Keeper) ExportGenesis(ctx context.Context) (*onboarding.GenesisState, error) { + params, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + + return &onboarding.GenesisState{ + Params: params, + }, nil +} diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go new file mode 100644 index 00000000..7d41e967 --- /dev/null +++ b/x/onboarding/keeper/keeper.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + storetypes "cosmossdk.io/core/store" + "github.com/cosmos/cosmos-sdk/codec" + + "git.vdb.to/cerc-io/laconicd/x/onboarding" +) + +type Keeper struct { + cdc codec.BinaryCodec + addressCodec address.Codec + + // authority is the address capable of executing a MsgUpdateParams and other authority-gated message. + // typically, this should be the x/gov module account. + authority string + + // state management + Schema collections.Schema + Params collections.Item[onboarding.Params] +} + +// NewKeeper creates a new Keeper instance +func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, authority string) *Keeper { + if _, err := addressCodec.StringToBytes(authority); err != nil { + panic(fmt.Errorf("invalid authority address: %w", err)) + } + + sb := collections.NewSchemaBuilder(storeService) + k := Keeper{ + cdc: cdc, + addressCodec: addressCodec, + authority: authority, + Params: collections.NewItem(sb, onboarding.ParamsKey, "params", codec.CollValue[onboarding.Params](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + + k.Schema = schema + + return &k +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} diff --git a/x/onboarding/keys.go b/x/onboarding/keys.go new file mode 100644 index 00000000..79ae9513 --- /dev/null +++ b/x/onboarding/keys.go @@ -0,0 +1,9 @@ +package onboarding + +import "cosmossdk.io/collections" + +const ModuleName = "onboarding" + +var ( + ParamsKey = collections.NewPrefix("Params") +) diff --git a/x/onboarding/module/autocli.go b/x/onboarding/module/autocli.go new file mode 100644 index 00000000..d9d58680 --- /dev/null +++ b/x/onboarding/module/autocli.go @@ -0,0 +1,13 @@ +package module + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: nil, + Tx: nil, + } +} diff --git a/x/onboarding/module/depinject.go b/x/onboarding/module/depinject.go new file mode 100644 index 00000000..d70163a7 --- /dev/null +++ b/x/onboarding/module/depinject.go @@ -0,0 +1,59 @@ +package module + +import ( + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + + "github.com/cosmos/cosmos-sdk/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + modulev1 "git.vdb.to/cerc-io/laconicd/api/cerc/onboarding/module/v1" + "git.vdb.to/cerc-io/laconicd/x/onboarding/keeper" +) + +var _ appmodule.AppModule = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + Cdc codec.Codec + StoreService store.KVStoreService + AddressCodec address.Codec + + Config *modulev1.Module +} + +type ModuleOutputs struct { + depinject.Out + + Module appmodule.AppModule + Keeper *keeper.Keeper +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance as authority if not provided + authority := authtypes.NewModuleAddress("gov") + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + + k := keeper.NewKeeper(in.Cdc, in.AddressCodec, in.StoreService, authority.String()) + m := NewAppModule(in.Cdc, k) + + return ModuleOutputs{Module: m, Keeper: k} +} diff --git a/x/onboarding/module/module.go b/x/onboarding/module/module.go new file mode 100644 index 00000000..9850525c --- /dev/null +++ b/x/onboarding/module/module.go @@ -0,0 +1,118 @@ +package module + +import ( + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "git.vdb.to/cerc-io/laconicd/x/onboarding" + "git.vdb.to/cerc-io/laconicd/x/onboarding/keeper" +) + +var ( + _ module.AppModuleBasic = AppModule{} + _ module.HasGenesis = AppModule{} + _ appmodule.AppModule = AppModule{} +) + +// ConsensusVersion defines the current module consensus version. +const ConsensusVersion = 1 + +type AppModule struct { + cdc codec.Codec + keeper *keeper.Keeper +} + +// NewAppModule creates a new AppModule object +func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule { + return AppModule{ + cdc: cdc, + keeper: keeper, + } +} + +func NewAppModuleBasic(m AppModule) module.AppModuleBasic { + return module.CoreAppModuleBasicAdaptor(m.Name(), m) +} + +// Name returns the onboarding module's name. +func (AppModule) Name() string { return onboarding.ModuleName } + +// RegisterLegacyAminoCodec registers the onboarding module's types on the LegacyAmino codec. +// New modules do not need to support Amino. +func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the onboarding module. +func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { + // TODO: Implement + // if err := onboarding.RegisterQueryHandlerClient(context.Background(), mux, onboarding.NewQueryClient(clientCtx)); err != nil { + // panic(err) + // } +} + +// RegisterInterfaces registers interfaces and implementations of the onboarding module. +func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + onboarding.RegisterInterfaces(registry) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + // TODO: Implement + // Register servers + // onboarding.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + // onboarding.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) + + // Register in place module state migration migrations + // m := keeper.NewMigrator(am.keeper) + // if err := cfg.RegisterMigration(onboarding.ModuleName, 1, m.Migrate1to2); err != nil { + // panic(fmt.Sprintf("failed to migrate x/%s from version 1 to 2: %v", onboarding.ModuleName, err)) + // } +} + +// DefaultGenesis returns default genesis state as raw bytes for the module. +func (AppModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(onboarding.NewGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the circuit module. +func (AppModule) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data onboarding.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", onboarding.ModuleName, err) + } + + return data.Validate() +} + +// InitGenesis performs genesis initialization for the onboarding module. +// It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { + var genesisState onboarding.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + + if err := am.keeper.InitGenesis(ctx, &genesisState); err != nil { + panic(fmt.Sprintf("failed to initialize %s genesis state: %v", onboarding.ModuleName, err)) + } +} + +// ExportGenesis returns the exported genesis state as raw bytes for the circuit +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs, err := am.keeper.ExportGenesis(ctx) + if err != nil { + panic(fmt.Sprintf("failed to export %s genesis state: %v", onboarding.ModuleName, err)) + } + + return cdc.MustMarshalJSON(gs) +} diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go new file mode 100644 index 00000000..510d225f --- /dev/null +++ b/x/onboarding/onboarding.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cerc/onboarding/v1/onboarding.proto + +package onboarding + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters of the onboarding module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_59afed779274eaf0, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "cerc.onboarding.v1.Params") +} + +func init() { + proto.RegisterFile("cerc/onboarding/v1/onboarding.proto", fileDescriptor_59afed779274eaf0) +} + +var fileDescriptor_59afed779274eaf0 = []byte{ + // 176 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0x4e, 0x2d, 0x4a, + 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x44, 0xe2, + 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x81, 0x14, 0xe9, 0x21, 0x09, 0x97, 0x19, 0x4a, + 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xa5, 0xf5, 0x41, 0x2c, 0x88, 0x4a, 0x29, 0xb9, 0xe4, 0xfc, + 0xe2, 0xdc, 0xfc, 0x62, 0xfd, 0xa4, 0xc4, 0xe2, 0x54, 0xfd, 0x32, 0xc3, 0xa4, 0xd4, 0x92, 0x44, + 0x43, 0xfd, 0xe4, 0xfc, 0xcc, 0x3c, 0x88, 0xbc, 0x12, 0x07, 0x17, 0x5b, 0x40, 0x62, 0x51, 0x62, + 0x6e, 0xb1, 0x93, 0xd3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa4, + 0x67, 0x96, 0xe8, 0x95, 0xa5, 0x24, 0xe9, 0x95, 0xe4, 0xeb, 0x83, 0x2c, 0xd6, 0xcd, 0xcc, 0xd7, + 0xcf, 0x49, 0x4c, 0xce, 0xcf, 0xcb, 0x4c, 0x4e, 0xd1, 0xaf, 0x40, 0x72, 0x5d, 0x12, 0x1b, 0xd8, + 0x50, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0xff, 0xee, 0x2e, 0xc5, 0x00, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintOnboarding(dAtA []byte, offset int, v uint64) int { + offset -= sovOnboarding(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovOnboarding(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOnboarding(x uint64) (n int) { + return sovOnboarding(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowOnboarding + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipOnboarding(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnboarding + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOnboarding(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnboarding + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnboarding + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnboarding + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthOnboarding + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOnboarding + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOnboarding + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOnboarding = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOnboarding = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOnboarding = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onboarding/params.go b/x/onboarding/params.go new file mode 100644 index 00000000..a527378c --- /dev/null +++ b/x/onboarding/params.go @@ -0,0 +1,14 @@ +package onboarding + +// DefaultParams returns default module parameters. +func DefaultParams() Params { + return Params{ + // Set default values here. + } +} + +// Validate does the sanity check on the params. +func (p Params) Validate() error { + // Sanity check goes here. + return nil +} -- 2.45.2 From a21e9ea387ae58fcb5dec0b8cbfb5a80f874f3d4 Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:08:48 +0530 Subject: [PATCH 2/8] Implement onboarding module for testnet validator enrollment (#3) * Add proto files for onboarding module * Add generated proto bindings * Define onboarding object * Define the participants state in keeper * Update genesis file to initialize and export module state to/from genesis * Add msg to onboard participant * Register command to enroll participant * Add functionality to decode ethereum address from signature * Add comments for messages and fields * Fix lint errors in proto files * Add message validation and events in msg_server * Reuse crypto utils from go-nitro * Sign entire eth_payload object * Use google API for rpc method * Regenerate proto bindings --------- Co-authored-by: Prathamesh Musale --- api/cerc/onboarding/v1/genesis.pulsar.go | 207 +++- api/cerc/onboarding/v1/onboarding.pulsar.go | 1115 ++++++++++++++++- api/cerc/onboarding/v1/tx.pulsar.go | 1205 ++++++++++++++++++- api/cerc/onboarding/v1/tx_grpc.pb.go | 111 ++ go.mod | 46 +- go.sum | 130 +- proto/cerc/onboarding/v1/genesis.proto | 3 + proto/cerc/onboarding/v1/onboarding.proto | 21 + proto/cerc/onboarding/v1/query.proto | 2 + proto/cerc/onboarding/v1/tx.proto | 32 + utils/signature.go | 18 + x/auction/module/module.go | 2 +- x/bond/errors.go | 11 - x/bond/events.go | 2 +- x/bond/module/module.go | 2 +- x/onboarding/codec.go | 7 +- x/onboarding/events.go | 11 + x/onboarding/genesis.go | 13 +- x/onboarding/genesis.pb.go | 86 +- x/onboarding/keeper/genesis.go | 17 +- x/onboarding/keeper/keeper.go | 51 +- x/onboarding/keeper/msg_server.go | 57 + x/onboarding/keys.go | 11 +- x/onboarding/module/autocli.go | 19 +- x/onboarding/module/module.go | 4 +- x/onboarding/msgs.go | 27 + x/onboarding/onboarding.pb.go | 478 +++++++- x/onboarding/query.pb.go | 36 + x/onboarding/tx.pb.go | 695 +++++++++++ x/onboarding/tx.pb.gw.go | 171 +++ x/registry/module/module.go | 10 +- 31 files changed, 4419 insertions(+), 181 deletions(-) create mode 100644 api/cerc/onboarding/v1/tx_grpc.pb.go create mode 100644 utils/signature.go delete mode 100644 x/bond/errors.go create mode 100644 x/onboarding/events.go create mode 100644 x/onboarding/keeper/msg_server.go create mode 100644 x/onboarding/msgs.go create mode 100644 x/onboarding/query.pb.go create mode 100644 x/onboarding/tx.pb.go create mode 100644 x/onboarding/tx.pb.gw.go diff --git a/api/cerc/onboarding/v1/genesis.pulsar.go b/api/cerc/onboarding/v1/genesis.pulsar.go index b0e85dad..ceabf85f 100644 --- a/api/cerc/onboarding/v1/genesis.pulsar.go +++ b/api/cerc/onboarding/v1/genesis.pulsar.go @@ -13,15 +13,68 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*Participant +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Participant) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Participant) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(Participant) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(Participant) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_participants protoreflect.FieldDescriptor ) func init() { file_cerc_onboarding_v1_genesis_proto_init() md_GenesisState = File_cerc_onboarding_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_participants = md_GenesisState.Fields().ByName("participants") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -95,6 +148,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.Participants) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Participants}) + if !f(fd_GenesisState_participants, value) { + return + } + } } // Has reports whether a field is populated. @@ -112,6 +171,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "cerc.onboarding.v1.GenesisState.params": return x.Params != nil + case "cerc.onboarding.v1.GenesisState.participants": + return len(x.Participants) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -130,6 +191,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cerc.onboarding.v1.GenesisState.params": x.Params = nil + case "cerc.onboarding.v1.GenesisState.participants": + x.Participants = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -149,6 +212,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "cerc.onboarding.v1.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.onboarding.v1.GenesisState.participants": + if len(x.Participants) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.Participants} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -171,6 +240,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "cerc.onboarding.v1.GenesisState.params": x.Params = value.Message().Interface().(*Params) + case "cerc.onboarding.v1.GenesisState.participants": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.Participants = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -196,6 +269,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cerc.onboarding.v1.GenesisState.participants": + if x.Participants == nil { + x.Participants = []*Participant{} + } + value := &_GenesisState_2_list{list: &x.Participants} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -212,6 +291,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "cerc.onboarding.v1.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.onboarding.v1.GenesisState.participants": + list := []*Participant{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.GenesisState")) @@ -285,6 +367,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.Participants) > 0 { + for _, e := range x.Participants { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -314,6 +402,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Participants) > 0 { + for iNdEx := len(x.Participants) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Participants[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -413,6 +517,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Participants = append(x.Participants, &Participant{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Participants[len(x.Participants)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -461,6 +599,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// GenesisState defines the onboarding module's genesis state. type GenesisState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -468,6 +607,8 @@ type GenesisState struct { // params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // participants defines all the participants + Participants []*Participant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants,omitempty"` } func (x *GenesisState) Reset() { @@ -497,6 +638,13 @@ func (x *GenesisState) GetParams() *Params { return nil } +func (x *GenesisState) GetParticipants() []*Participant { + if x != nil { + return x.Participants + } + return nil +} + var File_cerc_onboarding_v1_genesis_proto protoreflect.FileDescriptor var file_cerc_onboarding_v1_genesis_proto_rawDesc = []byte{ @@ -507,25 +655,30 @@ var file_cerc_onboarding_v1_genesis_proto_rawDesc = []byte{ 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, 0x48, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xd1, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, + 0x6f, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x49, 0x0a, 0x0c, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0xd1, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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 ( @@ -544,14 +697,16 @@ var file_cerc_onboarding_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInf var file_cerc_onboarding_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: cerc.onboarding.v1.GenesisState (*Params)(nil), // 1: cerc.onboarding.v1.Params + (*Participant)(nil), // 2: cerc.onboarding.v1.Participant } var file_cerc_onboarding_v1_genesis_proto_depIdxs = []int32{ 1, // 0: cerc.onboarding.v1.GenesisState.params:type_name -> cerc.onboarding.v1.Params - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: cerc.onboarding.v1.GenesisState.participants:type_name -> cerc.onboarding.v1.Participant + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_genesis_proto_init() } diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go index 2dbe94fc..3da44d43 100644 --- a/api/cerc/onboarding/v1/onboarding.pulsar.go +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -2,7 +2,6 @@ package onboardingv1 import ( - _ "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -370,6 +369,974 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } +var ( + md_Participant protoreflect.MessageDescriptor + fd_Participant_cosmos_address protoreflect.FieldDescriptor + fd_Participant_ethereum_address protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_onboarding_proto_init() + md_Participant = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Participant") + fd_Participant_cosmos_address = md_Participant.Fields().ByName("cosmos_address") + fd_Participant_ethereum_address = md_Participant.Fields().ByName("ethereum_address") +} + +var _ protoreflect.Message = (*fastReflection_Participant)(nil) + +type fastReflection_Participant Participant + +func (x *Participant) ProtoReflect() protoreflect.Message { + return (*fastReflection_Participant)(x) +} + +func (x *Participant) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Participant_messageType fastReflection_Participant_messageType +var _ protoreflect.MessageType = fastReflection_Participant_messageType{} + +type fastReflection_Participant_messageType struct{} + +func (x fastReflection_Participant_messageType) Zero() protoreflect.Message { + return (*fastReflection_Participant)(nil) +} +func (x fastReflection_Participant_messageType) New() protoreflect.Message { + return new(fastReflection_Participant) +} +func (x fastReflection_Participant_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Participant +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Participant) Descriptor() protoreflect.MessageDescriptor { + return md_Participant +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Participant) Type() protoreflect.MessageType { + return _fastReflection_Participant_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Participant) New() protoreflect.Message { + return new(fastReflection_Participant) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Participant) Interface() protoreflect.ProtoMessage { + return (*Participant)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Participant) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CosmosAddress != "" { + value := protoreflect.ValueOfString(x.CosmosAddress) + if !f(fd_Participant_cosmos_address, value) { + return + } + } + if x.EthereumAddress != "" { + value := protoreflect.ValueOfString(x.EthereumAddress) + if !f(fd_Participant_ethereum_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Participant) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + return x.CosmosAddress != "" + case "cerc.onboarding.v1.Participant.ethereum_address": + return x.EthereumAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Participant) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + x.CosmosAddress = "" + case "cerc.onboarding.v1.Participant.ethereum_address": + x.EthereumAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Participant) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + value := x.CosmosAddress + return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.Participant.ethereum_address": + value := x.EthereumAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Participant) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + x.CosmosAddress = value.Interface().(string) + case "cerc.onboarding.v1.Participant.ethereum_address": + x.EthereumAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Participant) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + panic(fmt.Errorf("field cosmos_address of message cerc.onboarding.v1.Participant is not mutable")) + case "cerc.onboarding.v1.Participant.ethereum_address": + panic(fmt.Errorf("field ethereum_address 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")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Participant) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.Participant.cosmos_address": + return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.Participant.ethereum_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.Participant does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Participant) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.Participant", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Participant) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Participant) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Participant) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Participant) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.CosmosAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EthereumAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Participant) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.EthereumAddress) > 0 { + i -= len(x.EthereumAddress) + copy(dAtA[i:], x.EthereumAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthereumAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.CosmosAddress) > 0 { + i -= len(x.CosmosAddress) + copy(dAtA[i:], x.CosmosAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CosmosAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Participant) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Participant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Participant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CosmosAddress", 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.CosmosAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthereumAddress", 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.EthereumAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EthPayload protoreflect.MessageDescriptor + fd_EthPayload_address protoreflect.FieldDescriptor + fd_EthPayload_msg protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_onboarding_proto_init() + md_EthPayload = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("EthPayload") + fd_EthPayload_address = md_EthPayload.Fields().ByName("address") + fd_EthPayload_msg = md_EthPayload.Fields().ByName("msg") +} + +var _ protoreflect.Message = (*fastReflection_EthPayload)(nil) + +type fastReflection_EthPayload EthPayload + +func (x *EthPayload) ProtoReflect() protoreflect.Message { + return (*fastReflection_EthPayload)(x) +} + +func (x *EthPayload) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EthPayload_messageType fastReflection_EthPayload_messageType +var _ protoreflect.MessageType = fastReflection_EthPayload_messageType{} + +type fastReflection_EthPayload_messageType struct{} + +func (x fastReflection_EthPayload_messageType) Zero() protoreflect.Message { + return (*fastReflection_EthPayload)(nil) +} +func (x fastReflection_EthPayload_messageType) New() protoreflect.Message { + return new(fastReflection_EthPayload) +} +func (x fastReflection_EthPayload_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EthPayload +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EthPayload) Descriptor() protoreflect.MessageDescriptor { + return md_EthPayload +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EthPayload) Type() protoreflect.MessageType { + return _fastReflection_EthPayload_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EthPayload) New() protoreflect.Message { + return new(fastReflection_EthPayload) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EthPayload) Interface() protoreflect.ProtoMessage { + return (*EthPayload)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EthPayload) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_EthPayload_address, value) { + return + } + } + if x.Msg != "" { + value := protoreflect.ValueOfString(x.Msg) + if !f(fd_EthPayload_msg, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EthPayload) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + return x.Address != "" + case "cerc.onboarding.v1.EthPayload.msg": + return x.Msg != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthPayload) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + x.Address = "" + case "cerc.onboarding.v1.EthPayload.msg": + x.Msg = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EthPayload) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.EthPayload.msg": + value := x.Msg + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthPayload) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + x.Address = value.Interface().(string) + case "cerc.onboarding.v1.EthPayload.msg": + x.Msg = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthPayload) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + panic(fmt.Errorf("field address of message cerc.onboarding.v1.EthPayload is not mutable")) + case "cerc.onboarding.v1.EthPayload.msg": + panic(fmt.Errorf("field msg of message cerc.onboarding.v1.EthPayload is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EthPayload) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.EthPayload.address": + return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.EthPayload.msg": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.EthPayload")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.EthPayload does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EthPayload) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.EthPayload", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EthPayload) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EthPayload) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EthPayload) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EthPayload) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EthPayload) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Msg) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EthPayload) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Msg) > 0 { + i -= len(x.Msg) + copy(dAtA[i:], x.Msg) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Msg))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EthPayload) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EthPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EthPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Msg", 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.Msg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -410,6 +1377,94 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{0} } +// Participant defines the data that will be stored for each enrolled participant +type Participant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"` + EthereumAddress string `protobuf:"bytes,2,opt,name=ethereum_address,json=ethereumAddress,proto3" json:"ethereum_address,omitempty"` +} + +func (x *Participant) Reset() { + *x = Participant{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Participant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Participant) ProtoMessage() {} + +// Deprecated: Use Participant.ProtoReflect.Descriptor instead. +func (*Participant) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{1} +} + +func (x *Participant) GetCosmosAddress() string { + if x != nil { + return x.CosmosAddress + } + return "" +} + +func (x *Participant) GetEthereumAddress() string { + if x != nil { + return x.EthereumAddress + } + return "" +} + +// EthPayload defines the payload that is signed by the ethereum private key +type EthPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *EthPayload) Reset() { + *x = EthPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_onboarding_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthPayload) ProtoMessage() {} + +// Deprecated: Use EthPayload.ProtoReflect.Descriptor instead. +func (*EthPayload) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{2} +} + +func (x *EthPayload) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *EthPayload) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + var File_cerc_onboarding_v1_onboarding_proto protoreflect.FileDescriptor var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ @@ -417,10 +1472,28 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xd4, 0x01, 0x0a, 0x16, 0x63, 0x6f, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xc5, 0x01, 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, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x52, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x5e, 0x0a, 0x10, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xf2, 0xde, 0x1f, + 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0x52, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 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, @@ -449,9 +1522,11 @@ func file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP() []byte { return file_cerc_onboarding_v1_onboarding_proto_rawDescData } -var file_cerc_onboarding_v1_onboarding_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cerc_onboarding_v1_onboarding_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cerc_onboarding_v1_onboarding_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: cerc.onboarding.v1.Params + (*Params)(nil), // 0: cerc.onboarding.v1.Params + (*Participant)(nil), // 1: cerc.onboarding.v1.Participant + (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload } var file_cerc_onboarding_v1_onboarding_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -479,6 +1554,30 @@ func file_cerc_onboarding_v1_onboarding_proto_init() { return nil } } + file_cerc_onboarding_v1_onboarding_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Participant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerc_onboarding_v1_onboarding_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -486,7 +1585,7 @@ func file_cerc_onboarding_v1_onboarding_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_onboarding_v1_onboarding_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go index 58a10e42..045acc6c 100644 --- a/api/cerc/onboarding/v1/tx.pulsar.go +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -2,11 +2,1002 @@ package onboardingv1 import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" reflect "reflect" + sync "sync" ) +var ( + md_MsgOnboardParticipant protoreflect.MessageDescriptor + fd_MsgOnboardParticipant_participant protoreflect.FieldDescriptor + fd_MsgOnboardParticipant_eth_payload protoreflect.FieldDescriptor + fd_MsgOnboardParticipant_eth_signature protoreflect.FieldDescriptor + fd_MsgOnboardParticipant_message protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_tx_proto_init() + md_MsgOnboardParticipant = File_cerc_onboarding_v1_tx_proto.Messages().ByName("MsgOnboardParticipant") + 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_message = md_MsgOnboardParticipant.Fields().ByName("message") +} + +var _ protoreflect.Message = (*fastReflection_MsgOnboardParticipant)(nil) + +type fastReflection_MsgOnboardParticipant MsgOnboardParticipant + +func (x *MsgOnboardParticipant) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgOnboardParticipant)(x) +} + +func (x *MsgOnboardParticipant) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgOnboardParticipant_messageType fastReflection_MsgOnboardParticipant_messageType +var _ protoreflect.MessageType = fastReflection_MsgOnboardParticipant_messageType{} + +type fastReflection_MsgOnboardParticipant_messageType struct{} + +func (x fastReflection_MsgOnboardParticipant_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgOnboardParticipant)(nil) +} +func (x fastReflection_MsgOnboardParticipant_messageType) New() protoreflect.Message { + return new(fastReflection_MsgOnboardParticipant) +} +func (x fastReflection_MsgOnboardParticipant_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgOnboardParticipant +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgOnboardParticipant) Descriptor() protoreflect.MessageDescriptor { + return md_MsgOnboardParticipant +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgOnboardParticipant) Type() protoreflect.MessageType { + return _fastReflection_MsgOnboardParticipant_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgOnboardParticipant) New() protoreflect.Message { + return new(fastReflection_MsgOnboardParticipant) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgOnboardParticipant) Interface() protoreflect.ProtoMessage { + return (*MsgOnboardParticipant)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgOnboardParticipant) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Participant != "" { + value := protoreflect.ValueOfString(x.Participant) + if !f(fd_MsgOnboardParticipant_participant, value) { + return + } + } + if x.EthPayload != nil { + value := protoreflect.ValueOfMessage(x.EthPayload.ProtoReflect()) + if !f(fd_MsgOnboardParticipant_eth_payload, value) { + return + } + } + if x.EthSignature != "" { + value := protoreflect.ValueOfString(x.EthSignature) + if !f(fd_MsgOnboardParticipant_eth_signature, value) { + return + } + } + if x.Message != "" { + value := protoreflect.ValueOfString(x.Message) + if !f(fd_MsgOnboardParticipant_message, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgOnboardParticipant) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + return x.Participant != "" + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + return x.EthPayload != nil + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": + return x.EthSignature != "" + case "cerc.onboarding.v1.MsgOnboardParticipant.message": + return x.Message != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipant) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + x.Participant = "" + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + x.EthPayload = nil + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": + x.EthSignature = "" + case "cerc.onboarding.v1.MsgOnboardParticipant.message": + x.Message = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgOnboardParticipant) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + value := x.Participant + return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + value := x.EthPayload + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": + value := x.EthSignature + return protoreflect.ValueOfString(value) + case "cerc.onboarding.v1.MsgOnboardParticipant.message": + value := x.Message + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipant) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + x.Participant = value.Interface().(string) + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + x.EthPayload = value.Message().Interface().(*EthPayload) + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": + x.EthSignature = value.Interface().(string) + case "cerc.onboarding.v1.MsgOnboardParticipant.message": + x.Message = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipant) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + if x.EthPayload == nil { + x.EthPayload = new(EthPayload) + } + return protoreflect.ValueOfMessage(x.EthPayload.ProtoReflect()) + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + 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.message": + panic(fmt.Errorf("field message 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")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgOnboardParticipant) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.MsgOnboardParticipant.participant": + return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_payload": + m := new(EthPayload) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.onboarding.v1.MsgOnboardParticipant.eth_signature": + return protoreflect.ValueOfString("") + case "cerc.onboarding.v1.MsgOnboardParticipant.message": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipant does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgOnboardParticipant) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.MsgOnboardParticipant", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgOnboardParticipant) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipant) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgOnboardParticipant) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgOnboardParticipant) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Participant) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.EthPayload != nil { + l = options.Size(x.EthPayload) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EthSignature) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Message) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgOnboardParticipant) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Message) > 0 { + i -= len(x.Message) + copy(dAtA[i:], x.Message) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Message))) + i-- + dAtA[i] = 0x22 + } + if len(x.EthSignature) > 0 { + i -= len(x.EthSignature) + copy(dAtA[i:], x.EthSignature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthSignature))) + i-- + dAtA[i] = 0x1a + } + if x.EthPayload != nil { + encoded, err := options.Marshal(x.EthPayload) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Participant) > 0 { + i -= len(x.Participant) + copy(dAtA[i:], x.Participant) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Participant))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgOnboardParticipant) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgOnboardParticipant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgOnboardParticipant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Participant", 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.Participant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthPayload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.EthPayload == nil { + x.EthPayload = &EthPayload{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EthPayload); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthSignature", 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.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 Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgOnboardParticipantResponse protoreflect.MessageDescriptor +) + +func init() { + file_cerc_onboarding_v1_tx_proto_init() + md_MsgOnboardParticipantResponse = File_cerc_onboarding_v1_tx_proto.Messages().ByName("MsgOnboardParticipantResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgOnboardParticipantResponse)(nil) + +type fastReflection_MsgOnboardParticipantResponse MsgOnboardParticipantResponse + +func (x *MsgOnboardParticipantResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgOnboardParticipantResponse)(x) +} + +func (x *MsgOnboardParticipantResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgOnboardParticipantResponse_messageType fastReflection_MsgOnboardParticipantResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgOnboardParticipantResponse_messageType{} + +type fastReflection_MsgOnboardParticipantResponse_messageType struct{} + +func (x fastReflection_MsgOnboardParticipantResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgOnboardParticipantResponse)(nil) +} +func (x fastReflection_MsgOnboardParticipantResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgOnboardParticipantResponse) +} +func (x fastReflection_MsgOnboardParticipantResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgOnboardParticipantResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgOnboardParticipantResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgOnboardParticipantResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgOnboardParticipantResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgOnboardParticipantResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgOnboardParticipantResponse) New() protoreflect.Message { + return new(fastReflection_MsgOnboardParticipantResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgOnboardParticipantResponse) Interface() protoreflect.ProtoMessage { + return (*MsgOnboardParticipantResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgOnboardParticipantResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgOnboardParticipantResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipantResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgOnboardParticipantResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipantResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipantResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgOnboardParticipantResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipantResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.MsgOnboardParticipantResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgOnboardParticipantResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.MsgOnboardParticipantResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgOnboardParticipantResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgOnboardParticipantResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgOnboardParticipantResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgOnboardParticipantResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgOnboardParticipantResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgOnboardParticipantResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgOnboardParticipantResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgOnboardParticipantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgOnboardParticipantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -20,35 +1011,177 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// MsgOnboardParticipant defines a SDK message for enrolling a new validator. +type MsgOnboardParticipant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Participant is the msg sender + 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"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *MsgOnboardParticipant) Reset() { + *x = MsgOnboardParticipant{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgOnboardParticipant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgOnboardParticipant) ProtoMessage() {} + +// Deprecated: Use MsgOnboardParticipant.ProtoReflect.Descriptor instead. +func (*MsgOnboardParticipant) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgOnboardParticipant) GetParticipant() string { + if x != nil { + return x.Participant + } + return "" +} + +func (x *MsgOnboardParticipant) GetEthPayload() *EthPayload { + if x != nil { + return x.EthPayload + } + return nil +} + +func (x *MsgOnboardParticipant) GetEthSignature() string { + if x != nil { + return x.EthSignature + } + return "" +} + +func (x *MsgOnboardParticipant) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +type MsgOnboardParticipantResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgOnboardParticipantResponse) Reset() { + *x = MsgOnboardParticipantResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgOnboardParticipantResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgOnboardParticipantResponse) ProtoMessage() {} + +// Deprecated: Use MsgOnboardParticipantResponse.ProtoReflect.Descriptor instead. +func (*MsgOnboardParticipantResponse) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_tx_proto_rawDescGZIP(), []int{1} +} + var File_cerc_onboarding_v1_tx_proto protoreflect.FileDescriptor var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 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, + 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, + 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 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, 0xd1, 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, + 0x45, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x74, 0x68, 0x5f, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, + 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 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, 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 file_cerc_onboarding_v1_tx_proto_goTypes = []interface{}{} +var ( + file_cerc_onboarding_v1_tx_proto_rawDescOnce sync.Once + file_cerc_onboarding_v1_tx_proto_rawDescData = file_cerc_onboarding_v1_tx_proto_rawDesc +) + +func file_cerc_onboarding_v1_tx_proto_rawDescGZIP() []byte { + file_cerc_onboarding_v1_tx_proto_rawDescOnce.Do(func() { + file_cerc_onboarding_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_v1_tx_proto_rawDescData) + }) + return file_cerc_onboarding_v1_tx_proto_rawDescData +} + +var file_cerc_onboarding_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cerc_onboarding_v1_tx_proto_goTypes = []interface{}{ + (*MsgOnboardParticipant)(nil), // 0: cerc.onboarding.v1.MsgOnboardParticipant + (*MsgOnboardParticipantResponse)(nil), // 1: cerc.onboarding.v1.MsgOnboardParticipantResponse + (*EthPayload)(nil), // 2: cerc.onboarding.v1.EthPayload +} var file_cerc_onboarding_v1_tx_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: cerc.onboarding.v1.MsgOnboardParticipant.eth_payload:type_name -> cerc.onboarding.v1.EthPayload + 0, // 1: cerc.onboarding.v1.Msg.OnboardParticipant:input_type -> cerc.onboarding.v1.MsgOnboardParticipant + 1, // 2: cerc.onboarding.v1.Msg.OnboardParticipant:output_type -> cerc.onboarding.v1.MsgOnboardParticipantResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_tx_proto_init() } @@ -56,18 +1189,46 @@ func file_cerc_onboarding_v1_tx_proto_init() { if File_cerc_onboarding_v1_tx_proto != nil { return } + file_cerc_onboarding_v1_onboarding_proto_init() + if !protoimpl.UnsafeEnabled { + file_cerc_onboarding_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgOnboardParticipant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerc_onboarding_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgOnboardParticipantResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_onboarding_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 0, + NumMessages: 2, NumExtensions: 0, - NumServices: 0, + NumServices: 1, }, GoTypes: file_cerc_onboarding_v1_tx_proto_goTypes, DependencyIndexes: file_cerc_onboarding_v1_tx_proto_depIdxs, + MessageInfos: file_cerc_onboarding_v1_tx_proto_msgTypes, }.Build() File_cerc_onboarding_v1_tx_proto = out.File file_cerc_onboarding_v1_tx_proto_rawDesc = nil diff --git a/api/cerc/onboarding/v1/tx_grpc.pb.go b/api/cerc/onboarding/v1/tx_grpc.pb.go new file mode 100644 index 00000000..72d50ff0 --- /dev/null +++ b/api/cerc/onboarding/v1/tx_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cerc/onboarding/v1/tx.proto + +package onboardingv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_OnboardParticipant_FullMethodName = "/cerc.onboarding.v1.Msg/OnboardParticipant" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // OnboardParticipant defines a method for enrolling a new validator. + OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error) { + out := new(MsgOnboardParticipantResponse) + err := c.cc.Invoke(ctx, Msg_OnboardParticipant_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // OnboardParticipant defines a method for enrolling a new validator. + OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnboardParticipant not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_OnboardParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOnboardParticipant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OnboardParticipant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_OnboardParticipant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OnboardParticipant(ctx, req.(*MsgOnboardParticipant)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cerc.onboarding.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "OnboardParticipant", + Handler: _Msg_OnboardParticipant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cerc/onboarding/v1/tx.proto", +} diff --git a/go.mod b/go.mod index 76fe2f09..60d0f215 100644 --- a/go.mod +++ b/go.mod @@ -31,22 +31,24 @@ require ( github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.11 github.com/deckarep/golang-set v1.8.0 + github.com/ethereum/go-ethereum v1.14.5 github.com/gibson042/canonicaljson-go v1.0.3 github.com/go-chi/chi/v5 v5.0.8 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/ipfs/go-cid v0.4.1 github.com/ipld/go-ipld-prime v0.21.0 github.com/rs/cors v1.8.3 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.17.0 + github.com/statechannels/go-nitro v0.1.2 github.com/stretchr/testify v1.8.4 github.com/vektah/gqlparser/v2 v2.5.11 golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -57,19 +59,19 @@ require ( github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect 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 github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6 // indirect + github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect @@ -90,7 +92,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/emicklei/dot v1.6.0 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.25.0 // indirect @@ -119,13 +121,14 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.4 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -136,16 +139,16 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/minio/highwayhash v1.0.2 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/multiformats/go-base32 v0.0.3 // indirect - github.com/multiformats/go-base36 v0.1.0 // indirect - github.com/multiformats/go-multibase v0.0.3 // indirect + github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect - github.com/multiformats/go-varint v0.0.6 // indirect + github.com/multiformats/go-varint v0.0.7 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect @@ -163,6 +166,7 @@ require ( github.com/sagikazarmark/locafero v0.3.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.10.0 // indirect @@ -175,19 +179,21 @@ require ( github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect - go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.16.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gotest.tools/v3 v3.5.1 // indirect - lukechampine.com/blake3 v1.1.6 // indirect + lukechampine.com/blake3 v1.2.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +replace github.com/statechannels/go-nitro v0.1.2 => github.com/cerc-io/go-nitro v0.1.3-ts-port-0.1.10 diff --git a/go.sum b/go.sum index c7273ed5..900b830e 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -88,6 +88,7 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= @@ -122,12 +123,30 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8= +github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -137,11 +156,13 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cerc-io/go-nitro v0.1.3-ts-port-0.1.10 h1:lJg2a5Zi0kXxG89B1Fhq3VqnKmicK4AcUtruZUZQkDc= +github.com/cerc-io/go-nitro v0.1.3-ts-port-0.1.10/go.mod h1:x7xAzfyhRoVQ1hvuowH6LLEU/mmwpz1tQYLNi6F2ohI= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -168,8 +189,8 @@ github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZ github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6 h1:g+Y6IAf28JinY3zNdXwpw71SBGhLEb72kGQgiR5XKZM= -github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6/go.mod h1:acMRUGd/BK8AUmQNK3spUCCGzFLZU2bSST3NMXSq2Kc= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -220,16 +241,20 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -268,10 +293,12 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= +github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -379,8 +406,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -491,6 +518,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -511,6 +540,8 @@ github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E= github.com/ipld/go-ipld-prime v0.21.0/go.mod h1:3RLqy//ERg/y5oShXXdx5YIp50cFGOanyMctpPjsvxQ= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -518,6 +549,7 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -536,14 +568,14 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -594,8 +626,8 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQth github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= -github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -615,23 +647,22 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= +github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= -github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -659,6 +690,7 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -777,8 +809,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= @@ -889,12 +921,13 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -908,8 +941,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -949,8 +982,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -999,8 +1031,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1022,8 +1054,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1095,18 +1127,20 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1183,8 +1217,6 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1308,8 +1340,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1351,8 +1383,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= -lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= +lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= diff --git a/proto/cerc/onboarding/v1/genesis.proto b/proto/cerc/onboarding/v1/genesis.proto index 8f7cacec..5bfac13b 100644 --- a/proto/cerc/onboarding/v1/genesis.proto +++ b/proto/cerc/onboarding/v1/genesis.proto @@ -7,7 +7,10 @@ import "cerc/onboarding/v1/onboarding.proto"; option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; +// GenesisState defines the onboarding module's genesis state. message GenesisState { // params defines all the parameters of the module. Params params = 1 [ (gogoproto.nullable) = false ]; + // participants defines all the participants + repeated Participant participants = 2 [ (gogoproto.nullable) = false ]; } diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index b42f5cb1..371de6e2 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -8,3 +8,24 @@ option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; // Params defines the parameters of the onboarding module. message Params {} + +// Participant defines the data that will be stored for each enrolled participant +message Participant { + string cosmos_address = 1 [ + (gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\"" + ]; + + string ethereum_address = 2 [ + (gogoproto.moretags) = "json:\"ethereum_address\" yaml:\"ethereum_address\"" + ]; +} +// EthPayload defines the payload that is signed by the ethereum private key +message EthPayload { + string address = 1 [ + (gogoproto.moretags) = "json:\"address\" yaml:\"address\"" + ]; + + string msg = 2 [ + (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" + ]; +} diff --git a/proto/cerc/onboarding/v1/query.proto b/proto/cerc/onboarding/v1/query.proto index 06533faf..e3801fea 100644 --- a/proto/cerc/onboarding/v1/query.proto +++ b/proto/cerc/onboarding/v1/query.proto @@ -1,3 +1,5 @@ syntax = "proto3"; package cerc.onboarding.v1; + +option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto index 06533faf..10349819 100644 --- a/proto/cerc/onboarding/v1/tx.proto +++ b/proto/cerc/onboarding/v1/tx.proto @@ -1,3 +1,35 @@ syntax = "proto3"; package cerc.onboarding.v1; + +import "cosmos/msg/v1/msg.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "cerc/onboarding/v1/onboarding.proto"; + +option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; + +// Msg defines the onboarding Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // OnboardParticipant defines a method for enrolling a new validator. + rpc OnboardParticipant(MsgOnboardParticipant) + returns (MsgOnboardParticipantResponse) { + option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant"; + }; +} + +// MsgOnboardParticipant defines a SDK message for enrolling a new validator. +message MsgOnboardParticipant { + option (cosmos.msg.v1.signer) = "participant"; + + // Participant is the msg sender + string participant = 1; + EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ]; + string eth_signature = 3; + string message = 4; +} + +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +message MsgOnboardParticipantResponse {} diff --git a/utils/signature.go b/utils/signature.go new file mode 100644 index 00000000..7d818977 --- /dev/null +++ b/utils/signature.go @@ -0,0 +1,18 @@ +package utils + +import ( + "github.com/ethereum/go-ethereum/common" + + "github.com/statechannels/go-nitro/crypto" +) + +func DecodeEthereumAddress(message []byte, sig string) (string, error) { + if len(sig) > 2 && sig[:2] == "0x" { + sig = sig[2:] + } + + signature := crypto.SplitSignature(common.Hex2Bytes(sig)) + ethereumAddress, err := crypto.RecoverEthereumMessageSigner(message, signature) + + return ethereumAddress.String(), err +} diff --git a/x/auction/module/module.go b/x/auction/module/module.go index 141ff187..aaac320b 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -91,7 +91,7 @@ func (AppModule) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingCo return data.Validate() } -// InitGenesis performs genesis initialization for the checkers module. +// InitGenesis performs genesis initialization for the auction module. // It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState auction.GenesisState diff --git a/x/bond/errors.go b/x/bond/errors.go deleted file mode 100644 index fe614c9d..00000000 --- a/x/bond/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package bond - -import "cosmossdk.io/errors" - -var ( - ErrIndexTooLong = errors.Register(ModuleName, 2, "index too long") - ErrDuplicateAddress = errors.Register(ModuleName, 3, "duplicate address") - ErrInvalidBlack = errors.Register(ModuleName, 4, "black address is invalid: %s") - ErrInvalidRed = errors.Register(ModuleName, 5, "red address is invalid: %s") - ErrGameNotParseable = errors.Register(ModuleName, 6, "game cannot be parsed") -) diff --git a/x/bond/events.go b/x/bond/events.go index ba4848f3..4cba992d 100644 --- a/x/bond/events.go +++ b/x/bond/events.go @@ -3,7 +3,7 @@ package bond // bond module event types const ( - EventTypeCreateBond = "crate_bond" + EventTypeCreateBond = "create_bond" EventTypeRefillBond = "refill_bond" EventTypeCancelBond = "cancel_bond" EventTypeWithdrawBond = "withdraw_bond" diff --git a/x/bond/module/module.go b/x/bond/module/module.go index a912159e..a66ccd1c 100644 --- a/x/bond/module/module.go +++ b/x/bond/module/module.go @@ -88,7 +88,7 @@ func (AppModule) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingCo return data.Validate() } -// InitGenesis performs genesis initialization for the checkers module. +// InitGenesis performs genesis initialization for the bond module. // It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState bond.GenesisState diff --git a/x/onboarding/codec.go b/x/onboarding/codec.go index afcf7ed9..e57fdfba 100644 --- a/x/onboarding/codec.go +++ b/x/onboarding/codec.go @@ -2,9 +2,14 @@ package onboarding import ( types "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" ) // RegisterInterfaces registers the interfaces types with the interface registry. func RegisterInterfaces(registry types.InterfaceRegistry) { - // TODO: Implement + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgOnboardParticipant{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/onboarding/events.go b/x/onboarding/events.go new file mode 100644 index 00000000..804ada79 --- /dev/null +++ b/x/onboarding/events.go @@ -0,0 +1,11 @@ +package onboarding + +// onboarding module event types + +const ( + EventTypeOnboardParticipant = "onboard_participant" + + AttributeKeySigner = "signer" + AttributeKeyEthAddress = "eth_address" + AttributeValueCategory = ModuleName +) diff --git a/x/onboarding/genesis.go b/x/onboarding/genesis.go index 5b096ccd..6056d165 100644 --- a/x/onboarding/genesis.go +++ b/x/onboarding/genesis.go @@ -1,9 +1,16 @@ package onboarding -// NewGenesisState creates a new genesis state with default values. -func NewGenesisState() *GenesisState { +func DefaultGenesisState() *GenesisState { return &GenesisState{ - Params: DefaultParams(), + Params: DefaultParams(), + Participants: []Participant{}, + } +} + +func NewGenesisState(params Params, participants []Participant) *GenesisState { + return &GenesisState{ + Params: params, + Participants: participants, } } diff --git a/x/onboarding/genesis.pb.go b/x/onboarding/genesis.pb.go index b0fd4581..26d078c6 100644 --- a/x/onboarding/genesis.pb.go +++ b/x/onboarding/genesis.pb.go @@ -23,9 +23,12 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// GenesisState defines the onboarding module's genesis state. type GenesisState struct { // params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // participants defines all the participants + Participants []Participant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -68,6 +71,13 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetParticipants() []Participant { + if m != nil { + return m.Participants + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "cerc.onboarding.v1.GenesisState") } @@ -75,20 +85,22 @@ func init() { func init() { proto.RegisterFile("cerc/onboarding/v1/genesis.proto", fileDescriptor_d21793296c3d9d75) } var fileDescriptor_d21793296c3d9d75 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto + // 234 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x4e, 0x2d, 0x4a, 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xa9, 0xd0, 0x43, 0xa8, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, - 0x58, 0x10, 0x95, 0x52, 0xca, 0x58, 0xcc, 0x42, 0xd2, 0x07, 0x56, 0xa4, 0xe4, 0xc1, 0xc5, 0xe3, - 0x0e, 0x31, 0x3f, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x82, 0x8b, 0xad, 0x20, 0xb1, 0x28, 0x31, - 0xb7, 0x58, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4a, 0x0f, 0xd3, 0x3e, 0xbd, 0x00, 0xb0, - 0x0a, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xea, 0x9d, 0x9c, 0x4e, 0x3c, 0x92, 0x63, - 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, - 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x23, 0x3d, 0xb3, 0x44, 0xaf, 0x2c, 0x25, 0x49, 0xaf, - 0x24, 0x5f, 0x1f, 0x64, 0x9a, 0x6e, 0x66, 0xbe, 0x7e, 0x4e, 0x62, 0x72, 0x7e, 0x5e, 0x66, 0x72, - 0x8a, 0x7e, 0x05, 0x92, 0x9b, 0x92, 0xd8, 0xc0, 0x8e, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x79, 0x00, 0xd0, 0xb1, 0x07, 0x01, 0x00, 0x00, + 0x58, 0x10, 0x95, 0x52, 0xca, 0x58, 0xcc, 0x42, 0xd2, 0x07, 0x56, 0xa4, 0x34, 0x99, 0x91, 0x8b, + 0xc7, 0x1d, 0x62, 0x41, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x05, 0x17, 0x5b, 0x41, 0x62, 0x51, + 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xa6, 0x85, 0x7a, 0x01, + 0x60, 0x15, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x0b, 0x79, 0x72, 0xf1, 0x14, + 0x24, 0x16, 0x95, 0x64, 0x26, 0x67, 0x16, 0x24, 0xe6, 0x95, 0x14, 0x4b, 0x30, 0x29, 0x30, 0x6b, + 0x70, 0x1b, 0xc9, 0xe3, 0xd0, 0x0f, 0x53, 0x07, 0x35, 0x04, 0x45, 0xab, 0x93, 0xd3, 0x89, 0x47, + 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, + 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa4, 0x67, 0x96, 0xe8, 0x95, 0xa5, 0x24, + 0xe9, 0x95, 0xe4, 0xeb, 0x83, 0x0c, 0xd6, 0xcd, 0xcc, 0xd7, 0xcf, 0x49, 0x4c, 0xce, 0xcf, 0xcb, + 0x4c, 0x4e, 0xd1, 0xaf, 0x40, 0xf2, 0x5f, 0x12, 0x1b, 0xd8, 0x83, 0xc6, 0x80, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x90, 0xbd, 0x55, 0xee, 0x53, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -111,6 +123,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Participants) > 0 { + for iNdEx := len(m.Participants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Participants[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -143,6 +169,12 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if len(m.Participants) > 0 { + for _, e := range m.Participants { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -214,6 +246,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Participants = append(m.Participants, Participant{}) + if err := m.Participants[len(m.Participants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/onboarding/keeper/genesis.go b/x/onboarding/keeper/genesis.go index 54542bf2..335a13d9 100644 --- a/x/onboarding/keeper/genesis.go +++ b/x/onboarding/keeper/genesis.go @@ -12,6 +12,12 @@ func (k *Keeper) InitGenesis(ctx context.Context, data *onboarding.GenesisState) return err } + for _, participant := range data.Participants { + if err := k.Participants.Set(ctx, participant.CosmosAddress, participant); err != nil { + return err + } + } + return nil } @@ -22,7 +28,16 @@ func (k *Keeper) ExportGenesis(ctx context.Context) (*onboarding.GenesisState, e return nil, err } + var participants []onboarding.Participant + if err := k.Participants.Walk(ctx, nil, func(cosmosAddress string, participant onboarding.Participant) (bool, error) { + participants = append(participants, participant) + return false, nil + }); err != nil { + return nil, err + } + return &onboarding.GenesisState{ - Params: params, + Params: params, + Participants: participants, }, nil } diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index 7d41e967..ed6188ce 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -1,13 +1,20 @@ package keeper import ( + "encoding/json" "fmt" "cosmossdk.io/collections" "cosmossdk.io/core/address" storetypes "cosmossdk.io/core/store" - "github.com/cosmos/cosmos-sdk/codec" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "git.vdb.to/cerc-io/laconicd/utils" "git.vdb.to/cerc-io/laconicd/x/onboarding" ) @@ -20,8 +27,9 @@ type Keeper struct { authority string // state management - Schema collections.Schema - Params collections.Item[onboarding.Params] + Schema collections.Schema + Params collections.Item[onboarding.Params] + Participants collections.Map[string, onboarding.Participant] } // NewKeeper creates a new Keeper instance @@ -35,7 +43,8 @@ func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService s cdc: cdc, addressCodec: addressCodec, authority: authority, - Params: collections.NewItem(sb, onboarding.ParamsKey, "params", codec.CollValue[onboarding.Params](cdc)), + Params: collections.NewItem(sb, onboarding.ParamsPrefix, "params", codec.CollValue[onboarding.Params](cdc)), + Participants: collections.NewMap(sb, onboarding.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboarding.Participant](cdc)), } schema, err := sb.Build() @@ -52,3 +61,37 @@ func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService s func (k Keeper) GetAuthority() string { return k.authority } + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", onboarding.ModuleName) +} + +func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboarding.MsgOnboardParticipant, signerAddress sdk.AccAddress) (*onboarding.MsgOnboardParticipantResponse, error) { + message, err := json.Marshal(msg.EthPayload) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid format for payload") + } + + ethereumAddress, err := utils.DecodeEthereumAddress(message, msg.EthSignature) + if ethereumAddress != msg.EthPayload.Address { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Recovered ethereum address does not match the address set in payload") + } + + participant := &onboarding.Participant{ + CosmosAddress: signerAddress.String(), + EthereumAddress: ethereumAddress, + } + + if err := k.StoreParticipant(ctx, participant); err != nil { + return nil, err + } + + return nil, err +} + +func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboarding.Participant) error { + key := participant.CosmosAddress + k.Participants.Set(ctx, key, *participant) + + return nil +} diff --git a/x/onboarding/keeper/msg_server.go b/x/onboarding/keeper/msg_server.go new file mode 100644 index 00000000..ac8f6ae5 --- /dev/null +++ b/x/onboarding/keeper/msg_server.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "git.vdb.to/cerc-io/laconicd/utils" + "git.vdb.to/cerc-io/laconicd/x/onboarding" +) + +type msgServer struct { + k Keeper +} + +var _ onboarding.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the module MsgServer interface. +func NewMsgServerImpl(keeper *Keeper) onboarding.MsgServer { + return &msgServer{k: *keeper} +} + +func (ms msgServer) OnboardParticipant(c context.Context, msg *onboarding.MsgOnboardParticipant) (*onboarding.MsgOnboardParticipantResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + ctx = *utils.CtxWithCustomKVGasConfig(&ctx) + + signerAddress, err := sdk.AccAddressFromBech32(msg.Participant) + if err != nil { + return nil, err + } + + _, err = ms.k.OnboardParticipant(ctx, msg, signerAddress) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + onboarding.EventTypeOnboardParticipant, + sdk.NewAttribute(onboarding.AttributeKeySigner, msg.Participant), + sdk.NewAttribute(onboarding.AttributeKeyEthAddress, msg.EthPayload.Address), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, onboarding.AttributeValueCategory), + sdk.NewAttribute(onboarding.AttributeKeySigner, msg.Participant), + ), + }) + + utils.LogTxGasConsumed(ctx, ms.k.Logger(ctx), "OnboardParticipant") + + return &onboarding.MsgOnboardParticipantResponse{}, nil +} diff --git a/x/onboarding/keys.go b/x/onboarding/keys.go index 79ae9513..48031729 100644 --- a/x/onboarding/keys.go +++ b/x/onboarding/keys.go @@ -2,8 +2,15 @@ package onboarding import "cosmossdk.io/collections" -const ModuleName = "onboarding" +const ( + ModuleName = "onboarding" + + // StoreKey defines the primary module store key + StoreKey = ModuleName +) var ( - ParamsKey = collections.NewPrefix("Params") + ParamsPrefix = collections.NewPrefix(0) + + ParticipantsPrefix = collections.NewPrefix(1) ) diff --git a/x/onboarding/module/autocli.go b/x/onboarding/module/autocli.go index d9d58680..66f10f9d 100644 --- a/x/onboarding/module/autocli.go +++ b/x/onboarding/module/autocli.go @@ -2,12 +2,29 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + onboardingv1 "git.vdb.to/cerc-io/laconicd/api/cerc/onboarding/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ Query: nil, - Tx: nil, + // TODO: Use JSON file for input + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: onboardingv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "OnboardParticipant", + Use: "enroll", + Short: "Enroll a testnet validator", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "ethPayload"}, + {ProtoField: "ethSignature"}, + {ProtoField: "message"}, + }, + }, + }, + }, } } diff --git a/x/onboarding/module/module.go b/x/onboarding/module/module.go index 9850525c..7a6bfac4 100644 --- a/x/onboarding/module/module.go +++ b/x/onboarding/module/module.go @@ -70,7 +70,7 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } func (am AppModule) RegisterServices(cfg module.Configurator) { // TODO: Implement // Register servers - // onboarding.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + onboarding.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) // onboarding.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) // Register in place module state migration migrations @@ -82,7 +82,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // DefaultGenesis returns default genesis state as raw bytes for the module. func (AppModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(onboarding.NewGenesisState()) + return cdc.MustMarshalJSON(onboarding.DefaultGenesisState()) } // ValidateGenesis performs genesis state validation for the circuit module. diff --git a/x/onboarding/msgs.go b/x/onboarding/msgs.go new file mode 100644 index 00000000..1054968a --- /dev/null +++ b/x/onboarding/msgs.go @@ -0,0 +1,27 @@ +package onboarding + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + _ sdk.Msg = &MsgOnboardParticipant{} +) + +func (msg MsgOnboardParticipant) ValidateBasic() error { + if len(msg.Participant) == 0 { + return errorsmod.Wrap(sdkerrors.ErrorInvalidSigner, msg.Participant) + } + + if len(msg.EthPayload.Address) != 42 { + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Participant) + } + + if len(msg.EthSignature) != 132 { + return errorsmod.Wrap(sdkerrors.ErrNoSignatures, "Invalid signature.") + } + + return nil +} diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go index 510d225f..7b132726 100644 --- a/x/onboarding/onboarding.pb.go +++ b/x/onboarding/onboarding.pb.go @@ -5,7 +5,6 @@ package onboarding import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -61,8 +60,116 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +// Participant defines the data that will be stored for each enrolled participant +type Participant struct { + CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty" json:"cosmos_address" yaml:"cosmos_address"` + EthereumAddress string `protobuf:"bytes,2,opt,name=ethereum_address,json=ethereumAddress,proto3" json:"ethereum_address,omitempty" json:"ethereum_address" yaml:"ethereum_address"` +} + +func (m *Participant) Reset() { *m = Participant{} } +func (m *Participant) String() string { return proto.CompactTextString(m) } +func (*Participant) ProtoMessage() {} +func (*Participant) Descriptor() ([]byte, []int) { + return fileDescriptor_59afed779274eaf0, []int{1} +} +func (m *Participant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Participant.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 *Participant) XXX_Merge(src proto.Message) { + xxx_messageInfo_Participant.Merge(m, src) +} +func (m *Participant) XXX_Size() int { + return m.Size() +} +func (m *Participant) XXX_DiscardUnknown() { + xxx_messageInfo_Participant.DiscardUnknown(m) +} + +var xxx_messageInfo_Participant proto.InternalMessageInfo + +func (m *Participant) GetCosmosAddress() string { + if m != nil { + return m.CosmosAddress + } + return "" +} + +func (m *Participant) GetEthereumAddress() string { + if m != nil { + return m.EthereumAddress + } + 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"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty" json:"msg" yaml:"msg"` +} + +func (m *EthPayload) Reset() { *m = EthPayload{} } +func (m *EthPayload) String() string { return proto.CompactTextString(m) } +func (*EthPayload) ProtoMessage() {} +func (*EthPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_59afed779274eaf0, []int{2} +} +func (m *EthPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EthPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EthPayload.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 *EthPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_EthPayload.Merge(m, src) +} +func (m *EthPayload) XXX_Size() int { + return m.Size() +} +func (m *EthPayload) XXX_DiscardUnknown() { + xxx_messageInfo_EthPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_EthPayload proto.InternalMessageInfo + +func (m *EthPayload) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *EthPayload) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + func init() { proto.RegisterType((*Params)(nil), "cerc.onboarding.v1.Params") + proto.RegisterType((*Participant)(nil), "cerc.onboarding.v1.Participant") + proto.RegisterType((*EthPayload)(nil), "cerc.onboarding.v1.EthPayload") } func init() { @@ -70,18 +177,27 @@ func init() { } var fileDescriptor_59afed779274eaf0 = []byte{ - // 176 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0x4e, 0x2d, 0x4a, - 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x44, 0xe2, - 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x81, 0x14, 0xe9, 0x21, 0x09, 0x97, 0x19, 0x4a, - 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xa5, 0xf5, 0x41, 0x2c, 0x88, 0x4a, 0x29, 0xb9, 0xe4, 0xfc, - 0xe2, 0xdc, 0xfc, 0x62, 0xfd, 0xa4, 0xc4, 0xe2, 0x54, 0xfd, 0x32, 0xc3, 0xa4, 0xd4, 0x92, 0x44, - 0x43, 0xfd, 0xe4, 0xfc, 0xcc, 0x3c, 0x88, 0xbc, 0x12, 0x07, 0x17, 0x5b, 0x40, 0x62, 0x51, 0x62, - 0x6e, 0xb1, 0x93, 0xd3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, - 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa4, - 0x67, 0x96, 0xe8, 0x95, 0xa5, 0x24, 0xe9, 0x95, 0xe4, 0xeb, 0x83, 0x2c, 0xd6, 0xcd, 0xcc, 0xd7, - 0xcf, 0x49, 0x4c, 0xce, 0xcf, 0xcb, 0x4c, 0x4e, 0xd1, 0xaf, 0x40, 0x72, 0x5d, 0x12, 0x1b, 0xd8, - 0x50, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0xff, 0xee, 0x2e, 0xc5, 0x00, 0x00, 0x00, + // 313 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcd, 0x4a, 0x03, 0x31, + 0x14, 0x85, 0x3b, 0x0a, 0x55, 0x23, 0xfe, 0x30, 0x28, 0xa8, 0x60, 0xa6, 0x8e, 0x9b, 0x42, 0x71, + 0x42, 0xe9, 0x4e, 0x57, 0x16, 0xdc, 0x97, 0x2e, 0x5c, 0xb8, 0x50, 0xd2, 0x64, 0x48, 0x23, 0xcd, + 0xdc, 0x92, 0xc4, 0xc1, 0xbe, 0x85, 0x2f, 0x25, 0xb8, 0xec, 0xd2, 0xd5, 0x20, 0xed, 0x1b, 0xcc, + 0x13, 0xc8, 0x34, 0x9d, 0x32, 0x6d, 0x77, 0xb9, 0xe7, 0x9e, 0xf3, 0xe5, 0xc2, 0x41, 0xb7, 0x2c, + 0xd6, 0x8c, 0x40, 0x32, 0x00, 0xaa, 0xb9, 0x4c, 0x04, 0x49, 0xdb, 0x95, 0x29, 0x1a, 0x6b, 0xb0, + 0xe0, 0xfb, 0x85, 0x29, 0xaa, 0xc8, 0x69, 0xfb, 0xea, 0x4c, 0x80, 0x80, 0xc5, 0x9a, 0x14, 0x2f, + 0xe7, 0x0c, 0xf7, 0x51, 0xbd, 0x47, 0x35, 0x55, 0x26, 0xfc, 0xf6, 0xd0, 0x61, 0x8f, 0x6a, 0x2b, + 0x99, 0x1c, 0xd3, 0xc4, 0xfa, 0xcf, 0xe8, 0x98, 0x81, 0x51, 0x60, 0xde, 0x28, 0xe7, 0x3a, 0x36, + 0xe6, 0xc2, 0x6b, 0x78, 0xcd, 0x83, 0x2e, 0xc9, 0xb3, 0xa0, 0xf5, 0x6e, 0x20, 0xb9, 0x0f, 0xd7, + 0xf7, 0x61, 0x63, 0x42, 0xd5, 0x68, 0x4b, 0xed, 0x1f, 0x39, 0xe1, 0xd1, 0xcd, 0xfe, 0x2b, 0x3a, + 0x8d, 0xed, 0x30, 0xd6, 0xf1, 0x87, 0x5a, 0x91, 0x77, 0x16, 0xe4, 0x4e, 0x9e, 0x05, 0xc4, 0x91, + 0x37, 0x1d, 0x25, 0x7b, 0x4b, 0xef, 0x9f, 0x94, 0xd2, 0x92, 0x1f, 0xa6, 0x08, 0x3d, 0xd9, 0x61, + 0x8f, 0x4e, 0x46, 0x40, 0xb9, 0xff, 0x80, 0xf6, 0xd6, 0xcf, 0xbf, 0xc9, 0xb3, 0xe0, 0xda, 0x7d, + 0xb2, 0xc1, 0x5e, 0x21, 0xcb, 0x84, 0xdf, 0x42, 0xbb, 0xca, 0x88, 0xe5, 0x75, 0x97, 0x79, 0x16, + 0x9c, 0xbb, 0xa0, 0x32, 0xa2, 0x0c, 0x15, 0xcf, 0x7e, 0xe1, 0xea, 0x76, 0x7f, 0x66, 0xd8, 0x9b, + 0xce, 0xb0, 0xf7, 0x37, 0xc3, 0xde, 0xd7, 0x1c, 0xd7, 0xa6, 0x73, 0x5c, 0xfb, 0x9d, 0xe3, 0xda, + 0x4b, 0x53, 0x48, 0x1b, 0xa5, 0x7c, 0x10, 0x59, 0x20, 0x45, 0x31, 0x77, 0x12, 0xc8, 0x88, 0x32, + 0x48, 0x24, 0xe3, 0xe4, 0xb3, 0xd2, 0xde, 0xa0, 0xbe, 0x28, 0xa5, 0xf3, 0x1f, 0x00, 0x00, 0xff, + 0xff, 0x48, 0x0e, 0x81, 0xbf, 0xe5, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -107,6 +223,80 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Participant) 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 *Participant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EthereumAddress) > 0 { + i -= len(m.EthereumAddress) + copy(dAtA[i:], m.EthereumAddress) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.EthereumAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.CosmosAddress) > 0 { + i -= len(m.CosmosAddress) + copy(dAtA[i:], m.CosmosAddress) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.CosmosAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EthPayload) 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 *EthPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EthPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintOnboarding(dAtA []byte, offset int, v uint64) int { offset -= sovOnboarding(v) base := offset @@ -127,6 +317,40 @@ func (m *Params) Size() (n int) { return n } +func (m *Participant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CosmosAddress) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) + } + l = len(m.EthereumAddress) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) + } + return n +} + +func (m *EthPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovOnboarding(uint64(l)) + } + return n +} + func sovOnboarding(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -183,6 +407,234 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *Participant) 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 ErrIntOverflowOnboarding + } + 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: Participant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Participant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmosAddress", 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.CosmosAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthereumAddress", 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.EthereumAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnboarding(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnboarding + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EthPayload) 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 ErrIntOverflowOnboarding + } + 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: EthPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EthPayload: 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 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", 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.Msg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnboarding(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnboarding + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipOnboarding(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/onboarding/query.pb.go b/x/onboarding/query.pb.go new file mode 100644 index 00000000..2cb71677 --- /dev/null +++ b/x/onboarding/query.pb.go @@ -0,0 +1,36 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cerc/onboarding/v1/query.proto + +package onboarding + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("cerc/onboarding/v1/query.proto", fileDescriptor_80831d904221d27d) } + +var fileDescriptor_80831d904221d27d = []byte{ + // 130 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0x4e, 0x2d, 0x4a, + 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x2f, + 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xc9, 0xeb, 0x21, + 0xe4, 0xf5, 0xca, 0x0c, 0x9d, 0x9c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0x4a, 0x23, 0x3d, 0xb3, 0x44, 0xaf, 0x2c, 0x25, 0x49, 0xaf, 0x24, 0x5f, 0x1f, 0xa4, 0x51, 0x37, + 0x33, 0x5f, 0x3f, 0x27, 0x31, 0x39, 0x3f, 0x2f, 0x33, 0x39, 0x45, 0xbf, 0x02, 0xc9, 0x9a, 0x24, + 0x36, 0xb0, 0xf1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0x20, 0xf3, 0xc5, 0x80, 0x00, + 0x00, 0x00, +} diff --git a/x/onboarding/tx.pb.go b/x/onboarding/tx.pb.go new file mode 100644 index 00000000..c1743b11 --- /dev/null +++ b/x/onboarding/tx.pb.go @@ -0,0 +1,695 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cerc/onboarding/v1/tx.proto + +package onboarding + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgOnboardParticipant defines a SDK message for enrolling a new validator. +type MsgOnboardParticipant struct { + // Participant is the msg sender + 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"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *MsgOnboardParticipant) Reset() { *m = MsgOnboardParticipant{} } +func (m *MsgOnboardParticipant) String() string { return proto.CompactTextString(m) } +func (*MsgOnboardParticipant) ProtoMessage() {} +func (*MsgOnboardParticipant) Descriptor() ([]byte, []int) { + return fileDescriptor_6bfde34a550e231e, []int{0} +} +func (m *MsgOnboardParticipant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgOnboardParticipant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgOnboardParticipant.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 *MsgOnboardParticipant) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOnboardParticipant.Merge(m, src) +} +func (m *MsgOnboardParticipant) XXX_Size() int { + return m.Size() +} +func (m *MsgOnboardParticipant) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOnboardParticipant.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgOnboardParticipant proto.InternalMessageInfo + +func (m *MsgOnboardParticipant) GetParticipant() string { + if m != nil { + return m.Participant + } + return "" +} + +func (m *MsgOnboardParticipant) GetEthPayload() EthPayload { + if m != nil { + return m.EthPayload + } + return EthPayload{} +} + +func (m *MsgOnboardParticipant) GetEthSignature() string { + if m != nil { + return m.EthSignature + } + return "" +} + +func (m *MsgOnboardParticipant) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +type MsgOnboardParticipantResponse struct { +} + +func (m *MsgOnboardParticipantResponse) Reset() { *m = MsgOnboardParticipantResponse{} } +func (m *MsgOnboardParticipantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgOnboardParticipantResponse) ProtoMessage() {} +func (*MsgOnboardParticipantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6bfde34a550e231e, []int{1} +} +func (m *MsgOnboardParticipantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgOnboardParticipantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgOnboardParticipantResponse.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 *MsgOnboardParticipantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOnboardParticipantResponse.Merge(m, src) +} +func (m *MsgOnboardParticipantResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgOnboardParticipantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOnboardParticipantResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgOnboardParticipantResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgOnboardParticipant)(nil), "cerc.onboarding.v1.MsgOnboardParticipant") + proto.RegisterType((*MsgOnboardParticipantResponse)(nil), "cerc.onboarding.v1.MsgOnboardParticipantResponse") +} + +func init() { proto.RegisterFile("cerc/onboarding/v1/tx.proto", fileDescriptor_6bfde34a550e231e) } + +var fileDescriptor_6bfde34a550e231e = []byte{ + // 384 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xc1, 0x8a, 0x1a, 0x41, + 0x14, 0x9c, 0x56, 0x93, 0x90, 0x36, 0x81, 0xd0, 0x24, 0x64, 0x98, 0x24, 0xa3, 0x8c, 0x87, 0xa8, + 0x90, 0x69, 0x34, 0xb7, 0x1c, 0x05, 0x8f, 0x12, 0x31, 0xb7, 0x5c, 0xa4, 0x9d, 0x69, 0xda, 0x06, + 0xa7, 0xdf, 0x30, 0xdd, 0x11, 0x73, 0x0b, 0x7e, 0x41, 0x60, 0x3f, 0x61, 0x7f, 0x40, 0xf6, 0x2b, + 0x3c, 0xba, 0xec, 0x65, 0x4f, 0xcb, 0xa2, 0x0b, 0xfe, 0xc6, 0xe2, 0xa8, 0xeb, 0xc0, 0xce, 0xc2, + 0xde, 0xde, 0xab, 0x2a, 0xaa, 0x5e, 0xf1, 0xf0, 0xa7, 0x80, 0x27, 0x01, 0x05, 0x35, 0x02, 0x96, + 0x84, 0x52, 0x09, 0x3a, 0x6d, 0x51, 0x33, 0xf3, 0xe3, 0x04, 0x0c, 0x10, 0xb2, 0x23, 0xfd, 0x13, + 0xe9, 0x4f, 0x5b, 0xce, 0xc7, 0x00, 0x74, 0x04, 0x9a, 0x46, 0x3a, 0xd5, 0x46, 0x5a, 0xec, 0xc5, + 0xce, 0x67, 0x01, 0x20, 0x26, 0x9c, 0xb2, 0x58, 0x52, 0xa6, 0x14, 0x18, 0x66, 0x24, 0x28, 0x7d, + 0x60, 0xdf, 0x0b, 0x10, 0x90, 0x8e, 0x74, 0x37, 0x1d, 0xd0, 0x5a, 0x4e, 0x7a, 0x26, 0x2e, 0x15, + 0x79, 0x97, 0x08, 0x7f, 0xe8, 0x69, 0xf1, 0x73, 0x8f, 0xf7, 0x59, 0x62, 0x64, 0x20, 0x63, 0xa6, + 0x0c, 0xa9, 0xe2, 0x72, 0x7c, 0x5a, 0x6d, 0x54, 0x45, 0xf5, 0xd7, 0x83, 0x2c, 0x44, 0xba, 0xb8, + 0xcc, 0xcd, 0x78, 0x18, 0xb3, 0xbf, 0x13, 0x60, 0xa1, 0x5d, 0xa8, 0xa2, 0x7a, 0xb9, 0xed, 0xfa, + 0x8f, 0x7b, 0xf9, 0x5d, 0x33, 0xee, 0xef, 0x55, 0x9d, 0xd2, 0xf2, 0xa6, 0x62, 0x0d, 0x30, 0x7f, + 0x40, 0x48, 0x0d, 0xbf, 0xdd, 0xd9, 0x68, 0x29, 0x14, 0x33, 0x7f, 0x12, 0x6e, 0x17, 0xd3, 0xa8, + 0x37, 0xdc, 0x8c, 0x7f, 0x1d, 0x31, 0x62, 0xe3, 0x57, 0x11, 0xd7, 0x9a, 0x09, 0x6e, 0x97, 0x52, + 0xfa, 0xb8, 0xfe, 0x78, 0x37, 0xdf, 0x2e, 0x9a, 0xd9, 0xbb, 0xbc, 0x0a, 0xfe, 0x92, 0x5b, 0x69, + 0xc0, 0x75, 0x0c, 0x4a, 0xf3, 0xf6, 0x05, 0xc2, 0xc5, 0x9e, 0x16, 0xe4, 0x1c, 0x61, 0x92, 0xd3, + 0xbc, 0x91, 0x57, 0x21, 0xd7, 0xd1, 0x69, 0x3d, 0x5b, 0x7a, 0x0c, 0xf7, 0xe8, 0xfc, 0xea, 0xee, + 0xac, 0xd0, 0xf0, 0xbe, 0xd2, 0xa7, 0xff, 0x33, 0xcc, 0xd4, 0x71, 0x5e, 0xfc, 0xdb, 0x2e, 0x9a, + 0xa8, 0xd3, 0x59, 0xae, 0x5d, 0xb4, 0x5a, 0xbb, 0xe8, 0x76, 0xed, 0xa2, 0xff, 0x1b, 0xd7, 0x5a, + 0x6d, 0x5c, 0xeb, 0x7a, 0xe3, 0x5a, 0xbf, 0xeb, 0x42, 0x1a, 0x7f, 0x1a, 0x8e, 0x7c, 0x03, 0xa9, + 0xe7, 0x37, 0x09, 0x74, 0xc2, 0x02, 0x50, 0x32, 0x08, 0xe9, 0x2c, 0x93, 0x30, 0x7a, 0x99, 0x3e, + 0xfd, 0xfb, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe2, 0xe0, 0x84, 0x99, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // OnboardParticipant defines a method for enrolling a new validator. + OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) OnboardParticipant(ctx context.Context, in *MsgOnboardParticipant, opts ...grpc.CallOption) (*MsgOnboardParticipantResponse, error) { + out := new(MsgOnboardParticipantResponse) + err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Msg/OnboardParticipant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // OnboardParticipant defines a method for enrolling a new validator. + OnboardParticipant(context.Context, *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) OnboardParticipant(ctx context.Context, req *MsgOnboardParticipant) (*MsgOnboardParticipantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnboardParticipant not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_OnboardParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOnboardParticipant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OnboardParticipant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cerc.onboarding.v1.Msg/OnboardParticipant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OnboardParticipant(ctx, req.(*MsgOnboardParticipant)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cerc.onboarding.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "OnboardParticipant", + Handler: _Msg_OnboardParticipant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cerc/onboarding/v1/tx.proto", +} + +func (m *MsgOnboardParticipant) 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 *MsgOnboardParticipant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgOnboardParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 + } + if len(m.EthSignature) > 0 { + i -= len(m.EthSignature) + copy(dAtA[i:], m.EthSignature) + i = encodeVarintTx(dAtA, i, uint64(len(m.EthSignature))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.EthPayload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Participant) > 0 { + i -= len(m.Participant) + copy(dAtA[i:], m.Participant) + i = encodeVarintTx(dAtA, i, uint64(len(m.Participant))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgOnboardParticipantResponse) 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 *MsgOnboardParticipantResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgOnboardParticipantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgOnboardParticipant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Participant) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.EthPayload.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.EthSignature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgOnboardParticipantResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgOnboardParticipant) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOnboardParticipant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOnboardParticipant: 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 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.Participant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthPayload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.EthPayload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthSignature", 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.EthSignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOnboardParticipantResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOnboardParticipantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOnboardParticipantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onboarding/tx.pb.gw.go b/x/onboarding/tx.pb.gw.go new file mode 100644 index 00000000..c3482f48 --- /dev/null +++ b/x/onboarding/tx.pb.gw.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cerc/onboarding/v1/tx.proto + +/* +Package onboarding is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package onboarding + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Msg_OnboardParticipant_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_OnboardParticipant_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgOnboardParticipant + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_OnboardParticipant_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.OnboardParticipant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_OnboardParticipant_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgOnboardParticipant + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_OnboardParticipant_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.OnboardParticipant(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". +// UnaryRPC :call MsgServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. +func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { + + mux.Handle("POST", pattern_Msg_OnboardParticipant_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_Msg_OnboardParticipant_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_Msg_OnboardParticipant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMsgHandler(ctx, mux, conn) +} + +// RegisterMsgHandler registers the http handlers for service Msg to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) +} + +// RegisterMsgHandlerClient registers the http handlers for service Msg +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MsgClient" to call the correct interceptors. +func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { + + mux.Handle("POST", pattern_Msg_OnboardParticipant_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_Msg_OnboardParticipant_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_OnboardParticipant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Msg_OnboardParticipant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "onboarding", "v1", "onboard_participant"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Msg_OnboardParticipant_0 = runtime.ForwardResponseMessage +) diff --git a/x/registry/module/module.go b/x/registry/module/module.go index 154e5a5d..7ee50901 100644 --- a/x/registry/module/module.go +++ b/x/registry/module/module.go @@ -52,21 +52,21 @@ func NewAppModuleBasic(m AppModule) module.AppModuleBasic { // module.AppModuleBasic -// Name returns the checkers module's name. +// Name returns the registry module's name. func (AppModule) Name() string { return registrytypes.ModuleName } -// RegisterLegacyAminoCodec registers the checkers module's types on the LegacyAmino codec. +// RegisterLegacyAminoCodec registers the registry module's types on the LegacyAmino codec. // New modules do not need to support Amino. func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the checkers module. +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the registry module. func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { if err := registrytypes.RegisterQueryHandlerClient(context.Background(), mux, registrytypes.NewQueryClient(clientCtx)); err != nil { panic(err) } } -// RegisterInterfaces registers interfaces and implementations of the checkers module. +// RegisterInterfaces registers interfaces and implementations of the registry module. func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { registrytypes.RegisterInterfaces(registry) } @@ -91,7 +91,7 @@ func (AppModule) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, return data.Validate() } -// InitGenesis performs genesis initialization for the checkers module. +// InitGenesis performs genesis initialization for the registry module. // It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState registrytypes.GenesisState -- 2.45.2 From 582c83543ca39c96eb62b7eb8224c986328bd741 Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:53:26 +0530 Subject: [PATCH 3/8] Implement query in onboarding module to list the registered participants (#4) * Implement query to list participants * Remove unnecessary comments --- api/cerc/onboarding/v1/query.pulsar.go | 1233 ++++++++++++++++++++++- api/cerc/onboarding/v1/query_grpc.pb.go | 111 ++ proto/cerc/onboarding/v1/query.proto | 28 + x/onboarding/keeper/keeper.go | 39 +- x/onboarding/keeper/query_server.go | 32 + x/onboarding/module/autocli.go | 16 +- x/onboarding/module/module.go | 11 +- x/onboarding/query.pb.go | 655 +++++++++++- x/onboarding/query.pb.gw.go | 171 ++++ 9 files changed, 2247 insertions(+), 49 deletions(-) create mode 100644 api/cerc/onboarding/v1/query_grpc.pb.go create mode 100644 x/onboarding/keeper/query_server.go create mode 100644 x/onboarding/query.pb.gw.go diff --git a/api/cerc/onboarding/v1/query.pulsar.go b/api/cerc/onboarding/v1/query.pulsar.go index f6533f42..24a81269 100644 --- a/api/cerc/onboarding/v1/query.pulsar.go +++ b/api/cerc/onboarding/v1/query.pulsar.go @@ -2,11 +2,1027 @@ package onboardingv1 import ( + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" reflect "reflect" + sync "sync" ) +var ( + md_QueryParticipantsRequest protoreflect.MessageDescriptor + fd_QueryParticipantsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_query_proto_init() + md_QueryParticipantsRequest = File_cerc_onboarding_v1_query_proto.Messages().ByName("QueryParticipantsRequest") + fd_QueryParticipantsRequest_pagination = md_QueryParticipantsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryParticipantsRequest)(nil) + +type fastReflection_QueryParticipantsRequest QueryParticipantsRequest + +func (x *QueryParticipantsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParticipantsRequest)(x) +} + +func (x *QueryParticipantsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParticipantsRequest_messageType fastReflection_QueryParticipantsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParticipantsRequest_messageType{} + +type fastReflection_QueryParticipantsRequest_messageType struct{} + +func (x fastReflection_QueryParticipantsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParticipantsRequest)(nil) +} +func (x fastReflection_QueryParticipantsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParticipantsRequest) +} +func (x fastReflection_QueryParticipantsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParticipantsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParticipantsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParticipantsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParticipantsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParticipantsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParticipantsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParticipantsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParticipantsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParticipantsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParticipantsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryParticipantsRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParticipantsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParticipantsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParticipantsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsRequest")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParticipantsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.QueryParticipantsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParticipantsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParticipantsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParticipantsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParticipantsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParticipantsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParticipantsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParticipantsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParticipantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryParticipantsResponse_1_list)(nil) + +type _QueryParticipantsResponse_1_list struct { + list *[]*Participant +} + +func (x *_QueryParticipantsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryParticipantsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryParticipantsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Participant) + (*x.list)[i] = concreteValue +} + +func (x *_QueryParticipantsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Participant) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryParticipantsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Participant) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParticipantsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryParticipantsResponse_1_list) NewElement() protoreflect.Value { + v := new(Participant) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParticipantsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryParticipantsResponse protoreflect.MessageDescriptor + fd_QueryParticipantsResponse_participants protoreflect.FieldDescriptor + fd_QueryParticipantsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cerc_onboarding_v1_query_proto_init() + md_QueryParticipantsResponse = File_cerc_onboarding_v1_query_proto.Messages().ByName("QueryParticipantsResponse") + fd_QueryParticipantsResponse_participants = md_QueryParticipantsResponse.Fields().ByName("participants") + fd_QueryParticipantsResponse_pagination = md_QueryParticipantsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryParticipantsResponse)(nil) + +type fastReflection_QueryParticipantsResponse QueryParticipantsResponse + +func (x *QueryParticipantsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParticipantsResponse)(x) +} + +func (x *QueryParticipantsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_onboarding_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParticipantsResponse_messageType fastReflection_QueryParticipantsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParticipantsResponse_messageType{} + +type fastReflection_QueryParticipantsResponse_messageType struct{} + +func (x fastReflection_QueryParticipantsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParticipantsResponse)(nil) +} +func (x fastReflection_QueryParticipantsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParticipantsResponse) +} +func (x fastReflection_QueryParticipantsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParticipantsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParticipantsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParticipantsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParticipantsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParticipantsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParticipantsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParticipantsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParticipantsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParticipantsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParticipantsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Participants) != 0 { + value := protoreflect.ValueOfList(&_QueryParticipantsResponse_1_list{list: &x.Participants}) + if !f(fd_QueryParticipantsResponse_participants, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryParticipantsResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParticipantsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + return len(x.Participants) != 0 + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + x.Participants = nil + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParticipantsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + if len(x.Participants) == 0 { + return protoreflect.ValueOfList(&_QueryParticipantsResponse_1_list{}) + } + listValue := &_QueryParticipantsResponse_1_list{list: &x.Participants} + return protoreflect.ValueOfList(listValue) + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + lv := value.List() + clv := lv.(*_QueryParticipantsResponse_1_list) + x.Participants = *clv.list + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + if x.Participants == nil { + x.Participants = []*Participant{} + } + value := &_QueryParticipantsResponse_1_list{list: &x.Participants} + return protoreflect.ValueOfList(value) + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParticipantsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.onboarding.v1.QueryParticipantsResponse.participants": + list := []*Participant{} + return protoreflect.ValueOfList(&_QueryParticipantsResponse_1_list{list: &list}) + case "cerc.onboarding.v1.QueryParticipantsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.QueryParticipantsResponse")) + } + panic(fmt.Errorf("message cerc.onboarding.v1.QueryParticipantsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParticipantsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.onboarding.v1.QueryParticipantsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParticipantsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParticipantsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParticipantsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParticipantsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParticipantsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Participants) > 0 { + for _, e := range x.Participants { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParticipantsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Participants) > 0 { + for iNdEx := len(x.Participants) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Participants[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParticipantsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParticipantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParticipantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Participants = append(x.Participants, &Participant{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Participants[len(x.Participants)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -20,35 +1036,180 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// QueryParticipantsRequest queries participants +type QueryParticipantsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryParticipantsRequest) Reset() { + *x = QueryParticipantsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParticipantsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParticipantsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParticipantsRequest.ProtoReflect.Descriptor instead. +func (*QueryParticipantsRequest) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_query_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryParticipantsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryParticipantsResponse is response type for get the participants +type QueryParticipantsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Participants []*Participant `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryParticipantsResponse) Reset() { + *x = QueryParticipantsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_onboarding_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParticipantsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParticipantsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParticipantsResponse.ProtoReflect.Descriptor instead. +func (*QueryParticipantsResponse) Descriptor() ([]byte, []int) { + return file_cerc_onboarding_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParticipantsResponse) GetParticipants() []*Participant { + if x != nil { + return x.Participants + } + return nil +} + +func (x *QueryParticipantsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + var File_cerc_onboarding_v1_query_proto protoreflect.FileDescriptor var file_cerc_onboarding_v1_query_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x42, 0xcf, 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, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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, + 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 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, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd6, 0x01, + 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x0c, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x42, 0x2b, 0xf2, 0xde, 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x52, + 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x47, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x96, 0x01, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0xcf, 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, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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_cerc_onboarding_v1_query_proto_goTypes = []interface{}{} +var ( + file_cerc_onboarding_v1_query_proto_rawDescOnce sync.Once + file_cerc_onboarding_v1_query_proto_rawDescData = file_cerc_onboarding_v1_query_proto_rawDesc +) + +func file_cerc_onboarding_v1_query_proto_rawDescGZIP() []byte { + file_cerc_onboarding_v1_query_proto_rawDescOnce.Do(func() { + file_cerc_onboarding_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_onboarding_v1_query_proto_rawDescData) + }) + return file_cerc_onboarding_v1_query_proto_rawDescData +} + +var file_cerc_onboarding_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cerc_onboarding_v1_query_proto_goTypes = []interface{}{ + (*QueryParticipantsRequest)(nil), // 0: cerc.onboarding.v1.QueryParticipantsRequest + (*QueryParticipantsResponse)(nil), // 1: cerc.onboarding.v1.QueryParticipantsResponse + (*v1beta1.PageRequest)(nil), // 2: cosmos.base.query.v1beta1.PageRequest + (*Participant)(nil), // 3: cerc.onboarding.v1.Participant + (*v1beta1.PageResponse)(nil), // 4: cosmos.base.query.v1beta1.PageResponse +} var file_cerc_onboarding_v1_query_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: cerc.onboarding.v1.QueryParticipantsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 3, // 1: cerc.onboarding.v1.QueryParticipantsResponse.participants:type_name -> cerc.onboarding.v1.Participant + 4, // 2: cerc.onboarding.v1.QueryParticipantsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 3: cerc.onboarding.v1.Query.Participants:input_type -> cerc.onboarding.v1.QueryParticipantsRequest + 1, // 4: cerc.onboarding.v1.Query.Participants:output_type -> cerc.onboarding.v1.QueryParticipantsResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cerc_onboarding_v1_query_proto_init() } @@ -56,18 +1217,46 @@ func file_cerc_onboarding_v1_query_proto_init() { if File_cerc_onboarding_v1_query_proto != nil { return } + file_cerc_onboarding_v1_onboarding_proto_init() + if !protoimpl.UnsafeEnabled { + file_cerc_onboarding_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParticipantsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerc_onboarding_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParticipantsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_onboarding_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 0, + NumMessages: 2, NumExtensions: 0, - NumServices: 0, + NumServices: 1, }, GoTypes: file_cerc_onboarding_v1_query_proto_goTypes, DependencyIndexes: file_cerc_onboarding_v1_query_proto_depIdxs, + MessageInfos: file_cerc_onboarding_v1_query_proto_msgTypes, }.Build() File_cerc_onboarding_v1_query_proto = out.File file_cerc_onboarding_v1_query_proto_rawDesc = nil diff --git a/api/cerc/onboarding/v1/query_grpc.pb.go b/api/cerc/onboarding/v1/query_grpc.pb.go new file mode 100644 index 00000000..be33bad8 --- /dev/null +++ b/api/cerc/onboarding/v1/query_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cerc/onboarding/v1/query.proto + +package onboardingv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Participants_FullMethodName = "/cerc.onboarding.v1.Query/Participants" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Participants queries Participants list + Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error) { + out := new(QueryParticipantsResponse) + err := c.cc.Invoke(ctx, Query_Participants_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) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Participants(context.Context, *QueryParticipantsRequest) (*QueryParticipantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParticipantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Participants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Participants_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Participants(ctx, req.(*QueryParticipantsRequest)) + } + 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) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cerc.onboarding.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Participants", + Handler: _Query_Participants_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cerc/onboarding/v1/query.proto", +} diff --git a/proto/cerc/onboarding/v1/query.proto b/proto/cerc/onboarding/v1/query.proto index e3801fea..1345bb80 100644 --- a/proto/cerc/onboarding/v1/query.proto +++ b/proto/cerc/onboarding/v1/query.proto @@ -2,4 +2,32 @@ syntax = "proto3"; package cerc.onboarding.v1; +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cerc/onboarding/v1/onboarding.proto"; +import "google/api/annotations.proto"; + option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; + +// Query defines the gRPC querier service for onboarding module +service Query { + // Participants queries Participants list + rpc Participants(QueryParticipantsRequest) returns (QueryParticipantsResponse) { + option (google.api.http).get = "/cerc/onboarding/v1/participants"; + } +} + +// QueryParticipantsRequest queries participants +message QueryParticipantsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryParticipantsResponse is response type for get the participants +message QueryParticipantsResponse { + repeated Participant participants = 1 + [ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index ed6188ce..55629f6b 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -15,7 +15,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "git.vdb.to/cerc-io/laconicd/utils" - "git.vdb.to/cerc-io/laconicd/x/onboarding" + onboardingTypes "git.vdb.to/cerc-io/laconicd/x/onboarding" ) type Keeper struct { @@ -28,8 +28,8 @@ type Keeper struct { // state management Schema collections.Schema - Params collections.Item[onboarding.Params] - Participants collections.Map[string, onboarding.Participant] + Params collections.Item[onboardingTypes.Params] + Participants collections.Map[string, onboardingTypes.Participant] } // NewKeeper creates a new Keeper instance @@ -43,8 +43,8 @@ func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService s cdc: cdc, addressCodec: addressCodec, authority: authority, - Params: collections.NewItem(sb, onboarding.ParamsPrefix, "params", codec.CollValue[onboarding.Params](cdc)), - Participants: collections.NewMap(sb, onboarding.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboarding.Participant](cdc)), + Params: collections.NewItem(sb, onboardingTypes.ParamsPrefix, "params", codec.CollValue[onboardingTypes.Params](cdc)), + Participants: collections.NewMap(sb, onboardingTypes.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboardingTypes.Participant](cdc)), } schema, err := sb.Build() @@ -63,10 +63,10 @@ func (k Keeper) GetAuthority() string { } func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", onboarding.ModuleName) + return ctx.Logger().With("module", onboardingTypes.ModuleName) } -func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboarding.MsgOnboardParticipant, signerAddress sdk.AccAddress) (*onboarding.MsgOnboardParticipantResponse, error) { +func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnboardParticipant, signerAddress sdk.AccAddress) (*onboardingTypes.MsgOnboardParticipantResponse, error) { message, err := json.Marshal(msg.EthPayload) if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid format for payload") @@ -77,7 +77,7 @@ func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboarding.MsgOnboardPa return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Recovered ethereum address does not match the address set in payload") } - participant := &onboarding.Participant{ + participant := &onboardingTypes.Participant{ CosmosAddress: signerAddress.String(), EthereumAddress: ethereumAddress, } @@ -89,9 +89,30 @@ func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboarding.MsgOnboardPa return nil, err } -func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboarding.Participant) error { +func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboardingTypes.Participant) error { key := participant.CosmosAddress k.Participants.Set(ctx, key, *participant) return nil } + +// ListParticipants - get all participants. +func (k Keeper) ListParticipants(ctx sdk.Context) ([]*onboardingTypes.Participant, error) { + var participants []*onboardingTypes.Participant + + iter, err := k.Participants.Iterate(ctx, nil) + if err != nil { + return nil, err + } + + for ; iter.Valid(); iter.Next() { + participant, err := iter.Value() + if err != nil { + return nil, err + } + + participants = append(participants, &participant) + } + + return participants, nil +} diff --git a/x/onboarding/keeper/query_server.go b/x/onboarding/keeper/query_server.go new file mode 100644 index 00000000..dbfd416b --- /dev/null +++ b/x/onboarding/keeper/query_server.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + onboardingtypes "git.vdb.to/cerc-io/laconicd/x/onboarding" +) + +var _ onboardingtypes.QueryServer = queryServer{} + +type queryServer struct { + k *Keeper +} + +// NewQueryServerImpl returns an implementation of the module QueryServer. +func NewQueryServerImpl(k *Keeper) onboardingtypes.QueryServer { + return queryServer{k} +} + +// Participants implements Participants.QueryServer. +func (qs queryServer) Participants(c context.Context, _ *onboardingtypes.QueryParticipantsRequest) (*onboardingtypes.QueryParticipantsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + resp, err := qs.k.ListParticipants(ctx) + if err != nil { + return nil, err + } + + return &onboardingtypes.QueryParticipantsResponse{Participants: resp}, nil +} diff --git a/x/onboarding/module/autocli.go b/x/onboarding/module/autocli.go index 66f10f9d..a4fb5ceb 100644 --- a/x/onboarding/module/autocli.go +++ b/x/onboarding/module/autocli.go @@ -9,7 +9,17 @@ import ( // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ - Query: nil, + Query: &autocliv1.ServiceCommandDescriptor{ + Service: onboardingv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Participants", + Use: "list", + Short: "List participants", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, + }, + }, + }, // TODO: Use JSON file for input Tx: &autocliv1.ServiceCommandDescriptor{ Service: onboardingv1.Msg_ServiceDesc.ServiceName, @@ -19,8 +29,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "enroll", Short: "Enroll a testnet validator", PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - {ProtoField: "ethPayload"}, - {ProtoField: "ethSignature"}, + {ProtoField: "eth_payload"}, + {ProtoField: "eth_signature"}, {ProtoField: "message"}, }, }, diff --git a/x/onboarding/module/module.go b/x/onboarding/module/module.go index 7a6bfac4..c483c2fe 100644 --- a/x/onboarding/module/module.go +++ b/x/onboarding/module/module.go @@ -1,6 +1,7 @@ package module import ( + "context" "encoding/json" "fmt" @@ -52,10 +53,9 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the onboarding module. func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { - // TODO: Implement - // if err := onboarding.RegisterQueryHandlerClient(context.Background(), mux, onboarding.NewQueryClient(clientCtx)); err != nil { - // panic(err) - // } + if err := onboarding.RegisterQueryHandlerClient(context.Background(), mux, onboarding.NewQueryClient(clientCtx)); err != nil { + panic(err) + } } // RegisterInterfaces registers interfaces and implementations of the onboarding module. @@ -68,10 +68,9 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - // TODO: Implement // Register servers onboarding.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - // onboarding.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) + onboarding.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) // Register in place module state migration migrations // m := keeper.NewMigrator(am.keeper) diff --git a/x/onboarding/query.pb.go b/x/onboarding/query.pb.go index 2cb71677..d121fbeb 100644 --- a/x/onboarding/query.pb.go +++ b/x/onboarding/query.pb.go @@ -4,9 +4,19 @@ package onboarding import ( + context "context" fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -20,17 +30,644 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryParticipantsRequest queries participants +type QueryParticipantsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryParticipantsRequest) Reset() { *m = QueryParticipantsRequest{} } +func (m *QueryParticipantsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParticipantsRequest) ProtoMessage() {} +func (*QueryParticipantsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_80831d904221d27d, []int{0} +} +func (m *QueryParticipantsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParticipantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParticipantsRequest.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 *QueryParticipantsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParticipantsRequest.Merge(m, src) +} +func (m *QueryParticipantsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParticipantsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParticipantsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParticipantsRequest proto.InternalMessageInfo + +func (m *QueryParticipantsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryParticipantsResponse is response type for get 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. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryParticipantsResponse) Reset() { *m = QueryParticipantsResponse{} } +func (m *QueryParticipantsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParticipantsResponse) ProtoMessage() {} +func (*QueryParticipantsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_80831d904221d27d, []int{1} +} +func (m *QueryParticipantsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParticipantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParticipantsResponse.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 *QueryParticipantsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParticipantsResponse.Merge(m, src) +} +func (m *QueryParticipantsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParticipantsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParticipantsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParticipantsResponse proto.InternalMessageInfo + +func (m *QueryParticipantsResponse) GetParticipants() []*Participant { + if m != nil { + return m.Participants + } + return nil +} + +func (m *QueryParticipantsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParticipantsRequest)(nil), "cerc.onboarding.v1.QueryParticipantsRequest") + proto.RegisterType((*QueryParticipantsResponse)(nil), "cerc.onboarding.v1.QueryParticipantsResponse") +} + func init() { proto.RegisterFile("cerc/onboarding/v1/query.proto", fileDescriptor_80831d904221d27d) } var fileDescriptor_80831d904221d27d = []byte{ - // 130 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0x4e, 0x2d, 0x4a, - 0xd6, 0xcf, 0xcf, 0x4b, 0xca, 0x4f, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x2f, - 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xc9, 0xeb, 0x21, - 0xe4, 0xf5, 0xca, 0x0c, 0x9d, 0x9c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, - 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, - 0x4a, 0x23, 0x3d, 0xb3, 0x44, 0xaf, 0x2c, 0x25, 0x49, 0xaf, 0x24, 0x5f, 0x1f, 0xa4, 0x51, 0x37, - 0x33, 0x5f, 0x3f, 0x27, 0x31, 0x39, 0x3f, 0x2f, 0x33, 0x39, 0x45, 0xbf, 0x02, 0xc9, 0x9a, 0x24, - 0x36, 0xb0, 0xf1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0x20, 0xf3, 0xc5, 0x80, 0x00, + // 386 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x6f, 0x1a, 0x31, + 0x18, 0xc6, 0x31, 0x55, 0x3b, 0x18, 0x26, 0xab, 0x03, 0x45, 0xd5, 0x41, 0x0f, 0xa9, 0xd0, 0x3f, + 0xd8, 0x3a, 0xba, 0x75, 0x64, 0x68, 0x57, 0xca, 0xd8, 0xcd, 0x77, 0x58, 0x96, 0x23, 0xf0, 0x7b, + 0x9c, 0xcd, 0x29, 0xac, 0xf9, 0x04, 0x91, 0x22, 0x65, 0xce, 0xc7, 0xc9, 0x88, 0x14, 0x29, 0xca, + 0x14, 0x45, 0x90, 0x4f, 0x90, 0x4f, 0x10, 0xdd, 0x19, 0x09, 0x93, 0x10, 0x25, 0x9b, 0xe5, 0xf7, + 0xcf, 0xf3, 0xfc, 0x5e, 0x3d, 0x38, 0x48, 0x44, 0x96, 0x30, 0xd0, 0x31, 0xf0, 0x6c, 0xa2, 0xb4, + 0x64, 0x79, 0xc4, 0xe6, 0x0b, 0x91, 0x2d, 0x69, 0x9a, 0x81, 0x05, 0x42, 0x8a, 0x3a, 0xdd, 0xd5, + 0x69, 0x1e, 0x35, 0x3f, 0x4a, 0x90, 0x50, 0x96, 0x59, 0xf1, 0x72, 0x9d, 0xcd, 0xef, 0x09, 0x98, + 0x19, 0x18, 0x16, 0x73, 0x23, 0xdc, 0x0a, 0x96, 0x47, 0xb1, 0xb0, 0x3c, 0x62, 0x29, 0x97, 0x4a, + 0x73, 0xab, 0x40, 0x6f, 0x7b, 0x3b, 0x07, 0x54, 0x3d, 0x0d, 0xd7, 0xf4, 0x59, 0x02, 0xc8, 0xa9, + 0x60, 0x3c, 0x55, 0x8c, 0x6b, 0x0d, 0xb6, 0xdc, 0x60, 0x5c, 0x35, 0x8c, 0x71, 0xe3, 0x5f, 0x21, + 0x32, 0xe2, 0x99, 0x55, 0x89, 0x4a, 0xb9, 0xb6, 0x66, 0x2c, 0xe6, 0x0b, 0x61, 0x2c, 0xf9, 0x83, + 0xf1, 0x4e, 0xb2, 0x81, 0xda, 0xa8, 0x57, 0x1b, 0x7c, 0xa5, 0xce, 0x1f, 0x2d, 0xfc, 0x51, 0x87, + 0xb8, 0xf5, 0x47, 0x47, 0x5c, 0x8a, 0xed, 0xec, 0xd8, 0x9b, 0x0c, 0xaf, 0x11, 0xfe, 0x74, 0x40, + 0xc4, 0xa4, 0xa0, 0x8d, 0x20, 0x29, 0xae, 0xa7, 0xde, 0x7f, 0x03, 0xb5, 0xdf, 0xf5, 0x6a, 0x83, + 0x16, 0x7d, 0x7e, 0x31, 0xea, 0xcd, 0x0f, 0x7f, 0x3c, 0xdc, 0xb6, 0xba, 0x47, 0x06, 0xf4, 0xef, + 0xd0, 0x1f, 0x0f, 0xdb, 0x4b, 0x3e, 0x9b, 0x3e, 0xf9, 0x1b, 0xef, 0x29, 0x90, 0xbf, 0x7b, 0x5c, + 0xd5, 0x92, 0xab, 0xfb, 0x2a, 0x97, 0xb3, 0xeb, 0x83, 0x0d, 0x2e, 0x10, 0x7e, 0x5f, 0x82, 0x91, + 0x73, 0x84, 0xeb, 0x3e, 0x1d, 0xf9, 0x79, 0xc8, 0xff, 0x4b, 0x97, 0x6e, 0xf6, 0xdf, 0xd8, 0xed, + 0x3c, 0x84, 0xdf, 0x4e, 0xae, 0xee, 0xcf, 0xaa, 0x1d, 0xf2, 0x85, 0x95, 0x01, 0xf0, 0xe0, 0x8a, + 0x04, 0xf8, 0xac, 0xc3, 0xe1, 0xe5, 0x3a, 0x40, 0xab, 0x75, 0x80, 0xee, 0xd6, 0x01, 0x3a, 0xdd, + 0x04, 0x95, 0xd5, 0x26, 0xa8, 0xdc, 0x6c, 0x82, 0xca, 0xff, 0x9e, 0x54, 0x96, 0xe6, 0x93, 0x98, + 0x5a, 0x28, 0xd7, 0xf4, 0x15, 0xb0, 0x29, 0x4f, 0x40, 0xab, 0x64, 0xc2, 0x8e, 0xbd, 0x1c, 0xc5, + 0x1f, 0xca, 0xa8, 0xfc, 0x7a, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x83, 0x20, 0x78, 0x04, 0xe5, 0x02, 0x00, 0x00, } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Participants queries Participants list + Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Participants(ctx context.Context, in *QueryParticipantsRequest, opts ...grpc.CallOption) (*QueryParticipantsResponse, error) { + out := new(QueryParticipantsResponse) + err := c.cc.Invoke(ctx, "/cerc.onboarding.v1.Query/Participants", 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) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Participants(ctx context.Context, req *QueryParticipantsRequest) (*QueryParticipantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Participants not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Participants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParticipantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Participants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cerc.onboarding.v1.Query/Participants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Participants(ctx, req.(*QueryParticipantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cerc.onboarding.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Participants", + Handler: _Query_Participants_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cerc/onboarding/v1/query.proto", +} + +func (m *QueryParticipantsRequest) 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 *QueryParticipantsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParticipantsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryParticipantsResponse) 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 *QueryParticipantsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParticipantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Participants) > 0 { + for iNdEx := len(m.Participants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Participants[iNdEx].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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParticipantsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParticipantsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Participants) > 0 { + for _, e := range m.Participants { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParticipantsRequest) 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: QueryParticipantsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParticipantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryParticipantsResponse) 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: QueryParticipantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParticipantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Participants", 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 + } + m.Participants = append(m.Participants, &Participant{}) + if err := m.Participants[len(m.Participants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onboarding/query.pb.gw.go b/x/onboarding/query.pb.gw.go new file mode 100644 index 00000000..c8cb28f1 --- /dev/null +++ b/x/onboarding/query.pb.gw.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cerc/onboarding/v1/query.proto + +/* +Package onboarding is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package onboarding + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Participants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Participants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParticipantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Participants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Participants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Participants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParticipantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Participants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Participants(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Participants_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_Participants_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_Participants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Participants_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_Participants_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_Participants_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", "participant", "v1", "participants"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Participants_0 = runtime.ForwardResponseMessage +) -- 2.45.2 From 8c14d578f7c7ea7109a4a209c84749cc23e3e0ec Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:10:10 +0530 Subject: [PATCH 4/8] Add flag to enable/disable onboarding of validators (#6) * Add gql implementation for getParticipant query * Add onboarding enable/disable flag * Remove unnecessary message field from onboardParticipant message * Add instructions to generate gql bindings --- api/cerc/onboarding/v1/onboarding.pulsar.go | 139 +++++++--- api/cerc/onboarding/v1/query.pulsar.go | 40 +-- api/cerc/onboarding/v1/tx.pulsar.go | 134 +++------- gql/README.md | 34 +++ gql/cerc-io/laconicd/schema.graphql | 8 + gql/generated.go | 269 ++++++++++++++++++++ gql/models_gen.go | 5 + gql/resolver.go | 19 ++ proto/cerc/onboarding/v1/onboarding.proto | 6 +- proto/cerc/onboarding/v1/tx.proto | 1 - scripts/init.sh | 6 + tests/sdk_tests/docker-compose.yml | 1 + x/onboarding/keeper/keeper.go | 11 +- x/onboarding/module/autocli.go | 1 - x/onboarding/onboarding.pb.go | 85 +++++-- x/onboarding/query.pb.go | 51 ++-- x/onboarding/query.pb.gw.go | 2 +- x/onboarding/tx.pb.go | 101 ++------ 18 files changed, 626 insertions(+), 287 deletions(-) diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go index 3da44d43..f2f72741 100644 --- a/api/cerc/onboarding/v1/onboarding.pulsar.go +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -14,12 +14,14 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_onboarding_enabled protoreflect.FieldDescriptor ) func init() { file_cerc_onboarding_v1_onboarding_proto_init() md_Params = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Params") + fd_Params_onboarding_enabled = md_Params.Fields().ByName("onboarding_enabled") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -87,6 +89,12 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OnboardingEnabled != false { + value := protoreflect.ValueOfBool(x.OnboardingEnabled) + if !f(fd_Params_onboarding_enabled, value) { + return + } + } } // Has reports whether a field is populated. @@ -102,6 +110,8 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + return x.OnboardingEnabled != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -118,6 +128,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + x.OnboardingEnabled = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -134,6 +146,9 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + value := x.OnboardingEnabled + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -154,6 +169,8 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + x.OnboardingEnabled = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -174,6 +191,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + panic(fmt.Errorf("field onboarding_enabled of message cerc.onboarding.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -187,6 +206,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cerc.onboarding.v1.Params.onboarding_enabled": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Params")) @@ -256,6 +277,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if x.OnboardingEnabled { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -285,6 +309,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.OnboardingEnabled { + i-- + if x.OnboardingEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -334,6 +368,26 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OnboardingEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.OnboardingEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1355,6 +1409,8 @@ type Params struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + OnboardingEnabled bool `protobuf:"varint,1,opt,name=onboarding_enabled,json=onboardingEnabled,proto3" json:"onboarding_enabled,omitempty"` } func (x *Params) Reset() { @@ -1377,6 +1433,13 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cerc_onboarding_v1_onboarding_proto_rawDescGZIP(), []int{0} } +func (x *Params) GetOnboardingEnabled() bool { + if x != nil { + return x.OnboardingEnabled + } + return false +} + // Participant defines the data that will be stored for each enrolled participant type Participant struct { state protoimpl.MessageState @@ -1473,41 +1536,47 @@ var file_cerc_onboarding_v1_onboarding_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xc5, 0x01, 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, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, - 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x52, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x5e, 0x0a, 0x10, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xf2, 0xde, 0x1f, - 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, + 0x70, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x66, 0x0a, 0x12, 0x6f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x37, 0xf2, 0xde, 0x1f, 0x33, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, + 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, 0xc5, 0x01, 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, + 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0d, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5e, 0x0a, 0x10, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x33, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, - 0x52, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 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, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 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, } var ( diff --git a/api/cerc/onboarding/v1/query.pulsar.go b/api/cerc/onboarding/v1/query.pulsar.go index 24a81269..2c7863a0 100644 --- a/api/cerc/onboarding/v1/query.pulsar.go +++ b/api/cerc/onboarding/v1/query.pulsar.go @@ -1152,31 +1152,31 @@ var file_cerc_onboarding_v1_query_proto_rawDesc = []byte{ 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x96, 0x01, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x9f, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x95, 0x01, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0xcf, 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, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0xcf, 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, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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 ( diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go index 045acc6c..21d3ae03 100644 --- a/api/cerc/onboarding/v1/tx.pulsar.go +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -20,7 +20,6 @@ var ( fd_MsgOnboardParticipant_participant protoreflect.FieldDescriptor fd_MsgOnboardParticipant_eth_payload protoreflect.FieldDescriptor fd_MsgOnboardParticipant_eth_signature protoreflect.FieldDescriptor - fd_MsgOnboardParticipant_message protoreflect.FieldDescriptor ) func init() { @@ -29,7 +28,6 @@ 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_message = md_MsgOnboardParticipant.Fields().ByName("message") } var _ protoreflect.Message = (*fastReflection_MsgOnboardParticipant)(nil) @@ -115,12 +113,6 @@ func (x *fastReflection_MsgOnboardParticipant) Range(f func(protoreflect.FieldDe return } } - if x.Message != "" { - value := protoreflect.ValueOfString(x.Message) - if !f(fd_MsgOnboardParticipant_message, value) { - return - } - } } // Has reports whether a field is populated. @@ -142,8 +134,6 @@ 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.message": - return x.Message != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -166,8 +156,6 @@ 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.message": - x.Message = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -193,9 +181,6 @@ 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.message": - value := x.Message - return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -222,8 +207,6 @@ 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.message": - x.Message = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -253,8 +236,6 @@ 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.message": - panic(fmt.Errorf("field message 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")) @@ -275,8 +256,6 @@ 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.message": - return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.MsgOnboardParticipant")) @@ -358,10 +337,6 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Message) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -391,13 +366,6 @@ func (x *fastReflection_MsgOnboardParticipant) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Message) > 0 { - i -= len(x.Message) - copy(dAtA[i:], x.Message) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Message))) - i-- - dAtA[i] = 0x22 - } if len(x.EthSignature) > 0 { i -= len(x.EthSignature) copy(dAtA[i:], x.EthSignature) @@ -575,38 +543,6 @@ 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 Message", 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.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1021,7 +957,6 @@ 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"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` } func (x *MsgOnboardParticipant) Reset() { @@ -1065,13 +1000,6 @@ func (x *MsgOnboardParticipant) GetEthSignature() string { return "" } -func (x *MsgOnboardParticipant) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. type MsgOnboardParticipantResponse struct { state protoimpl.MessageState @@ -1112,7 +1040,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, 0xd1, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x6f, 0x74, 0x6f, 0x22, 0xb7, 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, @@ -1122,37 +1050,35 @@ var file_cerc_onboarding_v1_tx_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x74, 0x68, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, - 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 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, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, - 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x27, 0x2f, - 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, - 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcc, 0x01, - 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, - 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, - 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, - 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, - 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, - 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x10, 0x82, 0xe7, 0xb0, + 0x2a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x1f, 0x0a, + 0x1d, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb2, + 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0xa3, 0x01, 0x0a, 0x12, 0x4f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x29, 0x2e, + 0x63, 0x65, 0x72, 0x63, 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, + 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x29, 0x22, 0x27, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, + 0x2e, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x2e, 0x76, + 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, + 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, + 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x6e, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, + 0xaa, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x4f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x65, 0x72, + 0x63, 0x5c, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x65, + 0x72, 0x63, 0x3a, 0x3a, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/gql/README.md b/gql/README.md index 11813071..1b1a5d26 100644 --- a/gql/README.md +++ b/gql/README.md @@ -2,6 +2,29 @@ > Browser : http://localhost:9473 for gql +## Run gqlgen + +On having some change in the GQL schema (for example: adding a new query) update the [schema.graphql](./cerc-io/laconicd/schema.graphql) file as required and run the following: + +- Generate GQL bindings: + + ```bash + # Install gqlgen if not present + go get github.com/99designs/gqlgen@v0.17.22 + + # Generate bindings + go run github.com/99designs/gqlgen generate + ``` + +- Implement the required resolver method(s) + +- Regenerate GQL bindings: + + ```bash + # Generate bindings + go run github.com/99designs/gqlgen generate + ``` + ## Start server ```shell @@ -351,3 +374,14 @@ Resolve Names } } ``` + +Query participants: + +```graphql +{ + getParticipants { + cosmos_address + ethereum_address + } +} +``` \ No newline at end of file diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index d090c8c6..11220cd3 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -30,6 +30,11 @@ type Account { balance: [Coin!] # Current balance for each coin type. } +type Participant { + cosmos_address: String! # Cosmos address of the participant who will be registered. + ethereum_address: String! # Ethereum addresss of the participant who will be registered. +} + # Value describes a DAG-JSON compatible value. union Value = BooleanValue @@ -255,4 +260,7 @@ type Query { # Get auctions by IDs. getAuctionsByIds(ids: [String!]): [Auction] + + # Query participants. + getParticipants: [Participant]! } diff --git a/gql/generated.go b/gql/generated.go index ede3423f..5531cb38 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -153,6 +153,11 @@ type ComplexityRoot struct { Owner func(childComplexity int) int } + Participant struct { + CosmosAddress func(childComplexity int) int + EthereumAddress func(childComplexity int) int + } + PeerInfo struct { IsOutbound func(childComplexity int) int Node func(childComplexity int) int @@ -163,6 +168,7 @@ type ComplexityRoot 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 @@ -225,6 +231,7 @@ type QueryResolver interface { 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) } type executableSchema struct { @@ -634,6 +641,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OwnerBonds.Owner(childComplexity), true + case "Participant.cosmos_address": + if e.complexity.Participant.CosmosAddress == nil { + break + } + + return e.complexity.Participant.CosmosAddress(childComplexity), true + + case "Participant.ethereum_address": + if e.complexity.Participant.EthereumAddress == nil { + break + } + + return e.complexity.Participant.EthereumAddress(childComplexity), true + case "PeerInfo.is_outbound": if e.complexity.PeerInfo.IsOutbound == nil { break @@ -691,6 +712,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.GetBondsByIds(childComplexity, args["ids"].([]string)), true + case "Query.getParticipants": + if e.complexity.Query.GetParticipants == nil { + break + } + + return e.complexity.Query.GetParticipants(childComplexity), true + case "Query.getRecordsByIds": if e.complexity.Query.GetRecordsByIds == nil { break @@ -3808,6 +3836,94 @@ func (ec *executionContext) fieldContext_OwnerBonds_bonds(ctx context.Context, f return fc, nil } +func (ec *executionContext) _Participant_cosmos_address(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_cosmos_address(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.CosmosAddress, 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_cosmos_address(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_ethereum_address(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_ethereum_address(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.EthereumAddress, 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_ethereum_address(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 { @@ -4677,6 +4793,56 @@ func (ec *executionContext) fieldContext_Query_getAuctionsByIds(ctx context.Cont return fc, nil } +func (ec *executionContext) _Query_getParticipants(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getParticipants(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().GetParticipants(rctx) + }) + 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_getParticipants(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 "cosmos_address": + return ec.fieldContext_Participant_cosmos_address(ctx, field) + case "ethereum_address": + return ec.fieldContext_Participant_ethereum_address(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name) + }, + } + 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 { @@ -8611,6 +8777,41 @@ func (ec *executionContext) _OwnerBonds(ctx context.Context, sel ast.SelectionSe return out } +var participantImplementors = []string{"Participant"} + +func (ec *executionContext) _Participant(ctx context.Context, sel ast.SelectionSet, obj *Participant) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, participantImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Participant") + case "cosmos_address": + + out.Values[i] = ec._Participant_cosmos_address(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "ethereum_address": + + out.Values[i] = ec._Participant_ethereum_address(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 peerInfoImplementors = []string{"PeerInfo"} func (ec *executionContext) _PeerInfo(ctx context.Context, sel ast.SelectionSet, obj *PeerInfo) graphql.Marshaler { @@ -8901,6 +9102,29 @@ 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 "getParticipants": + 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_getParticipants(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) }) @@ -9727,6 +9951,44 @@ func (ec *executionContext) marshalNNodeInfo2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlac return ec._NodeInfo(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 + 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.marshalOParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + 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 @@ -10670,6 +10932,13 @@ func (ec *executionContext) marshalOOwnerBonds2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋl return ec._OwnerBonds(ctx, sel, v) } +func (ec *executionContext) marshalOParticipant2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐParticipant(ctx context.Context, sel ast.SelectionSet, v *Participant) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Participant(ctx, sel, v) +} + func (ec *executionContext) marshalOPeerInfo2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐPeerInfo(ctx context.Context, sel ast.SelectionSet, v []*PeerInfo) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/gql/models_gen.go b/gql/models_gen.go index 31f2e511..4308ae69 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -135,6 +135,11 @@ type OwnerBonds struct { Bonds []*Bond `json:"bonds"` } +type Participant struct { + CosmosAddress string `json:"cosmos_address"` + EthereumAddress string `json:"ethereum_address"` +} + type PeerInfo struct { Node *NodeInfo `json:"node"` IsOutbound bool `json:"is_outbound"` diff --git a/gql/resolver.go b/gql/resolver.go index cdb2654d..9e1c1daf 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -13,6 +13,7 @@ import ( auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction" bondtypes "git.vdb.to/cerc-io/laconicd/x/bond" + onboardingTypes "git.vdb.to/cerc-io/laconicd/x/onboarding" registrytypes "git.vdb.to/cerc-io/laconicd/x/registry" ) @@ -359,3 +360,21 @@ func (q queryResolver) GetAuctionsByIds(ctx context.Context, ids []string) ([]*A return gqlAuctionResponse, nil } + +func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, error) { + onboardingQueryClient := onboardingTypes.NewQueryClient(q.ctx) + participantResp, err := onboardingQueryClient.Participants(context.Background(), &onboardingTypes.QueryParticipantsRequest{}) + if err != nil { + return nil, err + } + + participants := make([]*Participant, len(participantResp.GetParticipants())) + for i, p := range participantResp.Participants { + participants[i] = &Participant{ + CosmosAddress: p.CosmosAddress, + EthereumAddress: p.EthereumAddress, + } + } + + return participants, nil +} diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index 371de6e2..876cc7ea 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -7,7 +7,11 @@ import "gogoproto/gogo.proto"; option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; // Params defines the parameters of the onboarding module. -message Params {} +message Params { + bool onboarding_enabled = 1 [ + (gogoproto.moretags) = "json:\"onboarding_enabled\" yaml:\"onboarding_enabled\"" + ]; +} // Participant defines the data that will be stored for each enrolled participant message Participant { diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto index 10349819..bf07de52 100644 --- a/proto/cerc/onboarding/v1/tx.proto +++ b/proto/cerc/onboarding/v1/tx.proto @@ -28,7 +28,6 @@ message MsgOnboardParticipant { string participant = 1; EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ]; string eth_signature = 3; - string message = 4; } // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. diff --git a/scripts/init.sh b/scripts/init.sh index 4b9225e3..a2d6da18 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -52,6 +52,12 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then update_genesis '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"' fi + if [[ "$ONBOARDING_ENABLED" == "true" ]]; then + echo "Enabling validator onboarding." + + update_genesis '.app_state["onboarding"]["params"]["onboarding_enabled"]=true' + fi + # increase block time (?) update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"' diff --git a/tests/sdk_tests/docker-compose.yml b/tests/sdk_tests/docker-compose.yml index 8982d7de..c944eff9 100644 --- a/tests/sdk_tests/docker-compose.yml +++ b/tests/sdk_tests/docker-compose.yml @@ -6,6 +6,7 @@ services: environment: - TEST_AUCTION_ENABLED - TEST_REGISTRY_EXPIRY + - ONBOARDING_ENABLED - LOGLEVEL volumes: - ../../scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index 55629f6b..cf0dc7e4 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -67,6 +67,15 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnboardParticipant, signerAddress sdk.AccAddress) (*onboardingTypes.MsgOnboardParticipantResponse, error) { + params, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + + if !params.OnboardingEnabled { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Validator onboarding is disabled") + } + message, err := json.Marshal(msg.EthPayload) if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid format for payload") @@ -86,7 +95,7 @@ func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnbo return nil, err } - return nil, err + return &onboardingTypes.MsgOnboardParticipantResponse{}, nil } func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboardingTypes.Participant) error { diff --git a/x/onboarding/module/autocli.go b/x/onboarding/module/autocli.go index a4fb5ceb..29a651e0 100644 --- a/x/onboarding/module/autocli.go +++ b/x/onboarding/module/autocli.go @@ -31,7 +31,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "eth_payload"}, {ProtoField: "eth_signature"}, - {ProtoField: "message"}, }, }, }, diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go index 7b132726..facbab6c 100644 --- a/x/onboarding/onboarding.pb.go +++ b/x/onboarding/onboarding.pb.go @@ -25,6 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters of the onboarding module. type Params struct { + OnboardingEnabled bool `protobuf:"varint,1,opt,name=onboarding_enabled,json=onboardingEnabled,proto3" json:"onboarding_enabled,omitempty" json:"onboarding_enabled" yaml:"onboarding_enabled"` } func (m *Params) Reset() { *m = Params{} } @@ -60,6 +61,13 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetOnboardingEnabled() bool { + if m != nil { + return m.OnboardingEnabled + } + return false +} + // Participant defines the data that will be stored for each enrolled participant type Participant struct { CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty" json:"cosmos_address" yaml:"cosmos_address"` @@ -177,27 +185,29 @@ func init() { } var fileDescriptor_59afed779274eaf0 = []byte{ - // 313 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcd, 0x4a, 0x03, 0x31, - 0x14, 0x85, 0x3b, 0x0a, 0x55, 0x23, 0xfe, 0x30, 0x28, 0xa8, 0x60, 0xa6, 0x8e, 0x9b, 0x42, 0x71, - 0x42, 0xe9, 0x4e, 0x57, 0x16, 0xdc, 0x97, 0x2e, 0x5c, 0xb8, 0x50, 0xd2, 0x64, 0x48, 0x23, 0xcd, - 0xdc, 0x92, 0xc4, 0xc1, 0xbe, 0x85, 0x2f, 0x25, 0xb8, 0xec, 0xd2, 0xd5, 0x20, 0xed, 0x1b, 0xcc, - 0x13, 0xc8, 0x34, 0x9d, 0x32, 0x6d, 0x77, 0xb9, 0xe7, 0x9e, 0xf3, 0xe5, 0xc2, 0x41, 0xb7, 0x2c, - 0xd6, 0x8c, 0x40, 0x32, 0x00, 0xaa, 0xb9, 0x4c, 0x04, 0x49, 0xdb, 0x95, 0x29, 0x1a, 0x6b, 0xb0, - 0xe0, 0xfb, 0x85, 0x29, 0xaa, 0xc8, 0x69, 0xfb, 0xea, 0x4c, 0x80, 0x80, 0xc5, 0x9a, 0x14, 0x2f, - 0xe7, 0x0c, 0xf7, 0x51, 0xbd, 0x47, 0x35, 0x55, 0x26, 0xfc, 0xf6, 0xd0, 0x61, 0x8f, 0x6a, 0x2b, - 0x99, 0x1c, 0xd3, 0xc4, 0xfa, 0xcf, 0xe8, 0x98, 0x81, 0x51, 0x60, 0xde, 0x28, 0xe7, 0x3a, 0x36, - 0xe6, 0xc2, 0x6b, 0x78, 0xcd, 0x83, 0x2e, 0xc9, 0xb3, 0xa0, 0xf5, 0x6e, 0x20, 0xb9, 0x0f, 0xd7, - 0xf7, 0x61, 0x63, 0x42, 0xd5, 0x68, 0x4b, 0xed, 0x1f, 0x39, 0xe1, 0xd1, 0xcd, 0xfe, 0x2b, 0x3a, - 0x8d, 0xed, 0x30, 0xd6, 0xf1, 0x87, 0x5a, 0x91, 0x77, 0x16, 0xe4, 0x4e, 0x9e, 0x05, 0xc4, 0x91, - 0x37, 0x1d, 0x25, 0x7b, 0x4b, 0xef, 0x9f, 0x94, 0xd2, 0x92, 0x1f, 0xa6, 0x08, 0x3d, 0xd9, 0x61, - 0x8f, 0x4e, 0x46, 0x40, 0xb9, 0xff, 0x80, 0xf6, 0xd6, 0xcf, 0xbf, 0xc9, 0xb3, 0xe0, 0xda, 0x7d, - 0xb2, 0xc1, 0x5e, 0x21, 0xcb, 0x84, 0xdf, 0x42, 0xbb, 0xca, 0x88, 0xe5, 0x75, 0x97, 0x79, 0x16, - 0x9c, 0xbb, 0xa0, 0x32, 0xa2, 0x0c, 0x15, 0xcf, 0x7e, 0xe1, 0xea, 0x76, 0x7f, 0x66, 0xd8, 0x9b, - 0xce, 0xb0, 0xf7, 0x37, 0xc3, 0xde, 0xd7, 0x1c, 0xd7, 0xa6, 0x73, 0x5c, 0xfb, 0x9d, 0xe3, 0xda, - 0x4b, 0x53, 0x48, 0x1b, 0xa5, 0x7c, 0x10, 0x59, 0x20, 0x45, 0x31, 0x77, 0x12, 0xc8, 0x88, 0x32, - 0x48, 0x24, 0xe3, 0xe4, 0xb3, 0xd2, 0xde, 0xa0, 0xbe, 0x28, 0xa5, 0xf3, 0x1f, 0x00, 0x00, 0xff, - 0xff, 0x48, 0x0e, 0x81, 0xbf, 0xe5, 0x01, 0x00, 0x00, + // 346 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4a, 0xc3, 0x40, + 0x14, 0x85, 0x1b, 0x85, 0xaa, 0x23, 0xfe, 0x0d, 0x0a, 0x2a, 0x98, 0xd4, 0xb8, 0x29, 0x14, 0x33, + 0x94, 0x2e, 0x04, 0x5d, 0x19, 0xe8, 0xbe, 0x64, 0xe1, 0xc2, 0x85, 0x65, 0x92, 0x8c, 0x69, 0x24, + 0xc9, 0x2d, 0x33, 0x63, 0xb0, 0x6f, 0xe1, 0x4b, 0x09, 0x2e, 0xbb, 0x74, 0x15, 0xa4, 0x7d, 0x83, + 0x3c, 0x81, 0x24, 0xd3, 0xf4, 0xd7, 0xdd, 0xcc, 0xb9, 0xe7, 0x7c, 0x67, 0x60, 0x2e, 0xba, 0xf1, + 0x18, 0xf7, 0x08, 0x24, 0x2e, 0x50, 0xee, 0x87, 0x49, 0x40, 0xd2, 0xf6, 0xd2, 0xcd, 0x1a, 0x72, + 0x90, 0x80, 0x71, 0x61, 0xb2, 0x96, 0xe4, 0xb4, 0x7d, 0x79, 0x1a, 0x40, 0x00, 0xe5, 0x98, 0x14, + 0x27, 0xe5, 0x34, 0x87, 0xa8, 0xde, 0xa3, 0x9c, 0xc6, 0x02, 0xbf, 0x22, 0xbc, 0x08, 0xf4, 0x59, + 0x42, 0xdd, 0x88, 0xf9, 0xe7, 0x5a, 0x43, 0x6b, 0xee, 0xda, 0x77, 0x79, 0x66, 0x74, 0xde, 0x04, + 0x24, 0xf7, 0xe6, 0xa6, 0xc7, 0x6c, 0x8c, 0x68, 0x1c, 0xfd, 0x3b, 0x71, 0x4e, 0x16, 0x62, 0x77, + 0xa6, 0x7d, 0x69, 0x68, 0xbf, 0x47, 0xb9, 0x0c, 0xbd, 0x70, 0x48, 0x13, 0x89, 0x9f, 0xd0, 0xa1, + 0x07, 0x22, 0x06, 0xd1, 0xa7, 0xbe, 0xcf, 0x99, 0x10, 0x65, 0xe7, 0x9e, 0x4d, 0xf2, 0xcc, 0x68, + 0xa9, 0xce, 0xd5, 0x79, 0xd5, 0xb7, 0xa6, 0x3a, 0x07, 0x4a, 0x78, 0x54, 0x77, 0xfc, 0x82, 0x8e, + 0x99, 0x1c, 0x30, 0xce, 0xde, 0xe3, 0x39, 0x79, 0xab, 0x24, 0x77, 0xf2, 0xcc, 0x20, 0x8a, 0xbc, + 0xee, 0xa8, 0xd8, 0x1b, 0xba, 0x73, 0x54, 0x49, 0x33, 0xbe, 0x99, 0x22, 0xd4, 0x95, 0x83, 0x1e, + 0x1d, 0x45, 0x40, 0x7d, 0xfc, 0x80, 0x76, 0x56, 0x9f, 0x7f, 0x9d, 0x67, 0xc6, 0x95, 0x2a, 0x59, + 0x63, 0xcf, 0x91, 0x55, 0x02, 0xb7, 0xd0, 0x76, 0x2c, 0x82, 0xd9, 0xeb, 0x2e, 0xf2, 0xcc, 0x38, + 0x53, 0xc1, 0x58, 0x04, 0x55, 0xa8, 0x38, 0x3a, 0x85, 0xcb, 0xb6, 0xbf, 0x27, 0xba, 0x36, 0x9e, + 0xe8, 0xda, 0xef, 0x44, 0xd7, 0x3e, 0xa7, 0x7a, 0x6d, 0x3c, 0xd5, 0x6b, 0x3f, 0x53, 0xbd, 0xf6, + 0xdc, 0x0c, 0x42, 0x69, 0xa5, 0xbe, 0x6b, 0x49, 0x20, 0xc5, 0x02, 0xdc, 0x86, 0x40, 0x22, 0xea, + 0x41, 0x12, 0x7a, 0x3e, 0xf9, 0x58, 0xda, 0x12, 0xb7, 0x5e, 0x7e, 0x7e, 0xe7, 0x2f, 0x00, 0x00, + 0xff, 0xff, 0x45, 0x07, 0xf1, 0x0c, 0x4d, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -220,6 +230,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.OnboardingEnabled { + i-- + if m.OnboardingEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -314,6 +334,9 @@ func (m *Params) Size() (n int) { } var l int _ = l + if m.OnboardingEnabled { + n += 2 + } return n } @@ -386,6 +409,26 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OnboardingEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnboarding + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OnboardingEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipOnboarding(dAtA[iNdEx:]) diff --git a/x/onboarding/query.pb.go b/x/onboarding/query.pb.go index d121fbeb..8b3db1cc 100644 --- a/x/onboarding/query.pb.go +++ b/x/onboarding/query.pb.go @@ -138,32 +138,31 @@ func init() { func init() { proto.RegisterFile("cerc/onboarding/v1/query.proto", fileDescriptor_80831d904221d27d) } var fileDescriptor_80831d904221d27d = []byte{ - // 386 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x6f, 0x1a, 0x31, - 0x18, 0xc6, 0x31, 0x55, 0x3b, 0x18, 0x26, 0xab, 0x03, 0x45, 0xd5, 0x41, 0x0f, 0xa9, 0xd0, 0x3f, - 0xd8, 0x3a, 0xba, 0x75, 0x64, 0x68, 0x57, 0xca, 0xd8, 0xcd, 0x77, 0x58, 0x96, 0x23, 0xf0, 0x7b, - 0x9c, 0xcd, 0x29, 0xac, 0xf9, 0x04, 0x91, 0x22, 0x65, 0xce, 0xc7, 0xc9, 0x88, 0x14, 0x29, 0xca, - 0x14, 0x45, 0x90, 0x4f, 0x90, 0x4f, 0x10, 0xdd, 0x19, 0x09, 0x93, 0x10, 0x25, 0x9b, 0xe5, 0xf7, - 0xcf, 0xf3, 0xfc, 0x5e, 0x3d, 0x38, 0x48, 0x44, 0x96, 0x30, 0xd0, 0x31, 0xf0, 0x6c, 0xa2, 0xb4, - 0x64, 0x79, 0xc4, 0xe6, 0x0b, 0x91, 0x2d, 0x69, 0x9a, 0x81, 0x05, 0x42, 0x8a, 0x3a, 0xdd, 0xd5, - 0x69, 0x1e, 0x35, 0x3f, 0x4a, 0x90, 0x50, 0x96, 0x59, 0xf1, 0x72, 0x9d, 0xcd, 0xef, 0x09, 0x98, - 0x19, 0x18, 0x16, 0x73, 0x23, 0xdc, 0x0a, 0x96, 0x47, 0xb1, 0xb0, 0x3c, 0x62, 0x29, 0x97, 0x4a, - 0x73, 0xab, 0x40, 0x6f, 0x7b, 0x3b, 0x07, 0x54, 0x3d, 0x0d, 0xd7, 0xf4, 0x59, 0x02, 0xc8, 0xa9, - 0x60, 0x3c, 0x55, 0x8c, 0x6b, 0x0d, 0xb6, 0xdc, 0x60, 0x5c, 0x35, 0x8c, 0x71, 0xe3, 0x5f, 0x21, - 0x32, 0xe2, 0x99, 0x55, 0x89, 0x4a, 0xb9, 0xb6, 0x66, 0x2c, 0xe6, 0x0b, 0x61, 0x2c, 0xf9, 0x83, - 0xf1, 0x4e, 0xb2, 0x81, 0xda, 0xa8, 0x57, 0x1b, 0x7c, 0xa5, 0xce, 0x1f, 0x2d, 0xfc, 0x51, 0x87, - 0xb8, 0xf5, 0x47, 0x47, 0x5c, 0x8a, 0xed, 0xec, 0xd8, 0x9b, 0x0c, 0xaf, 0x11, 0xfe, 0x74, 0x40, - 0xc4, 0xa4, 0xa0, 0x8d, 0x20, 0x29, 0xae, 0xa7, 0xde, 0x7f, 0x03, 0xb5, 0xdf, 0xf5, 0x6a, 0x83, - 0x16, 0x7d, 0x7e, 0x31, 0xea, 0xcd, 0x0f, 0x7f, 0x3c, 0xdc, 0xb6, 0xba, 0x47, 0x06, 0xf4, 0xef, - 0xd0, 0x1f, 0x0f, 0xdb, 0x4b, 0x3e, 0x9b, 0x3e, 0xf9, 0x1b, 0xef, 0x29, 0x90, 0xbf, 0x7b, 0x5c, - 0xd5, 0x92, 0xab, 0xfb, 0x2a, 0x97, 0xb3, 0xeb, 0x83, 0x0d, 0x2e, 0x10, 0x7e, 0x5f, 0x82, 0x91, - 0x73, 0x84, 0xeb, 0x3e, 0x1d, 0xf9, 0x79, 0xc8, 0xff, 0x4b, 0x97, 0x6e, 0xf6, 0xdf, 0xd8, 0xed, - 0x3c, 0x84, 0xdf, 0x4e, 0xae, 0xee, 0xcf, 0xaa, 0x1d, 0xf2, 0x85, 0x95, 0x01, 0xf0, 0xe0, 0x8a, - 0x04, 0xf8, 0xac, 0xc3, 0xe1, 0xe5, 0x3a, 0x40, 0xab, 0x75, 0x80, 0xee, 0xd6, 0x01, 0x3a, 0xdd, - 0x04, 0x95, 0xd5, 0x26, 0xa8, 0xdc, 0x6c, 0x82, 0xca, 0xff, 0x9e, 0x54, 0x96, 0xe6, 0x93, 0x98, - 0x5a, 0x28, 0xd7, 0xf4, 0x15, 0xb0, 0x29, 0x4f, 0x40, 0xab, 0x64, 0xc2, 0x8e, 0xbd, 0x1c, 0xc5, - 0x1f, 0xca, 0xa8, 0xfc, 0x7a, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x83, 0x20, 0x78, 0x04, 0xe5, 0x02, - 0x00, 0x00, + // 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, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/onboarding/query.pb.gw.go b/x/onboarding/query.pb.gw.go index c8cb28f1..ad5a0ba6 100644 --- a/x/onboarding/query.pb.gw.go +++ b/x/onboarding/query.pb.gw.go @@ -163,7 +163,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Participants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "participant", "v1", "participants"}, "", runtime.AssumeColonVerbOpt(false))) + 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))) ) var ( diff --git a/x/onboarding/tx.pb.go b/x/onboarding/tx.pb.go index c1743b11..33114973 100644 --- a/x/onboarding/tx.pb.go +++ b/x/onboarding/tx.pb.go @@ -36,7 +36,6 @@ 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"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` } func (m *MsgOnboardParticipant) Reset() { *m = MsgOnboardParticipant{} } @@ -93,13 +92,6 @@ func (m *MsgOnboardParticipant) GetEthSignature() string { return "" } -func (m *MsgOnboardParticipant) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - // MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. type MsgOnboardParticipantResponse struct { } @@ -145,31 +137,31 @@ func init() { func init() { proto.RegisterFile("cerc/onboarding/v1/tx.proto", fileDescriptor_6bfde34a550e231e) } var fileDescriptor_6bfde34a550e231e = []byte{ - // 384 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xc1, 0x8a, 0x1a, 0x41, - 0x14, 0x9c, 0x56, 0x93, 0x90, 0x36, 0x81, 0xd0, 0x24, 0x64, 0x98, 0x24, 0xa3, 0x8c, 0x87, 0xa8, - 0x90, 0x69, 0x34, 0xb7, 0x1c, 0x05, 0x8f, 0x12, 0x31, 0xb7, 0x5c, 0xa4, 0x9d, 0x69, 0xda, 0x06, - 0xa7, 0xdf, 0x30, 0xdd, 0x11, 0x73, 0x0b, 0x7e, 0x41, 0x60, 0x3f, 0x61, 0x7f, 0x40, 0xf6, 0x2b, - 0x3c, 0xba, 0xec, 0x65, 0x4f, 0xcb, 0xa2, 0x0b, 0xfe, 0xc6, 0xe2, 0xa8, 0xeb, 0xc0, 0xce, 0xc2, - 0xde, 0xde, 0xab, 0x2a, 0xaa, 0x5e, 0xf1, 0xf0, 0xa7, 0x80, 0x27, 0x01, 0x05, 0x35, 0x02, 0x96, - 0x84, 0x52, 0x09, 0x3a, 0x6d, 0x51, 0x33, 0xf3, 0xe3, 0x04, 0x0c, 0x10, 0xb2, 0x23, 0xfd, 0x13, - 0xe9, 0x4f, 0x5b, 0xce, 0xc7, 0x00, 0x74, 0x04, 0x9a, 0x46, 0x3a, 0xd5, 0x46, 0x5a, 0xec, 0xc5, - 0xce, 0x67, 0x01, 0x20, 0x26, 0x9c, 0xb2, 0x58, 0x52, 0xa6, 0x14, 0x18, 0x66, 0x24, 0x28, 0x7d, - 0x60, 0xdf, 0x0b, 0x10, 0x90, 0x8e, 0x74, 0x37, 0x1d, 0xd0, 0x5a, 0x4e, 0x7a, 0x26, 0x2e, 0x15, - 0x79, 0x97, 0x08, 0x7f, 0xe8, 0x69, 0xf1, 0x73, 0x8f, 0xf7, 0x59, 0x62, 0x64, 0x20, 0x63, 0xa6, - 0x0c, 0xa9, 0xe2, 0x72, 0x7c, 0x5a, 0x6d, 0x54, 0x45, 0xf5, 0xd7, 0x83, 0x2c, 0x44, 0xba, 0xb8, - 0xcc, 0xcd, 0x78, 0x18, 0xb3, 0xbf, 0x13, 0x60, 0xa1, 0x5d, 0xa8, 0xa2, 0x7a, 0xb9, 0xed, 0xfa, - 0x8f, 0x7b, 0xf9, 0x5d, 0x33, 0xee, 0xef, 0x55, 0x9d, 0xd2, 0xf2, 0xa6, 0x62, 0x0d, 0x30, 0x7f, - 0x40, 0x48, 0x0d, 0xbf, 0xdd, 0xd9, 0x68, 0x29, 0x14, 0x33, 0x7f, 0x12, 0x6e, 0x17, 0xd3, 0xa8, - 0x37, 0xdc, 0x8c, 0x7f, 0x1d, 0x31, 0x62, 0xe3, 0x57, 0x11, 0xd7, 0x9a, 0x09, 0x6e, 0x97, 0x52, - 0xfa, 0xb8, 0xfe, 0x78, 0x37, 0xdf, 0x2e, 0x9a, 0xd9, 0xbb, 0xbc, 0x0a, 0xfe, 0x92, 0x5b, 0x69, - 0xc0, 0x75, 0x0c, 0x4a, 0xf3, 0xf6, 0x05, 0xc2, 0xc5, 0x9e, 0x16, 0xe4, 0x1c, 0x61, 0x92, 0xd3, - 0xbc, 0x91, 0x57, 0x21, 0xd7, 0xd1, 0x69, 0x3d, 0x5b, 0x7a, 0x0c, 0xf7, 0xe8, 0xfc, 0xea, 0xee, - 0xac, 0xd0, 0xf0, 0xbe, 0xd2, 0xa7, 0xff, 0x33, 0xcc, 0xd4, 0x71, 0x5e, 0xfc, 0xdb, 0x2e, 0x9a, - 0xa8, 0xd3, 0x59, 0xae, 0x5d, 0xb4, 0x5a, 0xbb, 0xe8, 0x76, 0xed, 0xa2, 0xff, 0x1b, 0xd7, 0x5a, - 0x6d, 0x5c, 0xeb, 0x7a, 0xe3, 0x5a, 0xbf, 0xeb, 0x42, 0x1a, 0x7f, 0x1a, 0x8e, 0x7c, 0x03, 0xa9, - 0xe7, 0x37, 0x09, 0x74, 0xc2, 0x02, 0x50, 0x32, 0x08, 0xe9, 0x2c, 0x93, 0x30, 0x7a, 0x99, 0x3e, - 0xfd, 0xfb, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe2, 0xe0, 0x84, 0x99, 0x02, 0x00, 0x00, + // 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, } // Reference imports to suppress errors if they are not otherwise used. @@ -274,13 +266,6 @@ func (m *MsgOnboardParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x22 - } if len(m.EthSignature) > 0 { i -= len(m.EthSignature) copy(dAtA[i:], m.EthSignature) @@ -358,10 +343,6 @@ func (m *MsgOnboardParticipant) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -506,38 +487,6 @@ 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 Message", 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.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) -- 2.45.2 From f23f69164653c31c7f0f8766e4e2786696ef89c6 Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:46:31 +0530 Subject: [PATCH 5/8] Add lint config and fix lint errors (#7) * Add config file for linter * Fix lint errors * Fix gofumpt errors * Fix pre-allocate slices lint error * Remove unused lint rule * Disable style check ID error * Add gomodguard section in yml file * Remove trailing white spaces * Remove unnecessary comments --------- Co-authored-by: Prathamesh Musale --- .golangci.yml | 69 +++++++++++++++++++++++++++++ app/export.go | 2 +- go.mod | 2 +- gql/server.go | 8 +++- gql/status.go | 3 +- tests/integration/common.go | 9 +++- testutil/network/util.go | 6 ++- x/auction/keeper/keeper.go | 42 +++++++++++++----- x/auction/keeper/query_server.go | 21 +++++++-- x/auction/module/depinject.go | 8 ++-- x/bond/keeper/keeper.go | 6 ++- x/bond/keeper/query_server.go | 18 ++++++-- x/bond/module/depinject.go | 8 ++-- x/bond/msgs.go | 4 +- x/bond/params.go | 2 +- x/onboarding/keeper/keeper.go | 18 +++++--- x/onboarding/keeper/query_server.go | 5 ++- x/onboarding/msgs.go | 4 +- x/registry/keeper/invariants.go | 1 - x/registry/keeper/keeper.go | 6 ++- x/registry/keeper/msg_server.go | 5 ++- x/registry/keeper/query_server.go | 5 ++- 22 files changed, 199 insertions(+), 53 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..7ef449b6 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,69 @@ +run: + tests: false + # timeout for analysis, e.g. 30s, 5m, default is 1m + # timeout: 5m + +linters: + enable: + - bodyclose + - dogsled + - errcheck + - goconst + - gocritic + # - revive # overly sensitive var-naming detection + - gosec + - gosimple + - govet + - ineffassign + - lll + - misspell + - nakedret + - prealloc + - exportloopref + - staticcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - asciicheck + - exportloopref + - gofumpt + - gomodguard + - whitespace + +issues: + exclude-rules: + - path: _test\.go + linters: + - gosec + - linters: + - lll + source: "https://" + - linters: + - stylecheck + text: "ST1003:" + max-same-issues: 50 + +linters-settings: + lll: + line-length: 150 + dogsled: + max-blank-identifiers: 3 + golint: + min-confidence: 0 + maligned: + suggest-new: true + misspell: + locale: US + gofumpt: + lang-version: "1.21" + gomodguard: + blocked: + versions: # List of blocked module version constraints + - https://github.com/etcd-io/etcd: # Blocked module with version constraint + version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) + - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint + version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) diff --git a/app/export.go b/app/export.go index cd119a3e..ad1b8129 100644 --- a/app/export.go +++ b/app/export.go @@ -51,7 +51,7 @@ func (app *LaconicApp) ExportAppStateAndValidators( } // prepare for fresh start at zero height -// NOTE zero height genesis is a temporary feature, which will be deprecated in favour of export at a block height +// NOTE zero height genesis is a temporary feature, which will be deprecated in favor of export at a block height func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false diff --git a/go.mod b/go.mod index 60d0f215..c4befb72 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,6 @@ require ( github.com/statechannels/go-nitro v0.1.2 github.com/stretchr/testify v1.8.4 github.com/vektah/gqlparser/v2 v2.5.11 - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/sync v0.7.0 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 @@ -181,6 +180,7 @@ require ( go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/term v0.19.0 // indirect diff --git a/gql/server.go b/gql/server.go index faf383b8..fbf95a48 100644 --- a/gql/server.go +++ b/gql/server.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net/http" + "time" "cosmossdk.io/log" "github.com/99designs/gqlgen/graphql/handler" @@ -54,7 +55,12 @@ func Server(ctx context.Context, clientCtx client.Context, logger log.Logger) er go func() { logger.Info(fmt.Sprintf("Connect to GraphQL playground url: http://localhost:%s", port)) - errCh <- http.ListenAndServe(":"+port, router) + server := &http.Server{ + Addr: ":" + port, + Handler: router, + ReadHeaderTimeout: 3 * time.Second, + } + errCh <- server.ListenAndServe() }() select { diff --git a/gql/status.go b/gql/status.go index 4608f058..955dc949 100644 --- a/gql/status.go +++ b/gql/status.go @@ -39,7 +39,8 @@ func getStatusInfo(client client.Context) (*NodeInfo, *SyncInfo, *ValidatorInfo, }, nil } -func getNetInfo(client client.Context) (string, []*PeerInfo, error) { +// nolint: all +func getNetInfo(_ client.Context) (string, []*PeerInfo, error) { // TODO: Implement // nodeClient, err := client.GetNode() diff --git a/tests/integration/common.go b/tests/integration/common.go index 0d79c9b4..72cf6960 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -103,7 +103,14 @@ func (tf *TestFixture) Setup() error { bondKeeper := bondkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[bondTypes.StoreKey]), accountKeeper, bankKeeper) - registryKeeper := registrykeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[registryTypes.StoreKey]), accountKeeper, bankKeeper, bondKeeper, auctionKeeper) + registryKeeper := registrykeeper.NewKeeper( + cdc, + runtime.NewKVStoreService(keys[registryTypes.StoreKey]), + accountKeeper, + bankKeeper, + bondKeeper, + auctionKeeper, + ) authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil) diff --git a/testutil/network/util.go b/testutil/network/util.go index 072184ce..7ddb8063 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -146,7 +146,11 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec()) + cmtCfg, initCfg, appGenesis, + banktypes.GenesisBalancesIterator{}, + genutiltypes.DefaultMessageValidator, + cfg.TxConfig.SigningContext().ValidatorAddressCodec(), + ) if err != nil { return err } diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index cd60928f..872c80bf 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -77,8 +77,12 @@ type Keeper struct { // state management Schema collections.Schema Params collections.Item[auctiontypes.Params] - Auctions *collections.IndexedMap[string, auctiontypes.Auction, AuctionsIndexes] // map: auctionId -> Auction, index: owner -> Auctions - Bids *collections.IndexedMap[collections.Pair[string, string], auctiontypes.Bid, BidsIndexes] // map: (auctionId, bidder) -> Bid, index: bidder -> auctionId + Auctions *collections.IndexedMap[ + string, auctiontypes.Auction, AuctionsIndexes, + ] // map: auctionId -> Auction, index: owner -> Auctions + Bids *collections.IndexedMap[ + collections.Pair[string, string], auctiontypes.Bid, BidsIndexes, + ] // map: (auctionId, bidder) -> Bid, index: bidder -> auctionId } // NewKeeper creates a new Keeper instance @@ -94,9 +98,16 @@ func NewKeeper( accountKeeper: accountKeeper, bankKeeper: bankKeeper, Params: collections.NewItem(sb, auctiontypes.ParamsPrefix, "params", codec.CollValue[auctiontypes.Params](cdc)), - Auctions: collections.NewIndexedMap(sb, auctiontypes.AuctionsPrefix, "auctions", collections.StringKey, codec.CollValue[auctiontypes.Auction](cdc), newAuctionIndexes(sb)), - Bids: collections.NewIndexedMap(sb, auctiontypes.BidsPrefix, "bids", collections.PairKeyCodec(collections.StringKey, collections.StringKey), codec.CollValue[auctiontypes.Bid](cdc), newBidsIndexes(sb)), - usageKeepers: nil, + Auctions: collections.NewIndexedMap( + sb, auctiontypes.AuctionsPrefix, "auctions", collections.StringKey, codec.CollValue[auctiontypes.Auction](cdc), newAuctionIndexes(sb), + ), + Bids: collections.NewIndexedMap( + sb, auctiontypes.BidsPrefix, "bids", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + codec.CollValue[auctiontypes.Bid](cdc), + newBidsIndexes(sb), + ), + usageKeepers: nil, } schema, err := sb.Build() @@ -191,10 +202,16 @@ func (k Keeper) GetBid(ctx sdk.Context, id string, bidder string) (auctiontypes. func (k Keeper) GetBids(ctx sdk.Context, id string) ([]*auctiontypes.Bid, error) { var bids []*auctiontypes.Bid - err := k.Bids.Walk(ctx, collections.NewPrefixedPairRange[string, string](id), func(key collections.Pair[string, string], value auctiontypes.Bid) (stop bool, err error) { - bids = append(bids, &value) - return false, nil - }) + err := k.Bids.Walk(ctx, + collections.NewPrefixedPairRange[string, string](id), + func( + key collections.Pair[string, string], + value auctiontypes.Bid) (stop bool, err error, + ) { + bids = append(bids, &value) + return false, nil + }, + ) if err != nil { return nil, err } @@ -716,7 +733,12 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } // Use auction burn module account instead of actually burning coins to better keep track of supply. - sdkErr = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, auctiontypes.AuctionBurnModuleAccountName, sdk.NewCoins(amountToBurn)) + sdkErr = k.bankKeeper.SendCoinsFromModuleToModule( + ctx, + auctiontypes.ModuleName, + auctiontypes.AuctionBurnModuleAccountName, + sdk.NewCoins(amountToBurn), + ) if sdkErr != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error burning coins: %v", sdkErr)) panic(sdkErr) diff --git a/x/auction/keeper/query_server.go b/x/auction/keeper/query_server.go index 08c4e135..6f36ce14 100644 --- a/x/auction/keeper/query_server.go +++ b/x/auction/keeper/query_server.go @@ -98,7 +98,10 @@ func (qs queryServer) GetBids(c context.Context, req *auctiontypes.QueryGetBidsR } // AuctionsByBidder queries auctions by bidder -func (qs queryServer) AuctionsByBidder(c context.Context, req *auctiontypes.QueryAuctionsByBidderRequest) (*auctiontypes.QueryAuctionsByBidderResponse, error) { +func (qs queryServer) AuctionsByBidder( + c context.Context, + req *auctiontypes.QueryAuctionsByBidderRequest, +) (*auctiontypes.QueryAuctionsByBidderResponse, error) { ctx := sdk.UnwrapSDKContext(c) if req.BidderAddress == "" { @@ -110,11 +113,18 @@ func (qs queryServer) AuctionsByBidder(c context.Context, req *auctiontypes.Quer return nil, err } - return &auctiontypes.QueryAuctionsByBidderResponse{Auctions: &auctiontypes.Auctions{Auctions: auctions}}, nil + return &auctiontypes.QueryAuctionsByBidderResponse{ + Auctions: &auctiontypes.Auctions{ + Auctions: auctions, + }, + }, nil } // AuctionsByOwner queries auctions by owner -func (qs queryServer) AuctionsByOwner(c context.Context, req *auctiontypes.QueryAuctionsByOwnerRequest) (*auctiontypes.QueryAuctionsByOwnerResponse, error) { +func (qs queryServer) AuctionsByOwner( + c context.Context, + req *auctiontypes.QueryAuctionsByOwnerRequest, +) (*auctiontypes.QueryAuctionsByOwnerResponse, error) { ctx := sdk.UnwrapSDKContext(c) if req.OwnerAddress == "" { @@ -130,7 +140,10 @@ func (qs queryServer) AuctionsByOwner(c context.Context, req *auctiontypes.Query } // GetAuctionModuleBalance queries the auction module account balance -func (qs queryServer) GetAuctionModuleBalance(c context.Context, req *auctiontypes.QueryGetAuctionModuleBalanceRequest) (*auctiontypes.QueryGetAuctionModuleBalanceResponse, error) { +func (qs queryServer) GetAuctionModuleBalance( + c context.Context, + req *auctiontypes.QueryGetAuctionModuleBalanceRequest, +) (*auctiontypes.QueryGetAuctionModuleBalanceResponse, error) { ctx := sdk.UnwrapSDKContext(c) balances := qs.k.GetAuctionModuleBalances(ctx) diff --git a/x/auction/module/depinject.go b/x/auction/module/depinject.go index 5fc2e637..581ebc6d 100644 --- a/x/auction/module/depinject.go +++ b/x/auction/module/depinject.go @@ -4,7 +4,6 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" - "golang.org/x/exp/maps" "github.com/cosmos/cosmos-sdk/codec" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -64,15 +63,14 @@ func InvokeSetAuctionHooks( keeper *keeper.Keeper, auctionHooks map[string]auction.AuctionHooksWrapper, ) error { - // all arguments to invokers are optional + // All arguments to invokers are optional if keeper == nil || config == nil { return nil } - var usageKeepers []auction.AuctionUsageKeeper + usageKeepers := make([]auction.AuctionUsageKeeper, 0, len(auctionHooks)) - for _, modName := range maps.Keys(auctionHooks) { - hook := auctionHooks[modName] + for _, hook := range auctionHooks { usageKeepers = append(usageKeepers, hook) } diff --git a/x/bond/keeper/keeper.go b/x/bond/keeper/keeper.go index 50cf345c..842c6ca9 100644 --- a/x/bond/keeper/keeper.go +++ b/x/bond/keeper/keeper.go @@ -71,8 +71,10 @@ func NewKeeper( accountKeeper: accountKeeper, bankKeeper: bankKeeper, Params: collections.NewItem(sb, bondtypes.ParamsPrefix, "params", codec.CollValue[bondtypes.Params](cdc)), - Bonds: collections.NewIndexedMap(sb, bondtypes.BondsPrefix, "bonds", collections.StringKey, codec.CollValue[bondtypes.Bond](cdc), newBondIndexes(sb)), - usageKeepers: nil, + Bonds: collections.NewIndexedMap( + sb, bondtypes.BondsPrefix, "bonds", collections.StringKey, codec.CollValue[bondtypes.Bond](cdc), newBondIndexes(sb), + ), + usageKeepers: nil, } schema, err := sb.Build() diff --git a/x/bond/keeper/query_server.go b/x/bond/keeper/query_server.go index 0ebfa60e..eec448e1 100644 --- a/x/bond/keeper/query_server.go +++ b/x/bond/keeper/query_server.go @@ -63,12 +63,17 @@ func (qs queryServer) GetBondById(c context.Context, req *bondtypes.QueryGetBond } // GetBondsByOwner implements bond.QueryServer. -func (qs queryServer) GetBondsByOwner(c context.Context, req *bondtypes.QueryGetBondsByOwnerRequest) (*bondtypes.QueryGetBondsByOwnerResponse, error) { +func (qs queryServer) GetBondsByOwner( + c context.Context, + req *bondtypes.QueryGetBondsByOwnerRequest, +) (*bondtypes.QueryGetBondsByOwnerResponse, error) { ctx := sdk.UnwrapSDKContext(c) owner := req.GetOwner() if len(owner) == 0 { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "owner required") + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, + "owner required", + ) } bonds, err := qs.k.GetBondsByOwner(ctx, owner) @@ -80,9 +85,14 @@ func (qs queryServer) GetBondsByOwner(c context.Context, req *bondtypes.QueryGet } // GetBondModuleBalance implements bond.QueryServer. -func (qs queryServer) GetBondModuleBalance(c context.Context, _ *bondtypes.QueryGetBondModuleBalanceRequest) (*bondtypes.QueryGetBondModuleBalanceResponse, error) { +func (qs queryServer) GetBondModuleBalance( + c context.Context, + _ *bondtypes.QueryGetBondModuleBalanceRequest, +) (*bondtypes.QueryGetBondModuleBalanceResponse, error) { ctx := sdk.UnwrapSDKContext(c) balances := qs.k.GetBondModuleBalances(ctx) - return &bondtypes.QueryGetBondModuleBalanceResponse{Balance: balances}, nil + return &bondtypes.QueryGetBondModuleBalanceResponse{ + Balance: balances, + }, nil } diff --git a/x/bond/module/depinject.go b/x/bond/module/depinject.go index 3d6698f5..165d75a1 100644 --- a/x/bond/module/depinject.go +++ b/x/bond/module/depinject.go @@ -4,7 +4,6 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" - "golang.org/x/exp/maps" "github.com/cosmos/cosmos-sdk/codec" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -60,15 +59,14 @@ func InvokeSetBondHooks( keeper *keeper.Keeper, bondHooks map[string]bond.BondHooksWrapper, ) error { - // all arguments to invokers are optional + // All arguments to invokers are optional if keeper == nil || config == nil { return nil } - var usageKeepers []bond.BondUsageKeeper + usageKeepers := make([]bond.BondUsageKeeper, 0, len(bondHooks)) - for _, modName := range maps.Keys(bondHooks) { - hook := bondHooks[modName] + for _, hook := range bondHooks { usageKeepers = append(usageKeepers, hook) } diff --git a/x/bond/msgs.go b/x/bond/msgs.go index 135127f6..f33c9209 100644 --- a/x/bond/msgs.go +++ b/x/bond/msgs.go @@ -6,9 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var ( - _ sdk.Msg = &MsgCreateBond{} -) +var _ sdk.Msg = &MsgCreateBond{} // NewMsgCreateBond is the constructor function for MsgCreateBond. func NewMsgCreateBond(coins sdk.Coins, signer sdk.AccAddress) MsgCreateBond { diff --git a/x/bond/params.go b/x/bond/params.go index f6f3c710..e836ae2c 100644 --- a/x/bond/params.go +++ b/x/bond/params.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// Default parameter values. +// DefaultMaxBondAmountTokens are the default parameter values. var DefaultMaxBondAmountTokens = sdkmath.NewInt(100000000000) func NewParams(maxBondAmount sdk.Coin) Params { diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index cf0dc7e4..f710aff7 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -44,7 +44,9 @@ func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService s addressCodec: addressCodec, authority: authority, Params: collections.NewItem(sb, onboardingTypes.ParamsPrefix, "params", codec.CollValue[onboardingTypes.Params](cdc)), - Participants: collections.NewMap(sb, onboardingTypes.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboardingTypes.Participant](cdc)), + Participants: collections.NewMap( + sb, onboardingTypes.ParticipantsPrefix, "participants", collections.StringKey, codec.CollValue[onboardingTypes.Participant](cdc), + ), } schema, err := sb.Build() @@ -66,7 +68,11 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", onboardingTypes.ModuleName) } -func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnboardParticipant, signerAddress sdk.AccAddress) (*onboardingTypes.MsgOnboardParticipantResponse, error) { +func (k Keeper) OnboardParticipant( + ctx sdk.Context, + msg *onboardingTypes.MsgOnboardParticipant, + signerAddress sdk.AccAddress, +) (*onboardingTypes.MsgOnboardParticipantResponse, error) { params, err := k.Params.Get(ctx) if err != nil { return nil, err @@ -82,6 +88,10 @@ func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnbo } ethereumAddress, err := utils.DecodeEthereumAddress(message, msg.EthSignature) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Failed to decode Ethereum address") + } + if ethereumAddress != msg.EthPayload.Address { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Recovered ethereum address does not match the address set in payload") } @@ -100,9 +110,7 @@ func (k Keeper) OnboardParticipant(ctx sdk.Context, msg *onboardingTypes.MsgOnbo func (k Keeper) StoreParticipant(ctx sdk.Context, participant *onboardingTypes.Participant) error { key := participant.CosmosAddress - k.Participants.Set(ctx, key, *participant) - - return nil + return k.Participants.Set(ctx, key, *participant) } // ListParticipants - get all participants. diff --git a/x/onboarding/keeper/query_server.go b/x/onboarding/keeper/query_server.go index dbfd416b..3882e1f5 100644 --- a/x/onboarding/keeper/query_server.go +++ b/x/onboarding/keeper/query_server.go @@ -20,7 +20,10 @@ func NewQueryServerImpl(k *Keeper) onboardingtypes.QueryServer { } // Participants implements Participants.QueryServer. -func (qs queryServer) Participants(c context.Context, _ *onboardingtypes.QueryParticipantsRequest) (*onboardingtypes.QueryParticipantsResponse, error) { +func (qs queryServer) Participants( + c context.Context, + _ *onboardingtypes.QueryParticipantsRequest, +) (*onboardingtypes.QueryParticipantsResponse, error) { ctx := sdk.UnwrapSDKContext(c) resp, err := qs.k.ListParticipants(ctx) diff --git a/x/onboarding/msgs.go b/x/onboarding/msgs.go index 1054968a..b6996b6f 100644 --- a/x/onboarding/msgs.go +++ b/x/onboarding/msgs.go @@ -6,9 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var ( - _ sdk.Msg = &MsgOnboardParticipant{} -) +var _ sdk.Msg = &MsgOnboardParticipant{} func (msg MsgOnboardParticipant) ValidateBasic() error { if len(msg.Participant) == 0 { diff --git a/x/registry/keeper/invariants.go b/x/registry/keeper/invariants.go index ad1b22d7..09cceada 100644 --- a/x/registry/keeper/invariants.go +++ b/x/registry/keeper/invariants.go @@ -61,7 +61,6 @@ func RecordBondInvariant(k *Keeper) sdk.Invariant { return false, nil }) - if err != nil { return sdk.FormatInvariant( types.ModuleName, diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index c47cb431..ea36de14 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -243,7 +243,11 @@ func (k Keeper) GetRecordsByBondId(ctx sdk.Context, bondId string) ([]registryty } // RecordsFromAttributes gets a list of records whose attributes match all provided values -func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*registrytypes.QueryRecordsRequest_KeyValueInput, all bool) ([]registrytypes.Record, error) { +func (k Keeper) RecordsFromAttributes( + ctx sdk.Context, + attributes []*registrytypes.QueryRecordsRequest_KeyValueInput, + all bool, +) ([]registrytypes.Record, error) { resultRecordIds := []string{} for i, attr := range attributes { suffix, err := QueryValueToJSON(attr.Value) diff --git a/x/registry/keeper/msg_server.go b/x/registry/keeper/msg_server.go index ce5d800f..f6219e0a 100644 --- a/x/registry/keeper/msg_server.go +++ b/x/registry/keeper/msg_server.go @@ -320,7 +320,10 @@ func (ms msgServer) DissociateBond(c context.Context, msg *registrytypes.MsgDiss return ®istrytypes.MsgDissociateBondResponse{}, nil } -func (ms msgServer) DissociateRecords(c context.Context, msg *registrytypes.MsgDissociateRecords) (*registrytypes.MsgDissociateRecordsResponse, error) { +func (ms msgServer) DissociateRecords( + c context.Context, + msg *registrytypes.MsgDissociateRecords, +) (*registrytypes.MsgDissociateRecordsResponse, error) { if err := msg.ValidateBasic(); err != nil { return nil, err } diff --git a/x/registry/keeper/query_server.go b/x/registry/keeper/query_server.go index 3b4ff74c..3cbdc775 100644 --- a/x/registry/keeper/query_server.go +++ b/x/registry/keeper/query_server.go @@ -75,7 +75,10 @@ func (qs queryServer) GetRecord(c context.Context, req *registrytypes.QueryGetRe return ®istrytypes.QueryGetRecordResponse{Record: record}, nil } -func (qs queryServer) GetRecordsByBondId(c context.Context, req *registrytypes.QueryGetRecordsByBondIdRequest) (*registrytypes.QueryGetRecordsByBondIdResponse, error) { +func (qs queryServer) GetRecordsByBondId( + c context.Context, + req *registrytypes.QueryGetRecordsByBondIdRequest, +) (*registrytypes.QueryGetRecordsByBondIdResponse, error) { ctx := sdk.UnwrapSDKContext(c) records, err := qs.k.GetRecordsByBondId(ctx, req.GetId()) -- 2.45.2 From a8a59ad0c1ba872084c8554aabd22f1ed460e44e Mon Sep 17 00:00:00 2001 From: Nabarun Gogoi Date: Mon, 15 Jul 2024 15:03:44 +0530 Subject: [PATCH 6/8] Rename `ethereum_address` to `nitro_address` in onboarding module (#8) * Rename ethereum_address to nitro_address * Use camel case for variables in gql schema * Fix indentation in proto files * Fix proto lint errors --------- Co-authored-by: IshaVenikar --- api/cerc/onboarding/v1/onboarding.pulsar.go | 119 +++++------ api/cerc/onboarding/v1/tx.pulsar.go | 3 +- gql/README.md | 41 ++-- gql/cerc-io/laconicd/schema.graphql | 24 +-- gql/generated.go | 210 ++++++++++---------- gql/models_gen.go | 24 +-- gql/resolver.go | 4 +- proto/cerc/onboarding/v1/onboarding.proto | 30 ++- proto/cerc/onboarding/v1/query.proto | 3 +- proto/cerc/onboarding/v1/tx.proto | 9 +- x/onboarding/keeper/keeper.go | 9 +- x/onboarding/onboarding.pb.go | 71 +++---- x/onboarding/tx.pb.go | 3 +- 13 files changed, 278 insertions(+), 272 deletions(-) diff --git a/api/cerc/onboarding/v1/onboarding.pulsar.go b/api/cerc/onboarding/v1/onboarding.pulsar.go index f2f72741..f044479a 100644 --- a/api/cerc/onboarding/v1/onboarding.pulsar.go +++ b/api/cerc/onboarding/v1/onboarding.pulsar.go @@ -424,16 +424,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } var ( - md_Participant protoreflect.MessageDescriptor - fd_Participant_cosmos_address protoreflect.FieldDescriptor - fd_Participant_ethereum_address protoreflect.FieldDescriptor + md_Participant protoreflect.MessageDescriptor + fd_Participant_cosmos_address protoreflect.FieldDescriptor + fd_Participant_nitro_address protoreflect.FieldDescriptor ) func init() { file_cerc_onboarding_v1_onboarding_proto_init() md_Participant = File_cerc_onboarding_v1_onboarding_proto.Messages().ByName("Participant") fd_Participant_cosmos_address = md_Participant.Fields().ByName("cosmos_address") - fd_Participant_ethereum_address = md_Participant.Fields().ByName("ethereum_address") + fd_Participant_nitro_address = md_Participant.Fields().ByName("nitro_address") } var _ protoreflect.Message = (*fastReflection_Participant)(nil) @@ -507,9 +507,9 @@ func (x *fastReflection_Participant) Range(f func(protoreflect.FieldDescriptor, return } } - if x.EthereumAddress != "" { - value := protoreflect.ValueOfString(x.EthereumAddress) - if !f(fd_Participant_ethereum_address, value) { + if x.NitroAddress != "" { + value := protoreflect.ValueOfString(x.NitroAddress) + if !f(fd_Participant_nitro_address, value) { return } } @@ -530,8 +530,8 @@ func (x *fastReflection_Participant) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "cerc.onboarding.v1.Participant.cosmos_address": return x.CosmosAddress != "" - case "cerc.onboarding.v1.Participant.ethereum_address": - return x.EthereumAddress != "" + case "cerc.onboarding.v1.Participant.nitro_address": + return x.NitroAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -550,8 +550,8 @@ func (x *fastReflection_Participant) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cerc.onboarding.v1.Participant.cosmos_address": x.CosmosAddress = "" - case "cerc.onboarding.v1.Participant.ethereum_address": - x.EthereumAddress = "" + case "cerc.onboarding.v1.Participant.nitro_address": + x.NitroAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -571,8 +571,8 @@ func (x *fastReflection_Participant) Get(descriptor protoreflect.FieldDescriptor case "cerc.onboarding.v1.Participant.cosmos_address": value := x.CosmosAddress return protoreflect.ValueOfString(value) - case "cerc.onboarding.v1.Participant.ethereum_address": - value := x.EthereumAddress + case "cerc.onboarding.v1.Participant.nitro_address": + value := x.NitroAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -596,8 +596,8 @@ func (x *fastReflection_Participant) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "cerc.onboarding.v1.Participant.cosmos_address": x.CosmosAddress = value.Interface().(string) - case "cerc.onboarding.v1.Participant.ethereum_address": - x.EthereumAddress = value.Interface().(string) + case "cerc.onboarding.v1.Participant.nitro_address": + x.NitroAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -620,8 +620,8 @@ func (x *fastReflection_Participant) Mutable(fd protoreflect.FieldDescriptor) pr switch fd.FullName() { case "cerc.onboarding.v1.Participant.cosmos_address": panic(fmt.Errorf("field cosmos_address of message cerc.onboarding.v1.Participant is not mutable")) - case "cerc.onboarding.v1.Participant.ethereum_address": - panic(fmt.Errorf("field ethereum_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")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.onboarding.v1.Participant")) @@ -637,7 +637,7 @@ func (x *fastReflection_Participant) NewField(fd protoreflect.FieldDescriptor) p switch fd.FullName() { case "cerc.onboarding.v1.Participant.cosmos_address": return protoreflect.ValueOfString("") - case "cerc.onboarding.v1.Participant.ethereum_address": + case "cerc.onboarding.v1.Participant.nitro_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -712,7 +712,7 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.EthereumAddress) + l = len(x.NitroAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -745,10 +745,10 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.EthereumAddress) > 0 { - i -= len(x.EthereumAddress) - copy(dAtA[i:], x.EthereumAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthereumAddress))) + if len(x.NitroAddress) > 0 { + i -= len(x.NitroAddress) + copy(dAtA[i:], x.NitroAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NitroAddress))) i-- dAtA[i] = 0x12 } @@ -842,7 +842,7 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EthereumAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NitroAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -870,7 +870,7 @@ func (x *fastReflection_Participant) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.EthereumAddress = string(dAtA[iNdEx:postIndex]) + x.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1440,14 +1440,15 @@ func (x *Params) GetOnboardingEnabled() bool { return false } -// Participant defines the data that will be stored for each enrolled participant +// Participant defines the data that will be stored for each enrolled +// participant type Participant struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"` - EthereumAddress string `protobuf:"bytes,2,opt,name=ethereum_address,json=ethereumAddress,proto3" json:"ethereum_address,omitempty"` + 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"` } func (x *Participant) Reset() { @@ -1477,9 +1478,9 @@ func (x *Participant) GetCosmosAddress() string { return "" } -func (x *Participant) GetEthereumAddress() string { +func (x *Participant) GetNitroAddress() string { if x != nil { - return x.EthereumAddress + return x.NitroAddress } return "" } @@ -1543,40 +1544,40 @@ 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, 0xc5, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x64, 0x22, 0xb9, 0x01, 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, 0x65, 0x73, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0d, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5e, 0x0a, 0x10, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x33, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 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, + 0x6f, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x52, 0x0a, 0x0d, 0x6e, 0x69, 0x74, + 0x72, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 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, } var ( diff --git a/api/cerc/onboarding/v1/tx.pulsar.go b/api/cerc/onboarding/v1/tx.pulsar.go index 21d3ae03..0865e896 100644 --- a/api/cerc/onboarding/v1/tx.pulsar.go +++ b/api/cerc/onboarding/v1/tx.pulsar.go @@ -1000,7 +1000,8 @@ func (x *MsgOnboardParticipant) GetEthSignature() string { return "" } -// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response +// type. type MsgOnboardParticipantResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/gql/README.md b/gql/README.md index 1b1a5d26..5c4e75d5 100644 --- a/gql/README.md +++ b/gql/README.md @@ -13,6 +13,7 @@ On having some change in the GQL schema (for example: adding a new query) update go get github.com/99designs/gqlgen@v0.17.22 # Generate bindings + # In gql go run github.com/99designs/gqlgen generate ``` @@ -43,15 +44,15 @@ Basic node status: moniker } sync { - latest_block_height - catching_up + latestBlockHeight + catchingUp } - num_peers + numPeers peers { - is_outbound - remote_ip + isOutbound + remoteIp } - disk_usage + diskUsage } } ``` @@ -68,32 +69,32 @@ Full node status: moniker } sync { - latest_block_hash - latest_block_time - latest_block_height - catching_up + latestBlockHash + latestBlockTime + latestBlockHeight + catchingUp } validator { address - voting_power - proposer_priority + votingPower + proposerPriority } validators { address - voting_power - proposer_priority + votingPower + proposerPriority } - num_peers + numPeers peers { node { id network moniker } - is_outbound - remote_ip + isOutbound + remoteIp } - disk_usage + diskUsage } } ``` @@ -380,8 +381,8 @@ Query participants: ```graphql { getParticipants { - cosmos_address - ethereum_address + cosmosAddress + nitroAddress } } ``` \ No newline at end of file diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index 11220cd3..8bd8dd17 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -31,8 +31,8 @@ type Account { } type Participant { - cosmos_address: String! # Cosmos address of the participant who will be registered. - ethereum_address: String! # Ethereum addresss of the participant who will be registered. + cosmosAddress: String! # Cosmos address of the participant who will be registered. + nitroAddress: String! # Nitro addresss of the participant who will be registered. } # Value describes a DAG-JSON compatible value. @@ -111,24 +111,24 @@ type NodeInfo { # Node sync status. type SyncInfo { - latest_block_hash: String! - latest_block_height: String! - latest_block_time: String! - catching_up: Boolean! + latestBlockHash: String! + latestBlockHeight: String! + latestBlockTime: String! + catchingUp: Boolean! } # Validator set info (https://docs.tendermint.com/master/rpc/#/Info/validators). type ValidatorInfo { address: String! - voting_power: String! - proposer_priority: String + votingPower: String! + proposerPriority: String } # Network/peer info (https://docs.tendermint.com/master/rpc/#/Info/net_info). type PeerInfo { node: NodeInfo! - is_outbound: Boolean! - remote_ip: String! + isOutbound: Boolean! + remoteIp: String! } # Vulcanize laconic status. @@ -138,9 +138,9 @@ type Status { sync: SyncInfo! validator: ValidatorInfo validators: [ValidatorInfo]! - num_peers: String! + numPeers: String! peers: [PeerInfo] - disk_usage: String! + diskUsage: String! } # An auction bid. diff --git a/gql/generated.go b/gql/generated.go index 5531cb38..b7b2ed17 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -154,8 +154,8 @@ type ComplexityRoot struct { } Participant struct { - CosmosAddress func(childComplexity int) int - EthereumAddress func(childComplexity int) int + CosmosAddress func(childComplexity int) int + NitroAddress func(childComplexity int) int } PeerInfo struct { @@ -641,21 +641,21 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OwnerBonds.Owner(childComplexity), true - case "Participant.cosmos_address": + case "Participant.cosmosAddress": if e.complexity.Participant.CosmosAddress == nil { break } return e.complexity.Participant.CosmosAddress(childComplexity), true - case "Participant.ethereum_address": - if e.complexity.Participant.EthereumAddress == nil { + case "Participant.nitroAddress": + if e.complexity.Participant.NitroAddress == nil { break } - return e.complexity.Participant.EthereumAddress(childComplexity), true + return e.complexity.Participant.NitroAddress(childComplexity), true - case "PeerInfo.is_outbound": + case "PeerInfo.isOutbound": if e.complexity.PeerInfo.IsOutbound == nil { break } @@ -669,7 +669,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PeerInfo.Node(childComplexity), true - case "PeerInfo.remote_ip": + case "PeerInfo.remoteIp": if e.complexity.PeerInfo.RemoteIP == nil { break } @@ -866,7 +866,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Record.References(childComplexity), true - case "Status.disk_usage": + case "Status.diskUsage": if e.complexity.Status.DiskUsage == nil { break } @@ -880,7 +880,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Status.Node(childComplexity), true - case "Status.num_peers": + case "Status.numPeers": if e.complexity.Status.NumPeers == nil { break } @@ -929,28 +929,28 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.StringValue.Value(childComplexity), true - case "SyncInfo.catching_up": + case "SyncInfo.catchingUp": if e.complexity.SyncInfo.CatchingUp == nil { break } return e.complexity.SyncInfo.CatchingUp(childComplexity), true - case "SyncInfo.latest_block_hash": + case "SyncInfo.latestBlockHash": if e.complexity.SyncInfo.LatestBlockHash == nil { break } return e.complexity.SyncInfo.LatestBlockHash(childComplexity), true - case "SyncInfo.latest_block_height": + case "SyncInfo.latestBlockHeight": if e.complexity.SyncInfo.LatestBlockHeight == nil { break } return e.complexity.SyncInfo.LatestBlockHeight(childComplexity), true - case "SyncInfo.latest_block_time": + case "SyncInfo.latestBlockTime": if e.complexity.SyncInfo.LatestBlockTime == nil { break } @@ -964,14 +964,14 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ValidatorInfo.Address(childComplexity), true - case "ValidatorInfo.proposer_priority": + case "ValidatorInfo.proposerPriority": if e.complexity.ValidatorInfo.ProposerPriority == nil { break } return e.complexity.ValidatorInfo.ProposerPriority(childComplexity), true - case "ValidatorInfo.voting_power": + case "ValidatorInfo.votingPower": if e.complexity.ValidatorInfo.VotingPower == nil { break } @@ -3836,8 +3836,8 @@ func (ec *executionContext) fieldContext_OwnerBonds_bonds(ctx context.Context, f return fc, nil } -func (ec *executionContext) _Participant_cosmos_address(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Participant_cosmos_address(ctx, field) +func (ec *executionContext) _Participant_cosmosAddress(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_cosmosAddress(ctx, field) if err != nil { return graphql.Null } @@ -3867,7 +3867,7 @@ func (ec *executionContext) _Participant_cosmos_address(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Participant_cosmos_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Participant_cosmosAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Participant", Field: field, @@ -3880,8 +3880,8 @@ func (ec *executionContext) fieldContext_Participant_cosmos_address(ctx context. return fc, nil } -func (ec *executionContext) _Participant_ethereum_address(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Participant_ethereum_address(ctx, field) +func (ec *executionContext) _Participant_nitroAddress(ctx context.Context, field graphql.CollectedField, obj *Participant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Participant_nitroAddress(ctx, field) if err != nil { return graphql.Null } @@ -3894,7 +3894,7 @@ func (ec *executionContext) _Participant_ethereum_address(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EthereumAddress, nil + return obj.NitroAddress, nil }) if err != nil { ec.Error(ctx, err) @@ -3911,7 +3911,7 @@ func (ec *executionContext) _Participant_ethereum_address(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Participant_ethereum_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Participant_nitroAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Participant", Field: field, @@ -3976,8 +3976,8 @@ func (ec *executionContext) fieldContext_PeerInfo_node(ctx context.Context, fiel return fc, nil } -func (ec *executionContext) _PeerInfo_is_outbound(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PeerInfo_is_outbound(ctx, field) +func (ec *executionContext) _PeerInfo_isOutbound(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PeerInfo_isOutbound(ctx, field) if err != nil { return graphql.Null } @@ -4007,7 +4007,7 @@ func (ec *executionContext) _PeerInfo_is_outbound(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PeerInfo_is_outbound(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PeerInfo_isOutbound(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PeerInfo", Field: field, @@ -4020,8 +4020,8 @@ func (ec *executionContext) fieldContext_PeerInfo_is_outbound(ctx context.Contex return fc, nil } -func (ec *executionContext) _PeerInfo_remote_ip(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PeerInfo_remote_ip(ctx, field) +func (ec *executionContext) _PeerInfo_remoteIp(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PeerInfo_remoteIp(ctx, field) if err != nil { return graphql.Null } @@ -4051,7 +4051,7 @@ func (ec *executionContext) _PeerInfo_remote_ip(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PeerInfo_remote_ip(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PeerInfo_remoteIp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PeerInfo", Field: field, @@ -4113,12 +4113,12 @@ func (ec *executionContext) fieldContext_Query_getStatus(ctx context.Context, fi return ec.fieldContext_Status_validator(ctx, field) case "validators": return ec.fieldContext_Status_validators(ctx, field) - case "num_peers": - return ec.fieldContext_Status_num_peers(ctx, field) + case "numPeers": + return ec.fieldContext_Status_numPeers(ctx, field) case "peers": return ec.fieldContext_Status_peers(ctx, field) - case "disk_usage": - return ec.fieldContext_Status_disk_usage(ctx, field) + case "diskUsage": + return ec.fieldContext_Status_diskUsage(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) }, @@ -4832,10 +4832,10 @@ func (ec *executionContext) fieldContext_Query_getParticipants(ctx context.Conte IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "cosmos_address": - return ec.fieldContext_Participant_cosmos_address(ctx, field) - case "ethereum_address": - return ec.fieldContext_Participant_ethereum_address(ctx, field) + case "cosmosAddress": + return ec.fieldContext_Participant_cosmosAddress(ctx, field) + case "nitroAddress": + return ec.fieldContext_Participant_nitroAddress(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Participant", field.Name) }, @@ -5471,14 +5471,14 @@ func (ec *executionContext) fieldContext_Status_sync(ctx context.Context, field IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "latest_block_hash": - return ec.fieldContext_SyncInfo_latest_block_hash(ctx, field) - case "latest_block_height": - return ec.fieldContext_SyncInfo_latest_block_height(ctx, field) - case "latest_block_time": - return ec.fieldContext_SyncInfo_latest_block_time(ctx, field) - case "catching_up": - return ec.fieldContext_SyncInfo_catching_up(ctx, field) + case "latestBlockHash": + return ec.fieldContext_SyncInfo_latestBlockHash(ctx, field) + case "latestBlockHeight": + return ec.fieldContext_SyncInfo_latestBlockHeight(ctx, field) + case "latestBlockTime": + return ec.fieldContext_SyncInfo_latestBlockTime(ctx, field) + case "catchingUp": + return ec.fieldContext_SyncInfo_catchingUp(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SyncInfo", field.Name) }, @@ -5524,10 +5524,10 @@ func (ec *executionContext) fieldContext_Status_validator(ctx context.Context, f switch field.Name { case "address": return ec.fieldContext_ValidatorInfo_address(ctx, field) - case "voting_power": - return ec.fieldContext_ValidatorInfo_voting_power(ctx, field) - case "proposer_priority": - return ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) + case "votingPower": + return ec.fieldContext_ValidatorInfo_votingPower(ctx, field) + case "proposerPriority": + return ec.fieldContext_ValidatorInfo_proposerPriority(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ValidatorInfo", field.Name) }, @@ -5576,10 +5576,10 @@ func (ec *executionContext) fieldContext_Status_validators(ctx context.Context, switch field.Name { case "address": return ec.fieldContext_ValidatorInfo_address(ctx, field) - case "voting_power": - return ec.fieldContext_ValidatorInfo_voting_power(ctx, field) - case "proposer_priority": - return ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) + case "votingPower": + return ec.fieldContext_ValidatorInfo_votingPower(ctx, field) + case "proposerPriority": + return ec.fieldContext_ValidatorInfo_proposerPriority(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ValidatorInfo", field.Name) }, @@ -5587,8 +5587,8 @@ func (ec *executionContext) fieldContext_Status_validators(ctx context.Context, return fc, nil } -func (ec *executionContext) _Status_num_peers(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_num_peers(ctx, field) +func (ec *executionContext) _Status_numPeers(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_numPeers(ctx, field) if err != nil { return graphql.Null } @@ -5618,7 +5618,7 @@ func (ec *executionContext) _Status_num_peers(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_num_peers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Status_numPeers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Status", Field: field, @@ -5669,10 +5669,10 @@ func (ec *executionContext) fieldContext_Status_peers(ctx context.Context, field switch field.Name { case "node": return ec.fieldContext_PeerInfo_node(ctx, field) - case "is_outbound": - return ec.fieldContext_PeerInfo_is_outbound(ctx, field) - case "remote_ip": - return ec.fieldContext_PeerInfo_remote_ip(ctx, field) + case "isOutbound": + return ec.fieldContext_PeerInfo_isOutbound(ctx, field) + case "remoteIp": + return ec.fieldContext_PeerInfo_remoteIp(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type PeerInfo", field.Name) }, @@ -5680,8 +5680,8 @@ func (ec *executionContext) fieldContext_Status_peers(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Status_disk_usage(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Status_disk_usage(ctx, field) +func (ec *executionContext) _Status_diskUsage(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_diskUsage(ctx, field) if err != nil { return graphql.Null } @@ -5711,7 +5711,7 @@ func (ec *executionContext) _Status_disk_usage(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_disk_usage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Status_diskUsage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Status", Field: field, @@ -5768,8 +5768,8 @@ func (ec *executionContext) fieldContext_StringValue_value(ctx context.Context, return fc, nil } -func (ec *executionContext) _SyncInfo_latest_block_hash(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncInfo_latest_block_hash(ctx, field) +func (ec *executionContext) _SyncInfo_latestBlockHash(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latestBlockHash(ctx, field) if err != nil { return graphql.Null } @@ -5799,7 +5799,7 @@ func (ec *executionContext) _SyncInfo_latest_block_hash(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncInfo_latest_block_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SyncInfo_latestBlockHash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SyncInfo", Field: field, @@ -5812,8 +5812,8 @@ func (ec *executionContext) fieldContext_SyncInfo_latest_block_hash(ctx context. return fc, nil } -func (ec *executionContext) _SyncInfo_latest_block_height(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncInfo_latest_block_height(ctx, field) +func (ec *executionContext) _SyncInfo_latestBlockHeight(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latestBlockHeight(ctx, field) if err != nil { return graphql.Null } @@ -5843,7 +5843,7 @@ func (ec *executionContext) _SyncInfo_latest_block_height(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncInfo_latest_block_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SyncInfo_latestBlockHeight(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SyncInfo", Field: field, @@ -5856,8 +5856,8 @@ func (ec *executionContext) fieldContext_SyncInfo_latest_block_height(ctx contex return fc, nil } -func (ec *executionContext) _SyncInfo_latest_block_time(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncInfo_latest_block_time(ctx, field) +func (ec *executionContext) _SyncInfo_latestBlockTime(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latestBlockTime(ctx, field) if err != nil { return graphql.Null } @@ -5887,7 +5887,7 @@ func (ec *executionContext) _SyncInfo_latest_block_time(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncInfo_latest_block_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SyncInfo_latestBlockTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SyncInfo", Field: field, @@ -5900,8 +5900,8 @@ func (ec *executionContext) fieldContext_SyncInfo_latest_block_time(ctx context. return fc, nil } -func (ec *executionContext) _SyncInfo_catching_up(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SyncInfo_catching_up(ctx, field) +func (ec *executionContext) _SyncInfo_catchingUp(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_catchingUp(ctx, field) if err != nil { return graphql.Null } @@ -5931,7 +5931,7 @@ func (ec *executionContext) _SyncInfo_catching_up(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SyncInfo_catching_up(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SyncInfo_catchingUp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SyncInfo", Field: field, @@ -5988,8 +5988,8 @@ func (ec *executionContext) fieldContext_ValidatorInfo_address(ctx context.Conte return fc, nil } -func (ec *executionContext) _ValidatorInfo_voting_power(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ValidatorInfo_voting_power(ctx, field) +func (ec *executionContext) _ValidatorInfo_votingPower(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ValidatorInfo_votingPower(ctx, field) if err != nil { return graphql.Null } @@ -6019,7 +6019,7 @@ func (ec *executionContext) _ValidatorInfo_voting_power(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ValidatorInfo_voting_power(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ValidatorInfo_votingPower(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ValidatorInfo", Field: field, @@ -6032,8 +6032,8 @@ func (ec *executionContext) fieldContext_ValidatorInfo_voting_power(ctx context. return fc, nil } -func (ec *executionContext) _ValidatorInfo_proposer_priority(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) +func (ec *executionContext) _ValidatorInfo_proposerPriority(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ValidatorInfo_proposerPriority(ctx, field) if err != nil { return graphql.Null } @@ -6060,7 +6060,7 @@ func (ec *executionContext) _ValidatorInfo_proposer_priority(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ValidatorInfo_proposer_priority(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ValidatorInfo_proposerPriority(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ValidatorInfo", Field: field, @@ -8787,16 +8787,16 @@ func (ec *executionContext) _Participant(ctx context.Context, sel ast.SelectionS switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Participant") - case "cosmos_address": + case "cosmosAddress": - out.Values[i] = ec._Participant_cosmos_address(ctx, field, obj) + out.Values[i] = ec._Participant_cosmosAddress(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "ethereum_address": + case "nitroAddress": - out.Values[i] = ec._Participant_ethereum_address(ctx, field, obj) + out.Values[i] = ec._Participant_nitroAddress(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -8829,16 +8829,16 @@ func (ec *executionContext) _PeerInfo(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { invalids++ } - case "is_outbound": + case "isOutbound": - out.Values[i] = ec._PeerInfo_is_outbound(ctx, field, obj) + out.Values[i] = ec._PeerInfo_isOutbound(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "remote_ip": + case "remoteIp": - out.Values[i] = ec._PeerInfo_remote_ip(ctx, field, obj) + out.Values[i] = ec._PeerInfo_remoteIp(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -9258,9 +9258,9 @@ func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, o if out.Values[i] == graphql.Null { invalids++ } - case "num_peers": + case "numPeers": - out.Values[i] = ec._Status_num_peers(ctx, field, obj) + out.Values[i] = ec._Status_numPeers(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -9269,9 +9269,9 @@ func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec._Status_peers(ctx, field, obj) - case "disk_usage": + case "diskUsage": - out.Values[i] = ec._Status_disk_usage(ctx, field, obj) + out.Values[i] = ec._Status_diskUsage(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -9325,30 +9325,30 @@ func (ec *executionContext) _SyncInfo(ctx context.Context, sel ast.SelectionSet, switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SyncInfo") - case "latest_block_hash": + case "latestBlockHash": - out.Values[i] = ec._SyncInfo_latest_block_hash(ctx, field, obj) + out.Values[i] = ec._SyncInfo_latestBlockHash(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "latest_block_height": + case "latestBlockHeight": - out.Values[i] = ec._SyncInfo_latest_block_height(ctx, field, obj) + out.Values[i] = ec._SyncInfo_latestBlockHeight(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "latest_block_time": + case "latestBlockTime": - out.Values[i] = ec._SyncInfo_latest_block_time(ctx, field, obj) + out.Values[i] = ec._SyncInfo_latestBlockTime(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "catching_up": + case "catchingUp": - out.Values[i] = ec._SyncInfo_catching_up(ctx, field, obj) + out.Values[i] = ec._SyncInfo_catchingUp(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -9381,16 +9381,16 @@ func (ec *executionContext) _ValidatorInfo(ctx context.Context, sel ast.Selectio if out.Values[i] == graphql.Null { invalids++ } - case "voting_power": + case "votingPower": - out.Values[i] = ec._ValidatorInfo_voting_power(ctx, field, obj) + out.Values[i] = ec._ValidatorInfo_votingPower(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "proposer_priority": + case "proposerPriority": - out.Values[i] = ec._ValidatorInfo_proposer_priority(ctx, field, obj) + out.Values[i] = ec._ValidatorInfo_proposerPriority(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/gql/models_gen.go b/gql/models_gen.go index 4308ae69..8584ba62 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -136,14 +136,14 @@ type OwnerBonds struct { } type Participant struct { - CosmosAddress string `json:"cosmos_address"` - EthereumAddress string `json:"ethereum_address"` + CosmosAddress string `json:"cosmosAddress"` + NitroAddress string `json:"nitroAddress"` } type PeerInfo struct { Node *NodeInfo `json:"node"` - IsOutbound bool `json:"is_outbound"` - RemoteIP string `json:"remote_ip"` + IsOutbound bool `json:"isOutbound"` + RemoteIP string `json:"remoteIp"` } type Record struct { @@ -163,9 +163,9 @@ type Status struct { Sync *SyncInfo `json:"sync"` Validator *ValidatorInfo `json:"validator"` Validators []*ValidatorInfo `json:"validators"` - NumPeers string `json:"num_peers"` + NumPeers string `json:"numPeers"` Peers []*PeerInfo `json:"peers"` - DiskUsage string `json:"disk_usage"` + DiskUsage string `json:"diskUsage"` } type StringValue struct { @@ -175,16 +175,16 @@ type StringValue struct { func (StringValue) IsValue() {} type SyncInfo struct { - LatestBlockHash string `json:"latest_block_hash"` - LatestBlockHeight string `json:"latest_block_height"` - LatestBlockTime string `json:"latest_block_time"` - CatchingUp bool `json:"catching_up"` + LatestBlockHash string `json:"latestBlockHash"` + LatestBlockHeight string `json:"latestBlockHeight"` + LatestBlockTime string `json:"latestBlockTime"` + CatchingUp bool `json:"catchingUp"` } type ValidatorInfo struct { Address string `json:"address"` - VotingPower string `json:"voting_power"` - ProposerPriority *string `json:"proposer_priority"` + VotingPower string `json:"votingPower"` + ProposerPriority *string `json:"proposerPriority"` } type ValueInput struct { diff --git a/gql/resolver.go b/gql/resolver.go index 9e1c1daf..5538e6d7 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -371,8 +371,8 @@ func (q queryResolver) GetParticipants(ctx context.Context) ([]*Participant, err participants := make([]*Participant, len(participantResp.GetParticipants())) for i, p := range participantResp.Participants { participants[i] = &Participant{ - CosmosAddress: p.CosmosAddress, - EthereumAddress: p.EthereumAddress, + CosmosAddress: p.CosmosAddress, + NitroAddress: p.NitroAddress, } } diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index 876cc7ea..38ca1f4c 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -8,28 +8,26 @@ option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; // Params defines the parameters of the onboarding module. message Params { - bool onboarding_enabled = 1 [ - (gogoproto.moretags) = "json:\"onboarding_enabled\" yaml:\"onboarding_enabled\"" - ]; + bool onboarding_enabled = 1 + [ (gogoproto.moretags) = + "json:\"onboarding_enabled\" yaml:\"onboarding_enabled\"" ]; } -// Participant defines the data that will be stored for each enrolled participant +// Participant defines the data that will be stored for each enrolled +// participant message Participant { - string cosmos_address = 1 [ - (gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\"" - ]; + string cosmos_address = 1 + [ (gogoproto.moretags) = + "json:\"cosmos_address\" yaml:\"cosmos_address\"" ]; - string ethereum_address = 2 [ - (gogoproto.moretags) = "json:\"ethereum_address\" yaml:\"ethereum_address\"" - ]; + string nitro_address = 2 + [ (gogoproto.moretags) = + "json:\"nitro_address\" yaml:\"nitro_address\"" ]; } // EthPayload defines the payload that is signed by the ethereum private key message EthPayload { - string address = 1 [ - (gogoproto.moretags) = "json:\"address\" yaml:\"address\"" - ]; + string address = 1 + [ (gogoproto.moretags) = "json:\"address\" yaml:\"address\"" ]; - string msg = 2 [ - (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" - ]; + string msg = 2 [ (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" ]; } diff --git a/proto/cerc/onboarding/v1/query.proto b/proto/cerc/onboarding/v1/query.proto index 1345bb80..bbcfc875 100644 --- a/proto/cerc/onboarding/v1/query.proto +++ b/proto/cerc/onboarding/v1/query.proto @@ -12,7 +12,8 @@ option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding"; // Query defines the gRPC querier service for onboarding module service Query { // Participants queries Participants list - rpc Participants(QueryParticipantsRequest) returns (QueryParticipantsResponse) { + rpc Participants(QueryParticipantsRequest) + returns (QueryParticipantsResponse) { option (google.api.http).get = "/cerc/onboarding/v1/participants"; } } diff --git a/proto/cerc/onboarding/v1/tx.proto b/proto/cerc/onboarding/v1/tx.proto index bf07de52..2c21614d 100644 --- a/proto/cerc/onboarding/v1/tx.proto +++ b/proto/cerc/onboarding/v1/tx.proto @@ -15,9 +15,9 @@ service Msg { // OnboardParticipant defines a method for enrolling a new validator. rpc OnboardParticipant(MsgOnboardParticipant) - returns (MsgOnboardParticipantResponse) { - option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant"; - }; + returns (MsgOnboardParticipantResponse) { + option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant"; + }; } // MsgOnboardParticipant defines a SDK message for enrolling a new validator. @@ -30,5 +30,6 @@ message MsgOnboardParticipant { string eth_signature = 3; } -// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response +// type. message MsgOnboardParticipantResponse {} diff --git a/x/onboarding/keeper/keeper.go b/x/onboarding/keeper/keeper.go index f710aff7..f86edf81 100644 --- a/x/onboarding/keeper/keeper.go +++ b/x/onboarding/keeper/keeper.go @@ -87,18 +87,19 @@ func (k Keeper) OnboardParticipant( return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid format for payload") } - ethereumAddress, err := utils.DecodeEthereumAddress(message, msg.EthSignature) + // Decode eth address from signature which should be the nitro address of the participant + nitroAddress, err := utils.DecodeEthereumAddress(message, msg.EthSignature) if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Failed to decode Ethereum address") } - if ethereumAddress != msg.EthPayload.Address { + if nitroAddress != msg.EthPayload.Address { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Recovered ethereum address does not match the address set in payload") } participant := &onboardingTypes.Participant{ - CosmosAddress: signerAddress.String(), - EthereumAddress: ethereumAddress, + CosmosAddress: signerAddress.String(), + NitroAddress: nitroAddress, } if err := k.StoreParticipant(ctx, participant); err != nil { diff --git a/x/onboarding/onboarding.pb.go b/x/onboarding/onboarding.pb.go index facbab6c..56c781cb 100644 --- a/x/onboarding/onboarding.pb.go +++ b/x/onboarding/onboarding.pb.go @@ -68,10 +68,11 @@ func (m *Params) GetOnboardingEnabled() bool { return false } -// Participant defines the data that will be stored for each enrolled participant +// Participant defines the data that will be stored for each enrolled +// participant type Participant struct { - CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty" json:"cosmos_address" yaml:"cosmos_address"` - EthereumAddress string `protobuf:"bytes,2,opt,name=ethereum_address,json=ethereumAddress,proto3" json:"ethereum_address,omitempty" json:"ethereum_address" yaml:"ethereum_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"` } func (m *Participant) Reset() { *m = Participant{} } @@ -114,9 +115,9 @@ func (m *Participant) GetCosmosAddress() string { return "" } -func (m *Participant) GetEthereumAddress() string { +func (m *Participant) GetNitroAddress() string { if m != nil { - return m.EthereumAddress + return m.NitroAddress } return "" } @@ -185,29 +186,29 @@ func init() { } var fileDescriptor_59afed779274eaf0 = []byte{ - // 346 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4a, 0xc3, 0x40, - 0x14, 0x85, 0x1b, 0x85, 0xaa, 0x23, 0xfe, 0x0d, 0x0a, 0x2a, 0x98, 0xd4, 0xb8, 0x29, 0x14, 0x33, - 0x94, 0x2e, 0x04, 0x5d, 0x19, 0xe8, 0xbe, 0x64, 0xe1, 0xc2, 0x85, 0x65, 0x92, 0x8c, 0x69, 0x24, - 0xc9, 0x2d, 0x33, 0x63, 0xb0, 0x6f, 0xe1, 0x4b, 0x09, 0x2e, 0xbb, 0x74, 0x15, 0xa4, 0x7d, 0x83, - 0x3c, 0x81, 0x24, 0xd3, 0xf4, 0xd7, 0xdd, 0xcc, 0xb9, 0xe7, 0x7c, 0x67, 0x60, 0x2e, 0xba, 0xf1, - 0x18, 0xf7, 0x08, 0x24, 0x2e, 0x50, 0xee, 0x87, 0x49, 0x40, 0xd2, 0xf6, 0xd2, 0xcd, 0x1a, 0x72, - 0x90, 0x80, 0x71, 0x61, 0xb2, 0x96, 0xe4, 0xb4, 0x7d, 0x79, 0x1a, 0x40, 0x00, 0xe5, 0x98, 0x14, - 0x27, 0xe5, 0x34, 0x87, 0xa8, 0xde, 0xa3, 0x9c, 0xc6, 0x02, 0xbf, 0x22, 0xbc, 0x08, 0xf4, 0x59, - 0x42, 0xdd, 0x88, 0xf9, 0xe7, 0x5a, 0x43, 0x6b, 0xee, 0xda, 0x77, 0x79, 0x66, 0x74, 0xde, 0x04, - 0x24, 0xf7, 0xe6, 0xa6, 0xc7, 0x6c, 0x8c, 0x68, 0x1c, 0xfd, 0x3b, 0x71, 0x4e, 0x16, 0x62, 0x77, - 0xa6, 0x7d, 0x69, 0x68, 0xbf, 0x47, 0xb9, 0x0c, 0xbd, 0x70, 0x48, 0x13, 0x89, 0x9f, 0xd0, 0xa1, - 0x07, 0x22, 0x06, 0xd1, 0xa7, 0xbe, 0xcf, 0x99, 0x10, 0x65, 0xe7, 0x9e, 0x4d, 0xf2, 0xcc, 0x68, - 0xa9, 0xce, 0xd5, 0x79, 0xd5, 0xb7, 0xa6, 0x3a, 0x07, 0x4a, 0x78, 0x54, 0x77, 0xfc, 0x82, 0x8e, - 0x99, 0x1c, 0x30, 0xce, 0xde, 0xe3, 0x39, 0x79, 0xab, 0x24, 0x77, 0xf2, 0xcc, 0x20, 0x8a, 0xbc, - 0xee, 0xa8, 0xd8, 0x1b, 0xba, 0x73, 0x54, 0x49, 0x33, 0xbe, 0x99, 0x22, 0xd4, 0x95, 0x83, 0x1e, - 0x1d, 0x45, 0x40, 0x7d, 0xfc, 0x80, 0x76, 0x56, 0x9f, 0x7f, 0x9d, 0x67, 0xc6, 0x95, 0x2a, 0x59, - 0x63, 0xcf, 0x91, 0x55, 0x02, 0xb7, 0xd0, 0x76, 0x2c, 0x82, 0xd9, 0xeb, 0x2e, 0xf2, 0xcc, 0x38, - 0x53, 0xc1, 0x58, 0x04, 0x55, 0xa8, 0x38, 0x3a, 0x85, 0xcb, 0xb6, 0xbf, 0x27, 0xba, 0x36, 0x9e, - 0xe8, 0xda, 0xef, 0x44, 0xd7, 0x3e, 0xa7, 0x7a, 0x6d, 0x3c, 0xd5, 0x6b, 0x3f, 0x53, 0xbd, 0xf6, - 0xdc, 0x0c, 0x42, 0x69, 0xa5, 0xbe, 0x6b, 0x49, 0x20, 0xc5, 0x02, 0xdc, 0x86, 0x40, 0x22, 0xea, - 0x41, 0x12, 0x7a, 0x3e, 0xf9, 0x58, 0xda, 0x12, 0xb7, 0x5e, 0x7e, 0x7e, 0xe7, 0x2f, 0x00, 0x00, - 0xff, 0xff, 0x45, 0x07, 0xf1, 0x0c, 0x4d, 0x02, 0x00, 0x00, + // 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, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -263,10 +264,10 @@ func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.EthereumAddress) > 0 { - i -= len(m.EthereumAddress) - copy(dAtA[i:], m.EthereumAddress) - i = encodeVarintOnboarding(dAtA, i, uint64(len(m.EthereumAddress))) + if len(m.NitroAddress) > 0 { + i -= len(m.NitroAddress) + copy(dAtA[i:], m.NitroAddress) + i = encodeVarintOnboarding(dAtA, i, uint64(len(m.NitroAddress))) i-- dAtA[i] = 0x12 } @@ -350,7 +351,7 @@ func (m *Participant) Size() (n int) { if l > 0 { n += 1 + l + sovOnboarding(uint64(l)) } - l = len(m.EthereumAddress) + l = len(m.NitroAddress) if l > 0 { n += 1 + l + sovOnboarding(uint64(l)) } @@ -513,7 +514,7 @@ func (m *Participant) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EthereumAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NitroAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -541,7 +542,7 @@ func (m *Participant) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.EthereumAddress = string(dAtA[iNdEx:postIndex]) + m.NitroAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/onboarding/tx.pb.go b/x/onboarding/tx.pb.go index 33114973..8623b644 100644 --- a/x/onboarding/tx.pb.go +++ b/x/onboarding/tx.pb.go @@ -92,7 +92,8 @@ func (m *MsgOnboardParticipant) GetEthSignature() string { return "" } -// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type. +// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response +// type. type MsgOnboardParticipantResponse struct { } -- 2.45.2 From d36f54543d20d3d95d646154ab7b450de72206c6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 16 Jul 2024 12:01:10 +0530 Subject: [PATCH 7/8] Pin golangci-lint version in lint workflow --- .gitea/workflows/lint.yml | 4 ++-- cmd/laconicd/cmd/root.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 82c56a7b..ad21a427 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: golangci/golangci-lint-action@v3.3.1 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: latest + # Required: the version of golangci-lint is required and must be specified without patch version + version: v1.51 args: --timeout 10m github-token: ${{ secrets.github_token }} diff --git a/cmd/laconicd/cmd/root.go b/cmd/laconicd/cmd/root.go index 14e3f468..b4847145 100644 --- a/cmd/laconicd/cmd/root.go +++ b/cmd/laconicd/cmd/root.go @@ -140,7 +140,8 @@ func ProvideClientContext( // Read the config again to overwrite the default values with the values from the config file clientCtx, _ = config.ReadFromClientConfig(clientCtx) - // Workaround: Unset clientCtx.HomeDir and clientCtx.KeyringDir from depinject clientCtx as they are given precedence over the CLI args (--home flag) in some commands + // Workaround: Unset clientCtx.HomeDir and clientCtx.KeyringDir from depinject clientCtx as they are given precedence over + // the CLI args (--home flag) in some commands // TODO: Implement proper fix clientCtx.HomeDir = "" clientCtx.KeyringDir = "" -- 2.45.2 From 456491a4f230b3da6e1ed581e00b92d36a20b549 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 16 Jul 2024 12:49:31 +0530 Subject: [PATCH 8/8] Comment lint workflow --- .gitea/workflows/lint.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index ad21a427..d70b1cd9 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -8,20 +8,22 @@ on: branches: - main jobs: - golangci: - name: Run golangci-lint - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - # Required: setup-go, for all versions v3.0.0+ of golangci-lint - - uses: actions/setup-go@v3 - with: - go-version: 1.21 - check-latest: true - - uses: actions/checkout@v3 - - uses: golangci/golangci-lint-action@v3.3.1 - with: - # Required: the version of golangci-lint is required and must be specified without patch version - version: v1.51 - args: --timeout 10m - github-token: ${{ secrets.github_token }} + # TODO: Handle CI error: "::error::golangci-lint exit with code 137" and uncomment lint job + + # golangci: + # name: Run golangci-lint + # runs-on: ubuntu-latest + # timeout-minutes: 10 + # steps: + # # Required: setup-go, for all versions v3.0.0+ of golangci-lint + # - uses: actions/setup-go@v3 + # with: + # go-version: 1.21 + # check-latest: true + # - uses: actions/checkout@v3 + # - uses: golangci/golangci-lint-action@v3.3.1 + # with: + # # Required: the version of golangci-lint is required and must be specified without patch version + # version: v1.51 + # args: --timeout 10m + # github-token: ${{ secrets.github_token }} -- 2.45.2