From 97e3cf8818f9744b0b445ae188f5daf4040d30de Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Fri, 25 Oct 2024 18:14:15 +0400 Subject: [PATCH] feat: remove sidecar signing (#70) --- .../api/configmodule/v1/attestator.pulsar.go | 763 ------ .../api/configmodule/v1/genesis.pulsar.go | 206 +- .../api/configmodule/v1/query.pulsar.go | 2213 +---------------- .../api/configmodule/v1/query_grpc.pb.go | 76 +- configmodule/api/configmodule/v1/tx.pulsar.go | 1145 +-------- .../api/configmodule/v1/tx_grpc.pb.go | 39 +- configmodule/autocli.go | 11 - configmodule/client/cli/tx.go | 96 - configmodule/genesis.go | 17 +- configmodule/genesis_test.go | 34 - configmodule/go.mod | 6 +- configmodule/keeper/attestators_handler.go | 18 +- .../keeper/attestators_handler_test.go | 11 +- configmodule/keeper/attestors.go | 20 - configmodule/keeper/grpc_query.go | 39 - configmodule/keeper/grpc_query_test.go | 25 - configmodule/keeper/invariants.go | 1 + configmodule/keeper/keeper.go | 6 +- configmodule/keeper/keeper_test.go | 21 - configmodule/keeper/msg_server.go | 30 - configmodule/keeper/msg_server_test.go | 53 - configmodule/module.go | 7 - .../proto/configmodule/v1/attestator.proto | 17 - .../proto/configmodule/v1/genesis.proto | 5 +- .../proto/configmodule/v1/query.proto | 29 - configmodule/proto/configmodule/v1/tx.proto | 18 - configmodule/types/attestator.go | 55 - configmodule/types/attestator.pb.go | 447 ---- configmodule/types/attestator_test.go | 104 - configmodule/types/codec.go | 1 - configmodule/types/genesis.pb.go | 87 +- configmodule/types/msg.go | 43 - configmodule/types/msg_test.go | 100 - configmodule/types/query.pb.go | 895 +------ configmodule/types/query.pb.gw.go | 184 -- configmodule/types/tx.pb.go | 499 +--- core/go.mod | 3 +- core/go.sum | 4 - core/lightclient/attestators_controller.go | 3 - core/lightclient/clientmsg.go | 10 - core/lightclient/errors.go | 1 + core/lightclient/light_client_module.go | 14 +- core/lightclient/light_client_module_test.go | 30 +- core/lightclient/light_client_test.go | 54 +- core/lightclient/update.go | 26 +- core/lightclient/update_test.go | 27 - core/proto/core/types/v1/attestation.proto | 1 - core/types/attestation.go | 2 +- core/types/attestation.pb.go | 106 +- core/types/attestation_test.go | 8 +- core/voteextension/expected_keepers.go | 11 - core/voteextension/module.go | 16 +- .../testutil/expected_keepers_mocks.go | 50 - core/voteextension/voteextension.go | 10 +- core/voteextension/voteextension_test.go | 157 +- docs/docs/architecture/configmodule.md | 4 +- docs/docs/architecture/sidecar.md | 5 +- .../system-architecture-and-flow.md | 13 +- docs/docs/intro.md | 6 +- sidecar/attestators/coordinator.go | 6 - sidecar/attestators/coordinator_test.go | 11 +- .../cosmos/attestation_collection.go | 10 +- sidecar/attestators/cosmos/attestor.go | 4 +- sidecar/attestators/signing_key.go | 84 - sidecar/attestators/signing_key_test.go | 44 - sidecar/cmd/register_attestor_json.go | 54 - sidecar/cmd/root.go | 2 - sidecar/cmd/signing_keys.go | 77 - sidecar/config/config.go | 12 +- sidecar/config/config_test.go | 49 +- sidecar/register-attestor.json | 1 - sidecar/server/server_test.go | 3 - testing/interchaintest/setup_test.go | 25 +- testing/rollupsimapp/ibc.go | 2 +- testing/scripts/serve-sidecar.sh | 20 +- testing/simapp/ibc.go | 6 +- 76 files changed, 448 insertions(+), 7844 deletions(-) delete mode 100644 configmodule/api/configmodule/v1/attestator.pulsar.go delete mode 100644 configmodule/client/cli/tx.go delete mode 100644 configmodule/keeper/attestors.go delete mode 100644 configmodule/proto/configmodule/v1/attestator.proto delete mode 100644 configmodule/types/attestator.go delete mode 100644 configmodule/types/attestator.pb.go delete mode 100644 configmodule/types/attestator_test.go delete mode 100644 configmodule/types/msg.go delete mode 100644 configmodule/types/msg_test.go delete mode 100644 core/voteextension/expected_keepers.go delete mode 100644 core/voteextension/testutil/expected_keepers_mocks.go delete mode 100644 sidecar/attestators/signing_key.go delete mode 100644 sidecar/attestators/signing_key_test.go delete mode 100644 sidecar/cmd/register_attestor_json.go delete mode 100644 sidecar/cmd/signing_keys.go delete mode 100644 sidecar/register-attestor.json diff --git a/configmodule/api/configmodule/v1/attestator.pulsar.go b/configmodule/api/configmodule/v1/attestator.pulsar.go deleted file mode 100644 index 4bdeb8e..0000000 --- a/configmodule/api/configmodule/v1/attestator.pulsar.go +++ /dev/null @@ -1,763 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package configmodulev1 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - 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" - anypb "google.golang.org/protobuf/types/known/anypb" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Attestator protoreflect.MessageDescriptor - fd_Attestator_attestator_id protoreflect.FieldDescriptor - fd_Attestator_public_key protoreflect.FieldDescriptor - fd_Attestator_consensus_pubkey protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_attestator_proto_init() - md_Attestator = File_configmodule_v1_attestator_proto.Messages().ByName("Attestator") - fd_Attestator_attestator_id = md_Attestator.Fields().ByName("attestator_id") - fd_Attestator_public_key = md_Attestator.Fields().ByName("public_key") - fd_Attestator_consensus_pubkey = md_Attestator.Fields().ByName("consensus_pubkey") -} - -var _ protoreflect.Message = (*fastReflection_Attestator)(nil) - -type fastReflection_Attestator Attestator - -func (x *Attestator) ProtoReflect() protoreflect.Message { - return (*fastReflection_Attestator)(x) -} - -func (x *Attestator) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_attestator_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_Attestator_messageType fastReflection_Attestator_messageType -var _ protoreflect.MessageType = fastReflection_Attestator_messageType{} - -type fastReflection_Attestator_messageType struct{} - -func (x fastReflection_Attestator_messageType) Zero() protoreflect.Message { - return (*fastReflection_Attestator)(nil) -} -func (x fastReflection_Attestator_messageType) New() protoreflect.Message { - return new(fastReflection_Attestator) -} -func (x fastReflection_Attestator_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Attestator -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Attestator) Descriptor() protoreflect.MessageDescriptor { - return md_Attestator -} - -// 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_Attestator) Type() protoreflect.MessageType { - return _fastReflection_Attestator_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Attestator) New() protoreflect.Message { - return new(fastReflection_Attestator) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Attestator) Interface() protoreflect.ProtoMessage { - return (*Attestator)(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_Attestator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.AttestatorId) != 0 { - value := protoreflect.ValueOfBytes(x.AttestatorId) - if !f(fd_Attestator_attestator_id, value) { - return - } - } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Attestator_public_key, value) { - return - } - } - if x.ConsensusPubkey != nil { - value := protoreflect.ValueOfMessage(x.ConsensusPubkey.ProtoReflect()) - if !f(fd_Attestator_consensus_pubkey, 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_Attestator) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.Attestator.attestator_id": - return len(x.AttestatorId) != 0 - case "configmodule.v1.Attestator.public_key": - return x.PublicKey != nil - case "configmodule.v1.Attestator.consensus_pubkey": - return x.ConsensusPubkey != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.Attestator.attestator_id": - x.AttestatorId = nil - case "configmodule.v1.Attestator.public_key": - x.PublicKey = nil - case "configmodule.v1.Attestator.consensus_pubkey": - x.ConsensusPubkey = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.Attestator.attestator_id": - value := x.AttestatorId - return protoreflect.ValueOfBytes(value) - case "configmodule.v1.Attestator.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "configmodule.v1.Attestator.consensus_pubkey": - value := x.ConsensusPubkey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.Attestator.attestator_id": - x.AttestatorId = value.Bytes() - case "configmodule.v1.Attestator.public_key": - x.PublicKey = value.Message().Interface().(*anypb.Any) - case "configmodule.v1.Attestator.consensus_pubkey": - x.ConsensusPubkey = value.Message().Interface().(*anypb.Any) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.Attestator.public_key": - if x.PublicKey == nil { - x.PublicKey = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "configmodule.v1.Attestator.consensus_pubkey": - if x.ConsensusPubkey == nil { - x.ConsensusPubkey = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.ConsensusPubkey.ProtoReflect()) - case "configmodule.v1.Attestator.attestator_id": - panic(fmt.Errorf("field attestator_id of message configmodule.v1.Attestator is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.Attestator.attestator_id": - return protoreflect.ValueOfBytes(nil) - case "configmodule.v1.Attestator.public_key": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "configmodule.v1.Attestator.consensus_pubkey": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.Attestator")) - } - panic(fmt.Errorf("message configmodule.v1.Attestator 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_Attestator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.Attestator", 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_Attestator) 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_Attestator) 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_Attestator) 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_Attestator) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Attestator) - 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.AttestatorId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ConsensusPubkey != nil { - l = options.Size(x.ConsensusPubkey) - 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().(*Attestator) - 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.ConsensusPubkey != nil { - encoded, err := options.Marshal(x.ConsensusPubkey) - 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] = 0x1a - } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - 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.AttestatorId) > 0 { - i -= len(x.AttestatorId) - copy(dAtA[i:], x.AttestatorId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestatorId))) - 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().(*Attestator) - 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: Attestator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Attestator: 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 AttestatorId", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.AttestatorId = append(x.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if x.AttestatorId == nil { - x.AttestatorId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", 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.PublicKey == nil { - x.PublicKey = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); 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 ConsensusPubkey", 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.ConsensusPubkey == nil { - x.ConsensusPubkey = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ConsensusPubkey); 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: configmodule/v1/attestator.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 Attestator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AttestatorId []byte `protobuf:"bytes,1,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` - PublicKey *anypb.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - ConsensusPubkey *anypb.Any `protobuf:"bytes,3,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` -} - -func (x *Attestator) Reset() { - *x = Attestator{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_attestator_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Attestator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Attestator) ProtoMessage() {} - -// Deprecated: Use Attestator.ProtoReflect.Descriptor instead. -func (*Attestator) Descriptor() ([]byte, []int) { - return file_configmodule_v1_attestator_proto_rawDescGZIP(), []int{0} -} - -func (x *Attestator) GetAttestatorId() []byte { - if x != nil { - return x.AttestatorId - } - return nil -} - -func (x *Attestator) GetPublicKey() *anypb.Any { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Attestator) GetConsensusPubkey() *anypb.Any { - if x != nil { - return x.ConsensusPubkey - } - return nil -} - -var File_configmodule_v1_attestator_proto protoreflect.FileDescriptor - -var file_configmodule_v1_attestator_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x01, 0x0a, 0x0a, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x4d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x59, 0x0a, 0x10, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x42, 0xb4, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, - 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_configmodule_v1_attestator_proto_rawDescOnce sync.Once - file_configmodule_v1_attestator_proto_rawDescData = file_configmodule_v1_attestator_proto_rawDesc -) - -func file_configmodule_v1_attestator_proto_rawDescGZIP() []byte { - file_configmodule_v1_attestator_proto_rawDescOnce.Do(func() { - file_configmodule_v1_attestator_proto_rawDescData = protoimpl.X.CompressGZIP(file_configmodule_v1_attestator_proto_rawDescData) - }) - return file_configmodule_v1_attestator_proto_rawDescData -} - -var file_configmodule_v1_attestator_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_configmodule_v1_attestator_proto_goTypes = []interface{}{ - (*Attestator)(nil), // 0: configmodule.v1.Attestator - (*anypb.Any)(nil), // 1: google.protobuf.Any -} -var file_configmodule_v1_attestator_proto_depIdxs = []int32{ - 1, // 0: configmodule.v1.Attestator.public_key:type_name -> google.protobuf.Any - 1, // 1: configmodule.v1.Attestator.consensus_pubkey:type_name -> google.protobuf.Any - 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_configmodule_v1_attestator_proto_init() } -func file_configmodule_v1_attestator_proto_init() { - if File_configmodule_v1_attestator_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_configmodule_v1_attestator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Attestator); 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_configmodule_v1_attestator_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_configmodule_v1_attestator_proto_goTypes, - DependencyIndexes: file_configmodule_v1_attestator_proto_depIdxs, - MessageInfos: file_configmodule_v1_attestator_proto_msgTypes, - }.Build() - File_configmodule_v1_attestator_proto = out.File - file_configmodule_v1_attestator_proto_rawDesc = nil - file_configmodule_v1_attestator_proto_goTypes = nil - file_configmodule_v1_attestator_proto_depIdxs = nil -} diff --git a/configmodule/api/configmodule/v1/genesis.pulsar.go b/configmodule/api/configmodule/v1/genesis.pulsar.go index 8ecae3a..2f80f58 100644 --- a/configmodule/api/configmodule/v1/genesis.pulsar.go +++ b/configmodule/api/configmodule/v1/genesis.pulsar.go @@ -14,68 +14,15 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_GenesisState_2_list)(nil) - -type _GenesisState_2_list struct { - list *[]*Attestator -} - -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().(*Attestator) - (*x.list)[i] = concreteValue -} - -func (x *_GenesisState_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Attestator) - *x.list = append(*x.list, concreteValue) -} - -func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { - v := new(Attestator) - *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(Attestator) - 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 - fd_GenesisState_attestators protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor ) func init() { file_configmodule_v1_genesis_proto_init() md_GenesisState = File_configmodule_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") - fd_GenesisState_attestators = md_GenesisState.Fields().ByName("attestators") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -149,12 +96,6 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } - if len(x.Attestators) != 0 { - value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Attestators}) - if !f(fd_GenesisState_attestators, value) { - return - } - } } // Has reports whether a field is populated. @@ -172,8 +113,6 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "configmodule.v1.GenesisState.params": return x.Params != nil - case "configmodule.v1.GenesisState.attestators": - return len(x.Attestators) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -192,8 +131,6 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "configmodule.v1.GenesisState.params": x.Params = nil - case "configmodule.v1.GenesisState.attestators": - x.Attestators = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -213,12 +150,6 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "configmodule.v1.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "configmodule.v1.GenesisState.attestators": - if len(x.Attestators) == 0 { - return protoreflect.ValueOfList(&_GenesisState_2_list{}) - } - listValue := &_GenesisState_2_list{list: &x.Attestators} - return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -241,10 +172,6 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "configmodule.v1.GenesisState.params": x.Params = value.Message().Interface().(*Params) - case "configmodule.v1.GenesisState.attestators": - lv := value.List() - clv := lv.(*_GenesisState_2_list) - x.Attestators = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -270,12 +197,6 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "configmodule.v1.GenesisState.attestators": - if x.Attestators == nil { - x.Attestators = []*Attestator{} - } - value := &_GenesisState_2_list{list: &x.Attestators} - return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -292,9 +213,6 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "configmodule.v1.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "configmodule.v1.GenesisState.attestators": - list := []*Attestator{} - return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.GenesisState")) @@ -368,12 +286,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Attestators) > 0 { - for _, e := range x.Attestators { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -403,22 +315,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Attestators) > 0 { - for iNdEx := len(x.Attestators) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Attestators[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 { @@ -518,40 +414,6 @@ 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 Attestators", 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.Attestators = append(x.Attestators, &Attestator{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Attestators[len(x.Attestators)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -607,8 +469,7 @@ type GenesisState struct { unknownFields protoimpl.UnknownFields // params defines all the paramaters of configmodule module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - Attestators []*Attestator `protobuf:"bytes,2,rep,name=attestators,proto3" json:"attestators,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (x *GenesisState) Reset() { @@ -638,13 +499,6 @@ func (x *GenesisState) GetParams() *Params { return nil } -func (x *GenesisState) GetAttestators() []*Attestator { - if x != nil { - return x.Attestators - } - return nil -} - var File_configmodule_v1_genesis_proto protoreflect.FileDescriptor var file_configmodule_v1_genesis_proto_rawDesc = []byte{ @@ -655,30 +509,23 @@ var file_configmodule_v1_genesis_proto_rawDesc = []byte{ 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, 0x1c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x47, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x42, 0xb1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3f, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -697,16 +544,14 @@ var file_configmodule_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, var file_configmodule_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: configmodule.v1.GenesisState (*Params)(nil), // 1: configmodule.v1.Params - (*Attestator)(nil), // 2: configmodule.v1.Attestator } var file_configmodule_v1_genesis_proto_depIdxs = []int32{ 1, // 0: configmodule.v1.GenesisState.params:type_name -> configmodule.v1.Params - 2, // 1: configmodule.v1.GenesisState.attestators:type_name -> configmodule.v1.Attestator - 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 + 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_configmodule_v1_genesis_proto_init() } @@ -715,7 +560,6 @@ func file_configmodule_v1_genesis_proto_init() { return } file_configmodule_v1_params_proto_init() - file_configmodule_v1_attestator_proto_init() if !protoimpl.UnsafeEnabled { file_configmodule_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/configmodule/api/configmodule/v1/query.pulsar.go b/configmodule/api/configmodule/v1/query.pulsar.go index 1c35e61..58cb2b3 100644 --- a/configmodule/api/configmodule/v1/query.pulsar.go +++ b/configmodule/api/configmodule/v1/query.pulsar.go @@ -3,7 +3,7 @@ package configmodulev1 import ( _ "cosmossdk.io/api/amino" - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -807,1871 +807,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_QueryAttestatorRequest protoreflect.MessageDescriptor - fd_QueryAttestatorRequest_attestator_id protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_query_proto_init() - md_QueryAttestatorRequest = File_configmodule_v1_query_proto.Messages().ByName("QueryAttestatorRequest") - fd_QueryAttestatorRequest_attestator_id = md_QueryAttestatorRequest.Fields().ByName("attestator_id") -} - -var _ protoreflect.Message = (*fastReflection_QueryAttestatorRequest)(nil) - -type fastReflection_QueryAttestatorRequest QueryAttestatorRequest - -func (x *QueryAttestatorRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAttestatorRequest)(x) -} - -func (x *QueryAttestatorRequest) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_query_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_QueryAttestatorRequest_messageType fastReflection_QueryAttestatorRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAttestatorRequest_messageType{} - -type fastReflection_QueryAttestatorRequest_messageType struct{} - -func (x fastReflection_QueryAttestatorRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAttestatorRequest)(nil) -} -func (x fastReflection_QueryAttestatorRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorRequest) -} -func (x fastReflection_QueryAttestatorRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAttestatorRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorRequest -} - -// 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_QueryAttestatorRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAttestatorRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAttestatorRequest) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAttestatorRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAttestatorRequest)(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_QueryAttestatorRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.AttestatorId) != 0 { - value := protoreflect.ValueOfBytes(x.AttestatorId) - if !f(fd_QueryAttestatorRequest_attestator_id, 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_QueryAttestatorRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - return len(x.AttestatorId) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - x.AttestatorId = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - value := x.AttestatorId - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - x.AttestatorId = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - panic(fmt.Errorf("field attestator_id of message configmodule.v1.QueryAttestatorRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorRequest.attestator_id": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorRequest 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_QueryAttestatorRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.QueryAttestatorRequest", 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_QueryAttestatorRequest) 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_QueryAttestatorRequest) 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_QueryAttestatorRequest) 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_QueryAttestatorRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAttestatorRequest) - 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.AttestatorId) - 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().(*QueryAttestatorRequest) - 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.AttestatorId) > 0 { - i -= len(x.AttestatorId) - copy(dAtA[i:], x.AttestatorId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestatorId))) - 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().(*QueryAttestatorRequest) - 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: QueryAttestatorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAttestatorRequest: 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 AttestatorId", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.AttestatorId = append(x.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if x.AttestatorId == nil { - x.AttestatorId = []byte{} - } - 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_QueryAttestatorResponse protoreflect.MessageDescriptor - fd_QueryAttestatorResponse_attestator protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_query_proto_init() - md_QueryAttestatorResponse = File_configmodule_v1_query_proto.Messages().ByName("QueryAttestatorResponse") - fd_QueryAttestatorResponse_attestator = md_QueryAttestatorResponse.Fields().ByName("attestator") -} - -var _ protoreflect.Message = (*fastReflection_QueryAttestatorResponse)(nil) - -type fastReflection_QueryAttestatorResponse QueryAttestatorResponse - -func (x *QueryAttestatorResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAttestatorResponse)(x) -} - -func (x *QueryAttestatorResponse) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAttestatorResponse_messageType fastReflection_QueryAttestatorResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAttestatorResponse_messageType{} - -type fastReflection_QueryAttestatorResponse_messageType struct{} - -func (x fastReflection_QueryAttestatorResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAttestatorResponse)(nil) -} -func (x fastReflection_QueryAttestatorResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorResponse) -} -func (x fastReflection_QueryAttestatorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAttestatorResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorResponse -} - -// 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_QueryAttestatorResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAttestatorResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAttestatorResponse) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAttestatorResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAttestatorResponse)(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_QueryAttestatorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Attestator != nil { - value := protoreflect.ValueOfMessage(x.Attestator.ProtoReflect()) - if !f(fd_QueryAttestatorResponse_attestator, 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_QueryAttestatorResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - return x.Attestator != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - x.Attestator = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - value := x.Attestator - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - x.Attestator = value.Message().Interface().(*Attestator) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - if x.Attestator == nil { - x.Attestator = new(Attestator) - } - return protoreflect.ValueOfMessage(x.Attestator.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorResponse.attestator": - m := new(Attestator) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorResponse 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_QueryAttestatorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.QueryAttestatorResponse", 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_QueryAttestatorResponse) 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_QueryAttestatorResponse) 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_QueryAttestatorResponse) 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_QueryAttestatorResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAttestatorResponse) - 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.Attestator != nil { - l = options.Size(x.Attestator) - 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().(*QueryAttestatorResponse) - 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.Attestator != nil { - encoded, err := options.Marshal(x.Attestator) - 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().(*QueryAttestatorResponse) - 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: QueryAttestatorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAttestatorResponse: 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 Attestator", 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.Attestator == nil { - x.Attestator = &Attestator{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Attestator); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryAttestatorsRequest protoreflect.MessageDescriptor - fd_QueryAttestatorsRequest_pagination protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_query_proto_init() - md_QueryAttestatorsRequest = File_configmodule_v1_query_proto.Messages().ByName("QueryAttestatorsRequest") - fd_QueryAttestatorsRequest_pagination = md_QueryAttestatorsRequest.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_QueryAttestatorsRequest)(nil) - -type fastReflection_QueryAttestatorsRequest QueryAttestatorsRequest - -func (x *QueryAttestatorsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAttestatorsRequest)(x) -} - -func (x *QueryAttestatorsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_query_proto_msgTypes[4] - 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_QueryAttestatorsRequest_messageType fastReflection_QueryAttestatorsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAttestatorsRequest_messageType{} - -type fastReflection_QueryAttestatorsRequest_messageType struct{} - -func (x fastReflection_QueryAttestatorsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAttestatorsRequest)(nil) -} -func (x fastReflection_QueryAttestatorsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorsRequest) -} -func (x fastReflection_QueryAttestatorsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAttestatorsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorsRequest -} - -// 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_QueryAttestatorsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAttestatorsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAttestatorsRequest) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAttestatorsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAttestatorsRequest)(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_QueryAttestatorsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAttestatorsRequest_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_QueryAttestatorsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.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: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsRequest.pagination": - m := new(v1beta1.PageRequest) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsRequest")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsRequest 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_QueryAttestatorsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.QueryAttestatorsRequest", 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_QueryAttestatorsRequest) 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_QueryAttestatorsRequest) 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_QueryAttestatorsRequest) 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_QueryAttestatorsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAttestatorsRequest) - 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().(*QueryAttestatorsRequest) - 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().(*QueryAttestatorsRequest) - 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: QueryAttestatorsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAttestatorsRequest: 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 = (*_QueryAttestatorsResponse_1_list)(nil) - -type _QueryAttestatorsResponse_1_list struct { - list *[]*Attestator -} - -func (x *_QueryAttestatorsResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryAttestatorsResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryAttestatorsResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Attestator) - (*x.list)[i] = concreteValue -} - -func (x *_QueryAttestatorsResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Attestator) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryAttestatorsResponse_1_list) AppendMutable() protoreflect.Value { - v := new(Attestator) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryAttestatorsResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryAttestatorsResponse_1_list) NewElement() protoreflect.Value { - v := new(Attestator) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryAttestatorsResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryAttestatorsResponse protoreflect.MessageDescriptor - fd_QueryAttestatorsResponse_attestators protoreflect.FieldDescriptor - fd_QueryAttestatorsResponse_pagination protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_query_proto_init() - md_QueryAttestatorsResponse = File_configmodule_v1_query_proto.Messages().ByName("QueryAttestatorsResponse") - fd_QueryAttestatorsResponse_attestators = md_QueryAttestatorsResponse.Fields().ByName("attestators") - fd_QueryAttestatorsResponse_pagination = md_QueryAttestatorsResponse.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_QueryAttestatorsResponse)(nil) - -type fastReflection_QueryAttestatorsResponse QueryAttestatorsResponse - -func (x *QueryAttestatorsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAttestatorsResponse)(x) -} - -func (x *QueryAttestatorsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_query_proto_msgTypes[5] - 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_QueryAttestatorsResponse_messageType fastReflection_QueryAttestatorsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAttestatorsResponse_messageType{} - -type fastReflection_QueryAttestatorsResponse_messageType struct{} - -func (x fastReflection_QueryAttestatorsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAttestatorsResponse)(nil) -} -func (x fastReflection_QueryAttestatorsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorsResponse) -} -func (x fastReflection_QueryAttestatorsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAttestatorsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAttestatorsResponse -} - -// 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_QueryAttestatorsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAttestatorsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAttestatorsResponse) New() protoreflect.Message { - return new(fastReflection_QueryAttestatorsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAttestatorsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAttestatorsResponse)(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_QueryAttestatorsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Attestators) != 0 { - value := protoreflect.ValueOfList(&_QueryAttestatorsResponse_1_list{list: &x.Attestators}) - if !f(fd_QueryAttestatorsResponse_attestators, value) { - return - } - } - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAttestatorsResponse_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_QueryAttestatorsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - return len(x.Attestators) != 0 - case "configmodule.v1.QueryAttestatorsResponse.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - x.Attestators = nil - case "configmodule.v1.QueryAttestatorsResponse.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - if len(x.Attestators) == 0 { - return protoreflect.ValueOfList(&_QueryAttestatorsResponse_1_list{}) - } - listValue := &_QueryAttestatorsResponse_1_list{list: &x.Attestators} - return protoreflect.ValueOfList(listValue) - case "configmodule.v1.QueryAttestatorsResponse.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - lv := value.List() - clv := lv.(*_QueryAttestatorsResponse_1_list) - x.Attestators = *clv.list - case "configmodule.v1.QueryAttestatorsResponse.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - if x.Attestators == nil { - x.Attestators = []*Attestator{} - } - value := &_QueryAttestatorsResponse_1_list{list: &x.Attestators} - return protoreflect.ValueOfList(value) - case "configmodule.v1.QueryAttestatorsResponse.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: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.QueryAttestatorsResponse.attestators": - list := []*Attestator{} - return protoreflect.ValueOfList(&_QueryAttestatorsResponse_1_list{list: &list}) - case "configmodule.v1.QueryAttestatorsResponse.pagination": - m := new(v1beta1.PageResponse) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.QueryAttestatorsResponse")) - } - panic(fmt.Errorf("message configmodule.v1.QueryAttestatorsResponse 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_QueryAttestatorsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.QueryAttestatorsResponse", 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_QueryAttestatorsResponse) 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_QueryAttestatorsResponse) 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_QueryAttestatorsResponse) 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_QueryAttestatorsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAttestatorsResponse) - 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.Attestators) > 0 { - for _, e := range x.Attestators { - 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().(*QueryAttestatorsResponse) - 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.Attestators) > 0 { - for iNdEx := len(x.Attestators) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Attestators[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().(*QueryAttestatorsResponse) - 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: QueryAttestatorsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAttestatorsResponse: 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 Attestators", 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.Attestators = append(x.Attestators, &Attestator{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Attestators[len(x.Attestators)-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 @@ -2749,155 +884,6 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -type QueryAttestatorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AttestatorId []byte `protobuf:"bytes,1,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` -} - -func (x *QueryAttestatorRequest) Reset() { - *x = QueryAttestatorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAttestatorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAttestatorRequest) ProtoMessage() {} - -// Deprecated: Use QueryAttestatorRequest.ProtoReflect.Descriptor instead. -func (*QueryAttestatorRequest) Descriptor() ([]byte, []int) { - return file_configmodule_v1_query_proto_rawDescGZIP(), []int{2} -} - -func (x *QueryAttestatorRequest) GetAttestatorId() []byte { - if x != nil { - return x.AttestatorId - } - return nil -} - -type QueryAttestatorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Attestator *Attestator `protobuf:"bytes,1,opt,name=attestator,proto3" json:"attestator,omitempty"` -} - -func (x *QueryAttestatorResponse) Reset() { - *x = QueryAttestatorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAttestatorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAttestatorResponse) ProtoMessage() {} - -// Deprecated: Use QueryAttestatorResponse.ProtoReflect.Descriptor instead. -func (*QueryAttestatorResponse) Descriptor() ([]byte, []int) { - return file_configmodule_v1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryAttestatorResponse) GetAttestator() *Attestator { - if x != nil { - return x.Attestator - } - return nil -} - -type QueryAttestatorsRequest 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 *QueryAttestatorsRequest) Reset() { - *x = QueryAttestatorsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAttestatorsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAttestatorsRequest) ProtoMessage() {} - -// Deprecated: Use QueryAttestatorsRequest.ProtoReflect.Descriptor instead. -func (*QueryAttestatorsRequest) Descriptor() ([]byte, []int) { - return file_configmodule_v1_query_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryAttestatorsRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type QueryAttestatorsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Attestators []*Attestator `protobuf:"bytes,1,rep,name=attestators,proto3" json:"attestators,omitempty"` - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *QueryAttestatorsResponse) Reset() { - *x = QueryAttestatorsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAttestatorsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAttestatorsResponse) ProtoMessage() {} - -// Deprecated: Use QueryAttestatorsResponse.ProtoReflect.Descriptor instead. -func (*QueryAttestatorsResponse) Descriptor() ([]byte, []int) { - return file_configmodule_v1_query_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryAttestatorsResponse) GetAttestators() []*Attestator { - if x != nil { - return x.Attestators - } - return nil -} - -func (x *QueryAttestatorsResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - var File_configmodule_v1_query_proto protoreflect.FileDescriptor var file_configmodule_v1_query_proto_rawDesc = []byte{ @@ -2910,83 +896,36 @@ var file_configmodule_v1_query_proto_rawDesc = []byte{ 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 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, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, 0x0a, 0x16, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x17, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x0a, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x61, 0x0a, 0x17, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 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, - 0xad, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x6f, 0x72, 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, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x74, 0x0a, 0x06, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x88, 0x01, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, - 0x28, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x0a, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x2f, 0x7b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, - 0x64, 0x7d, 0x42, 0xaf, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, - 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x7d, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x74, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xaf, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -3001,36 +940,21 @@ func file_configmodule_v1_query_proto_rawDescGZIP() []byte { return file_configmodule_v1_query_proto_rawDescData } -var file_configmodule_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_configmodule_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_configmodule_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: configmodule.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: configmodule.v1.QueryParamsResponse - (*QueryAttestatorRequest)(nil), // 2: configmodule.v1.QueryAttestatorRequest - (*QueryAttestatorResponse)(nil), // 3: configmodule.v1.QueryAttestatorResponse - (*QueryAttestatorsRequest)(nil), // 4: configmodule.v1.QueryAttestatorsRequest - (*QueryAttestatorsResponse)(nil), // 5: configmodule.v1.QueryAttestatorsResponse - (*Params)(nil), // 6: configmodule.v1.Params - (*Attestator)(nil), // 7: configmodule.v1.Attestator - (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse + (*QueryParamsRequest)(nil), // 0: configmodule.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: configmodule.v1.QueryParamsResponse + (*Params)(nil), // 2: configmodule.v1.Params } var file_configmodule_v1_query_proto_depIdxs = []int32{ - 6, // 0: configmodule.v1.QueryParamsResponse.params:type_name -> configmodule.v1.Params - 7, // 1: configmodule.v1.QueryAttestatorResponse.attestator:type_name -> configmodule.v1.Attestator - 8, // 2: configmodule.v1.QueryAttestatorsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 3: configmodule.v1.QueryAttestatorsResponse.attestators:type_name -> configmodule.v1.Attestator - 9, // 4: configmodule.v1.QueryAttestatorsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 0, // 5: configmodule.v1.Query.Params:input_type -> configmodule.v1.QueryParamsRequest - 4, // 6: configmodule.v1.Query.Attestators:input_type -> configmodule.v1.QueryAttestatorsRequest - 2, // 7: configmodule.v1.Query.Attestator:input_type -> configmodule.v1.QueryAttestatorRequest - 1, // 8: configmodule.v1.Query.Params:output_type -> configmodule.v1.QueryParamsResponse - 5, // 9: configmodule.v1.Query.Attestators:output_type -> configmodule.v1.QueryAttestatorsResponse - 3, // 10: configmodule.v1.Query.Attestator:output_type -> configmodule.v1.QueryAttestatorResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 2, // 0: configmodule.v1.QueryParamsResponse.params:type_name -> configmodule.v1.Params + 0, // 1: configmodule.v1.Query.Params:input_type -> configmodule.v1.QueryParamsRequest + 1, // 2: configmodule.v1.Query.Params:output_type -> configmodule.v1.QueryParamsResponse + 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_configmodule_v1_query_proto_init() } @@ -3039,7 +963,6 @@ func file_configmodule_v1_query_proto_init() { return } file_configmodule_v1_params_proto_init() - file_configmodule_v1_attestator_proto_init() if !protoimpl.UnsafeEnabled { file_configmodule_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -3065,54 +988,6 @@ func file_configmodule_v1_query_proto_init() { return nil } } - file_configmodule_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAttestatorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_configmodule_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAttestatorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_configmodule_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAttestatorsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_configmodule_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAttestatorsResponse); 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{ @@ -3120,7 +995,7 @@ func file_configmodule_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_configmodule_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/configmodule/api/configmodule/v1/query_grpc.pb.go b/configmodule/api/configmodule/v1/query_grpc.pb.go index 1e32aab..7bdbbc7 100644 --- a/configmodule/api/configmodule/v1/query_grpc.pb.go +++ b/configmodule/api/configmodule/v1/query_grpc.pb.go @@ -19,9 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/configmodule.v1.Query/Params" - Query_Attestators_FullMethodName = "/configmodule.v1.Query/Attestators" - Query_Attestator_FullMethodName = "/configmodule.v1.Query/Attestator" + Query_Params_FullMethodName = "/configmodule.v1.Query/Params" ) // QueryClient is the client API for Query service. @@ -30,8 +28,6 @@ const ( type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - Attestators(ctx context.Context, in *QueryAttestatorsRequest, opts ...grpc.CallOption) (*QueryAttestatorsResponse, error) - Attestator(ctx context.Context, in *QueryAttestatorRequest, opts ...grpc.CallOption) (*QueryAttestatorResponse, error) } type queryClient struct { @@ -51,32 +47,12 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) Attestators(ctx context.Context, in *QueryAttestatorsRequest, opts ...grpc.CallOption) (*QueryAttestatorsResponse, error) { - out := new(QueryAttestatorsResponse) - err := c.cc.Invoke(ctx, Query_Attestators_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Attestator(ctx context.Context, in *QueryAttestatorRequest, opts ...grpc.CallOption) (*QueryAttestatorResponse, error) { - out := new(QueryAttestatorResponse) - err := c.cc.Invoke(ctx, Query_Attestator_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 { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - Attestators(context.Context, *QueryAttestatorsRequest) (*QueryAttestatorsResponse, error) - Attestator(context.Context, *QueryAttestatorRequest) (*QueryAttestatorResponse, error) mustEmbedUnimplementedQueryServer() } @@ -87,12 +63,6 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) Attestators(context.Context, *QueryAttestatorsRequest) (*QueryAttestatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Attestators not implemented") -} -func (UnimplementedQueryServer) Attestator(context.Context, *QueryAttestatorRequest) (*QueryAttestatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Attestator not implemented") -} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -124,42 +94,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Attestators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAttestatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Attestators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Attestators_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Attestators(ctx, req.(*QueryAttestatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Attestator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAttestatorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Attestator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Attestator_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Attestator(ctx, req.(*QueryAttestatorRequest)) - } - 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) @@ -171,14 +105,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Attestators", - Handler: _Query_Attestators_Handler, - }, - { - MethodName: "Attestator", - Handler: _Query_Attestator_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "configmodule/v1/query.proto", diff --git a/configmodule/api/configmodule/v1/tx.pulsar.go b/configmodule/api/configmodule/v1/tx.pulsar.go index e2fb319..0875515 100644 --- a/configmodule/api/configmodule/v1/tx.pulsar.go +++ b/configmodule/api/configmodule/v1/tx.pulsar.go @@ -11,7 +11,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" + _ "google.golang.org/protobuf/types/known/anypb" io "io" reflect "reflect" sync "sync" @@ -872,927 +872,6 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } -var ( - md_MsgRegisterAttestator protoreflect.MessageDescriptor - fd_MsgRegisterAttestator_validator_address protoreflect.FieldDescriptor - fd_MsgRegisterAttestator_attestator_id protoreflect.FieldDescriptor - fd_MsgRegisterAttestator_attestation_public_key protoreflect.FieldDescriptor -) - -func init() { - file_configmodule_v1_tx_proto_init() - md_MsgRegisterAttestator = File_configmodule_v1_tx_proto.Messages().ByName("MsgRegisterAttestator") - fd_MsgRegisterAttestator_validator_address = md_MsgRegisterAttestator.Fields().ByName("validator_address") - fd_MsgRegisterAttestator_attestator_id = md_MsgRegisterAttestator.Fields().ByName("attestator_id") - fd_MsgRegisterAttestator_attestation_public_key = md_MsgRegisterAttestator.Fields().ByName("attestation_public_key") -} - -var _ protoreflect.Message = (*fastReflection_MsgRegisterAttestator)(nil) - -type fastReflection_MsgRegisterAttestator MsgRegisterAttestator - -func (x *MsgRegisterAttestator) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegisterAttestator)(x) -} - -func (x *MsgRegisterAttestator) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_tx_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRegisterAttestator_messageType fastReflection_MsgRegisterAttestator_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegisterAttestator_messageType{} - -type fastReflection_MsgRegisterAttestator_messageType struct{} - -func (x fastReflection_MsgRegisterAttestator_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegisterAttestator)(nil) -} -func (x fastReflection_MsgRegisterAttestator_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegisterAttestator) -} -func (x fastReflection_MsgRegisterAttestator_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterAttestator -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRegisterAttestator) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterAttestator -} - -// 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_MsgRegisterAttestator) Type() protoreflect.MessageType { - return _fastReflection_MsgRegisterAttestator_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegisterAttestator) New() protoreflect.Message { - return new(fastReflection_MsgRegisterAttestator) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegisterAttestator) Interface() protoreflect.ProtoMessage { - return (*MsgRegisterAttestator)(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_MsgRegisterAttestator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ValidatorAddress != "" { - value := protoreflect.ValueOfString(x.ValidatorAddress) - if !f(fd_MsgRegisterAttestator_validator_address, value) { - return - } - } - if len(x.AttestatorId) != 0 { - value := protoreflect.ValueOfBytes(x.AttestatorId) - if !f(fd_MsgRegisterAttestator_attestator_id, value) { - return - } - } - if x.AttestationPublicKey != nil { - value := protoreflect.ValueOfMessage(x.AttestationPublicKey.ProtoReflect()) - if !f(fd_MsgRegisterAttestator_attestation_public_key, 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_MsgRegisterAttestator) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "configmodule.v1.MsgRegisterAttestator.validator_address": - return x.ValidatorAddress != "" - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - return len(x.AttestatorId) != 0 - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - return x.AttestationPublicKey != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "configmodule.v1.MsgRegisterAttestator.validator_address": - x.ValidatorAddress = "" - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - x.AttestatorId = nil - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - x.AttestationPublicKey = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "configmodule.v1.MsgRegisterAttestator.validator_address": - value := x.ValidatorAddress - return protoreflect.ValueOfString(value) - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - value := x.AttestatorId - return protoreflect.ValueOfBytes(value) - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - value := x.AttestationPublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "configmodule.v1.MsgRegisterAttestator.validator_address": - x.ValidatorAddress = value.Interface().(string) - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - x.AttestatorId = value.Bytes() - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - x.AttestationPublicKey = value.Message().Interface().(*anypb.Any) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - if x.AttestationPublicKey == nil { - x.AttestationPublicKey = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.AttestationPublicKey.ProtoReflect()) - case "configmodule.v1.MsgRegisterAttestator.validator_address": - panic(fmt.Errorf("field validator_address of message configmodule.v1.MsgRegisterAttestator is not mutable")) - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - panic(fmt.Errorf("field attestator_id of message configmodule.v1.MsgRegisterAttestator is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "configmodule.v1.MsgRegisterAttestator.validator_address": - return protoreflect.ValueOfString("") - case "configmodule.v1.MsgRegisterAttestator.attestator_id": - return protoreflect.ValueOfBytes(nil) - case "configmodule.v1.MsgRegisterAttestator.attestation_public_key": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestator")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestator 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_MsgRegisterAttestator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.MsgRegisterAttestator", 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_MsgRegisterAttestator) 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_MsgRegisterAttestator) 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_MsgRegisterAttestator) 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_MsgRegisterAttestator) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegisterAttestator) - 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.ValidatorAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.AttestatorId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.AttestationPublicKey != nil { - l = options.Size(x.AttestationPublicKey) - 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().(*MsgRegisterAttestator) - 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.AttestationPublicKey != nil { - encoded, err := options.Marshal(x.AttestationPublicKey) - 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] = 0x1a - } - if len(x.AttestatorId) > 0 { - i -= len(x.AttestatorId) - copy(dAtA[i:], x.AttestatorId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestatorId))) - i-- - dAtA[i] = 0x12 - } - if len(x.ValidatorAddress) > 0 { - i -= len(x.ValidatorAddress) - copy(dAtA[i:], x.ValidatorAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) - 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().(*MsgRegisterAttestator) - 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: MsgRegisterAttestator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterAttestator: 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 ValidatorAddress", 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.ValidatorAddress = 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 AttestatorId", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.AttestatorId = append(x.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if x.AttestatorId == nil { - x.AttestatorId = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationPublicKey", 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.AttestationPublicKey == nil { - x.AttestationPublicKey = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AttestationPublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgRegisterAttestatorResponse protoreflect.MessageDescriptor -) - -func init() { - file_configmodule_v1_tx_proto_init() - md_MsgRegisterAttestatorResponse = File_configmodule_v1_tx_proto.Messages().ByName("MsgRegisterAttestatorResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgRegisterAttestatorResponse)(nil) - -type fastReflection_MsgRegisterAttestatorResponse MsgRegisterAttestatorResponse - -func (x *MsgRegisterAttestatorResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegisterAttestatorResponse)(x) -} - -func (x *MsgRegisterAttestatorResponse) slowProtoReflect() protoreflect.Message { - mi := &file_configmodule_v1_tx_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRegisterAttestatorResponse_messageType fastReflection_MsgRegisterAttestatorResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegisterAttestatorResponse_messageType{} - -type fastReflection_MsgRegisterAttestatorResponse_messageType struct{} - -func (x fastReflection_MsgRegisterAttestatorResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegisterAttestatorResponse)(nil) -} -func (x fastReflection_MsgRegisterAttestatorResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegisterAttestatorResponse) -} -func (x fastReflection_MsgRegisterAttestatorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterAttestatorResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRegisterAttestatorResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterAttestatorResponse -} - -// 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_MsgRegisterAttestatorResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgRegisterAttestatorResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegisterAttestatorResponse) New() protoreflect.Message { - return new(fastReflection_MsgRegisterAttestatorResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegisterAttestatorResponse) Interface() protoreflect.ProtoMessage { - return (*MsgRegisterAttestatorResponse)(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_MsgRegisterAttestatorResponse) 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_MsgRegisterAttestatorResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: configmodule.v1.MsgRegisterAttestatorResponse")) - } - panic(fmt.Errorf("message configmodule.v1.MsgRegisterAttestatorResponse 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_MsgRegisterAttestatorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in configmodule.v1.MsgRegisterAttestatorResponse", 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_MsgRegisterAttestatorResponse) 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_MsgRegisterAttestatorResponse) 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_MsgRegisterAttestatorResponse) 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_MsgRegisterAttestatorResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegisterAttestatorResponse) - 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().(*MsgRegisterAttestatorResponse) - 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().(*MsgRegisterAttestatorResponse) - 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: MsgRegisterAttestatorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterAttestatorResponse: 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 @@ -1883,83 +962,6 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_configmodule_v1_tx_proto_rawDescGZIP(), []int{1} } -type MsgRegisterAttestator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - AttestatorId []byte `protobuf:"bytes,2,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` - AttestationPublicKey *anypb.Any `protobuf:"bytes,3,opt,name=attestation_public_key,json=attestationPublicKey,proto3" json:"attestation_public_key,omitempty"` -} - -func (x *MsgRegisterAttestator) Reset() { - *x = MsgRegisterAttestator{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterAttestator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterAttestator) ProtoMessage() {} - -// Deprecated: Use MsgRegisterAttestator.ProtoReflect.Descriptor instead. -func (*MsgRegisterAttestator) Descriptor() ([]byte, []int) { - return file_configmodule_v1_tx_proto_rawDescGZIP(), []int{2} -} - -func (x *MsgRegisterAttestator) GetValidatorAddress() string { - if x != nil { - return x.ValidatorAddress - } - return "" -} - -func (x *MsgRegisterAttestator) GetAttestatorId() []byte { - if x != nil { - return x.AttestatorId - } - return nil -} - -func (x *MsgRegisterAttestator) GetAttestationPublicKey() *anypb.Any { - if x != nil { - return x.AttestationPublicKey - } - return nil -} - -type MsgRegisterAttestatorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgRegisterAttestatorResponse) Reset() { - *x = MsgRegisterAttestatorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_configmodule_v1_tx_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRegisterAttestatorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRegisterAttestatorResponse) ProtoMessage() {} - -// Deprecated: Use MsgRegisterAttestatorResponse.ProtoReflect.Descriptor instead. -func (*MsgRegisterAttestatorResponse) Descriptor() ([]byte, []int) { - return file_configmodule_v1_tx_proto_rawDescGZIP(), []int{3} -} - var File_configmodule_v1_tx_proto protoreflect.FileDescriptor var file_configmodule_v1_tx_proto_rawDesc = []byte{ @@ -1975,64 +977,36 @@ var file_configmodule_v1_tx_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, - 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, - 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, - 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x64, 0x0a, 0x16, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x14, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x3a, 0x16, 0x82, 0xe7, 0xb0, - 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd6, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5a, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xac, 0x01, - 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x68, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5a, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xac, + 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2047,27 +1021,21 @@ func file_configmodule_v1_tx_proto_rawDescGZIP() []byte { return file_configmodule_v1_tx_proto_rawDescData } -var file_configmodule_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_configmodule_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_configmodule_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: configmodule.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: configmodule.v1.MsgUpdateParamsResponse - (*MsgRegisterAttestator)(nil), // 2: configmodule.v1.MsgRegisterAttestator - (*MsgRegisterAttestatorResponse)(nil), // 3: configmodule.v1.MsgRegisterAttestatorResponse - (*Params)(nil), // 4: configmodule.v1.Params - (*anypb.Any)(nil), // 5: google.protobuf.Any + (*MsgUpdateParams)(nil), // 0: configmodule.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: configmodule.v1.MsgUpdateParamsResponse + (*Params)(nil), // 2: configmodule.v1.Params } var file_configmodule_v1_tx_proto_depIdxs = []int32{ - 4, // 0: configmodule.v1.MsgUpdateParams.params:type_name -> configmodule.v1.Params - 5, // 1: configmodule.v1.MsgRegisterAttestator.attestation_public_key:type_name -> google.protobuf.Any - 0, // 2: configmodule.v1.Msg.UpdateParams:input_type -> configmodule.v1.MsgUpdateParams - 2, // 3: configmodule.v1.Msg.RegisterAttestator:input_type -> configmodule.v1.MsgRegisterAttestator - 1, // 4: configmodule.v1.Msg.UpdateParams:output_type -> configmodule.v1.MsgUpdateParamsResponse - 3, // 5: configmodule.v1.Msg.RegisterAttestator:output_type -> configmodule.v1.MsgRegisterAttestatorResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 2, // 0: configmodule.v1.MsgUpdateParams.params:type_name -> configmodule.v1.Params + 0, // 1: configmodule.v1.Msg.UpdateParams:input_type -> configmodule.v1.MsgUpdateParams + 1, // 2: configmodule.v1.Msg.UpdateParams:output_type -> configmodule.v1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_configmodule_v1_tx_proto_init() } @@ -2076,7 +1044,6 @@ func file_configmodule_v1_tx_proto_init() { return } file_configmodule_v1_params_proto_init() - file_configmodule_v1_attestator_proto_init() if !protoimpl.UnsafeEnabled { file_configmodule_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { @@ -2102,30 +1069,6 @@ func file_configmodule_v1_tx_proto_init() { return nil } } - file_configmodule_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRegisterAttestator); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_configmodule_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRegisterAttestatorResponse); 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{ @@ -2133,7 +1076,7 @@ func file_configmodule_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_configmodule_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/configmodule/api/configmodule/v1/tx_grpc.pb.go b/configmodule/api/configmodule/v1/tx_grpc.pb.go index e55b816..dae23b9 100644 --- a/configmodule/api/configmodule/v1/tx_grpc.pb.go +++ b/configmodule/api/configmodule/v1/tx_grpc.pb.go @@ -19,8 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/configmodule.v1.Msg/UpdateParams" - Msg_RegisterAttestator_FullMethodName = "/configmodule.v1.Msg/RegisterAttestator" + Msg_UpdateParams_FullMethodName = "/configmodule.v1.Msg/UpdateParams" ) // MsgClient is the client API for Msg service. @@ -30,7 +29,6 @@ type MsgClient interface { // UpdateParams defines a governance operation for updating the // configmodule module parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - RegisterAttestator(ctx context.Context, in *MsgRegisterAttestator, opts ...grpc.CallOption) (*MsgRegisterAttestatorResponse, error) } type msgClient struct { @@ -50,15 +48,6 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } -func (c *msgClient) RegisterAttestator(ctx context.Context, in *MsgRegisterAttestator, opts ...grpc.CallOption) (*MsgRegisterAttestatorResponse, error) { - out := new(MsgRegisterAttestatorResponse) - err := c.cc.Invoke(ctx, Msg_RegisterAttestator_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 @@ -66,7 +55,6 @@ type MsgServer interface { // UpdateParams defines a governance operation for updating the // configmodule module parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - RegisterAttestator(context.Context, *MsgRegisterAttestator) (*MsgRegisterAttestatorResponse, error) mustEmbedUnimplementedMsgServer() } @@ -77,9 +65,6 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func (UnimplementedMsgServer) RegisterAttestator(context.Context, *MsgRegisterAttestator) (*MsgRegisterAttestatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterAttestator not implemented") -} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -111,24 +96,6 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_RegisterAttestator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterAttestator) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterAttestator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_RegisterAttestator_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterAttestator(ctx, req.(*MsgRegisterAttestator)) - } - 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) @@ -140,10 +107,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, - { - MethodName: "RegisterAttestator", - Handler: _Msg_RegisterAttestator_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "configmodule/v1/tx.proto", diff --git a/configmodule/autocli.go b/configmodule/autocli.go index e318986..bce82de 100644 --- a/configmodule/autocli.go +++ b/configmodule/autocli.go @@ -21,17 +21,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "params", Short: "Shows the parameters of the module", }, - { - RpcMethod: "Attestators", - Use: "attestators", - Short: "Query all attestators", - }, - { - RpcMethod: "Attestator", - Use: "attestator [attestator_id]", - Short: "Query attestator by attestator id", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "attestator_id"}}, - }, }, }, Tx: &autocliv1.ServiceCommandDescriptor{ diff --git a/configmodule/client/cli/tx.go b/configmodule/client/cli/tx.go deleted file mode 100644 index 23ddb2b..0000000 --- a/configmodule/client/cli/tx.go +++ /dev/null @@ -1,96 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - - "cosmossdk.io/core/address" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/version" - - "github.com/cosmos/interchain-attestation/configmodule/types" - coretypes "github.com/cosmos/interchain-attestation/core/types" -) - -func TxCmd(valAddrCodec address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Attestation config module subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(RegisterAttestatorCmd(valAddrCodec)) - - return cmd -} - -func RegisterAttestatorCmd(valAddrCodec address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "register-attestator [path/to/attestator-registration.json]", - Short: "Register an attestator", - Long: "Register an attestator with the module by submitting a JSON file with the attestator details. See example", - Example: strings.TrimSpace( - fmt.Sprintf(` -$ %s tx %s register-attestator path/to/attestator-registration.json - -Where the JSON file contains the following: - -{ - "attestator-id": "base64encodedattestatorid", - "attestation-public-key": { - "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "base64encodedpubkey" - } -} - -The attestation-public-key should be the same as the one generated using the sidecar cli. -It is the public key that matches with the sidecar private key used to sign attestations. -`, version.AppName, types.ModuleName)), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) - if err != nil { - return err - } - - valAddr := clientCtx.GetFromAddress() - valStr, err := valAddrCodec.BytesToString(valAddr) - if err != nil { - return err - } - - attestationRegistration, err := coretypes.ParseAndValidateAttestationRegistrationJSONFromFile(clientCtx.Codec, args[0]) - if err != nil { - return err - } - - msg := &types.MsgRegisterAttestator{ - ValidatorAddress: valStr, - AttestatorId: attestationRegistration.AttestatorID, - AttestationPublicKey: attestationRegistration.AttestationPublicKey, - } - - if err := msg.Validate(valAddrCodec); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/configmodule/genesis.go b/configmodule/genesis.go index 1b18f38..e871f24 100644 --- a/configmodule/genesis.go +++ b/configmodule/genesis.go @@ -11,11 +11,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) { if err := k.Params.Set(ctx, *data.Params); err != nil { panic(err) } - for _, attestator := range data.Attestators { - if err := k.Attestators.Set(ctx, attestator.AttestatorId, attestator); err != nil { - panic(err) - } - } } func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { @@ -24,17 +19,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { panic(err) } - iterator, err := k.Attestators.Iterate(ctx, nil) - if err != nil { - panic(err) - } - attestators, err := iterator.Values() - if err != nil { - panic(err) - } - return &types.GenesisState{ - Params: ¶ms, - Attestators: attestators, + Params: ¶ms, } } diff --git a/configmodule/genesis_test.go b/configmodule/genesis_test.go index 43ae03f..9e015ca 100644 --- a/configmodule/genesis_test.go +++ b/configmodule/genesis_test.go @@ -5,25 +5,11 @@ import ( "github.com/stretchr/testify/require" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/interchain-attestation/configmodule" "github.com/cosmos/interchain-attestation/configmodule/types" ) func TestGenesis(t *testing.T) { - consPubKey := ed25519.GenPrivKey().PubKey() - require.NotNil(t, consPubKey) - consPubKeyAny, err := codectypes.NewAnyWithValue(consPubKey) - require.NoError(t, err) - - pubKey := secp256k1.GenPrivKey().PubKey() - require.NotNil(t, pubKey) - pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) - require.NoError(t, err) - testCases := []struct { name string genesis types.GenesisState @@ -37,13 +23,6 @@ func TestGenesis(t *testing.T) { name: "custom", genesis: types.GenesisState{ Params: &types.Params{}, - Attestators: []types.Attestator{ - { - AttestatorId: []byte("test-attestator-id"), - PublicKey: pubKeyAny, - ConsensusPubkey: consPubKeyAny, - }, - }, }, }, } @@ -58,19 +37,6 @@ func TestGenesis(t *testing.T) { exportedGenesis := configmodule.ExportGenesis(ctx, suite.Keeper) require.Equal(t, tc.genesis.Params, exportedGenesis.Params) - require.Len(t, tc.genesis.Attestators, len(exportedGenesis.Attestators)) - attestatorMap := make(map[string]types.Attestator) - for _, attestator := range tc.genesis.Attestators { - attestatorMap[string(attestator.AttestatorId)] = attestator - } - for _, actualAttestator := range exportedGenesis.Attestators { - foundAttestator, ok := attestatorMap[string(actualAttestator.AttestatorId)] - require.True(t, ok) - - require.Equal(t, foundAttestator.AttestatorId, actualAttestator.AttestatorId) - require.Equal(t, foundAttestator.PublicKey.GetValue(), actualAttestator.PublicKey.GetValue()) - require.Equal(t, foundAttestator.ConsensusPubkey.GetValue(), actualAttestator.ConsensusPubkey.GetValue()) - } }) } } diff --git a/configmodule/go.mod b/configmodule/go.mod index 2712a9f..30d3978 100644 --- a/configmodule/go.mod +++ b/configmodule/go.mod @@ -28,10 +28,7 @@ require ( google.golang.org/protobuf v1.34.2 ) -require ( - github.com/golang/mock v1.6.0 - github.com/spf13/cobra v1.8.1 -) +require github.com/golang/mock v1.6.0 require ( cosmossdk.io/x/tx v0.13.4 // indirect @@ -140,6 +137,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect diff --git a/configmodule/keeper/attestators_handler.go b/configmodule/keeper/attestators_handler.go index ff151e0..350e6db 100644 --- a/configmodule/keeper/attestators_handler.go +++ b/configmodule/keeper/attestators_handler.go @@ -2,9 +2,6 @@ package keeper import ( "context" - "fmt" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/interchain-attestation/core/lightclient" ) @@ -17,20 +14,7 @@ func NewAttestatorHandler(k Keeper) lightclient.AttestatorsController { return AttestatorHandler{k: k} } -func (a AttestatorHandler) GetPublicKey(ctx context.Context, attestatorId []byte) (cryptotypes.PubKey, error) { - attestator, err := a.k.Attestators.Get(ctx, attestatorId) - if err != nil { - return nil, err - } - - pk, ok := attestator.PublicKey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return nil, fmt.Errorf("invalid public key type for for attestator %s, got %T", attestatorId, pk) - } - - return pk, nil -} - +// TODO: Implement properly func (a AttestatorHandler) SufficientAttestations(ctx context.Context, attestatorIds [][]byte) (bool, error) { // TODO implement me // Just return true for now until we implement the actual logic diff --git a/configmodule/keeper/attestators_handler_test.go b/configmodule/keeper/attestators_handler_test.go index d3f9b01..9bd57e1 100644 --- a/configmodule/keeper/attestators_handler_test.go +++ b/configmodule/keeper/attestators_handler_test.go @@ -2,12 +2,9 @@ package keeper_test import "github.com/cosmos/interchain-attestation/configmodule/keeper" -func (suite *KeeperTestSuite) TestGetPublicKey() { - attestatorsHandler := keeper.NewAttestatorHandler(suite.keeper) +func (s *KeeperTestSuite) TestSufficientAttestations() { + attestatorsHandler := keeper.NewAttestatorHandler(s.keeper) - attestatorID := suite.registerAttestator() - - key, err := attestatorsHandler.GetPublicKey(suite.ctx, attestatorID) - suite.Require().NoError(err) - suite.Require().NotNil(key) + // TODO: Test when implemented properly, right now it just always returns true + s.Require().True(attestatorsHandler.SufficientAttestations(s.ctx, nil)) } diff --git a/configmodule/keeper/attestors.go b/configmodule/keeper/attestors.go deleted file mode 100644 index 39de2d6..0000000 --- a/configmodule/keeper/attestors.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/cosmos/interchain-attestation/configmodule/types" -) - -func (k Keeper) SetNewAttestator(ctx context.Context, attestator types.Attestator) error { - has, err := k.Attestators.Has(ctx, attestator.AttestatorId) - if err != nil { - return err - } - - if has { - return types.ErrAttestatorAlreadyExists - } - - return k.Attestators.Set(ctx, attestator.AttestatorId, attestator) -} diff --git a/configmodule/keeper/grpc_query.go b/configmodule/keeper/grpc_query.go index ee5e92a..a28c247 100644 --- a/configmodule/keeper/grpc_query.go +++ b/configmodule/keeper/grpc_query.go @@ -6,9 +6,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/interchain-attestation/configmodule/types" ) @@ -32,39 +29,3 @@ func (q queryServer) Params(ctx context.Context, req *types.QueryParamsRequest) return &types.QueryParamsResponse{Params: params}, nil } - -func (q queryServer) Attestators(ctx context.Context, req *types.QueryAttestatorsRequest) (*types.QueryAttestatorsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - attestators, pageRes, err := query.CollectionPaginate( - ctx, - q.k.Attestators, - req.Pagination, - func(_ []byte, value types.Attestator) (types.Attestator, error) { - return value, nil - }, - ) - if err != nil { - return nil, err - } - - return &types.QueryAttestatorsResponse{ - Attestators: attestators, - Pagination: pageRes, - }, nil -} - -func (q queryServer) Attestator(ctx context.Context, req *types.QueryAttestatorRequest) (*types.QueryAttestatorResponse, error) { - if req == nil { - return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") - } - - attestator, err := q.k.Attestators.Get(ctx, req.AttestatorId) - if err != nil { - return nil, sdkerrors.ErrNotFound - } - - return &types.QueryAttestatorResponse{Attestator: attestator}, nil -} diff --git a/configmodule/keeper/grpc_query_test.go b/configmodule/keeper/grpc_query_test.go index 4ddd9bb..0289275 100644 --- a/configmodule/keeper/grpc_query_test.go +++ b/configmodule/keeper/grpc_query_test.go @@ -1,8 +1,6 @@ package keeper_test import ( - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/interchain-attestation/configmodule/types" ) @@ -11,26 +9,3 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { suite.Require().NoError(err) suite.Require().Equal(types.DefaultParams(), resp.Params) } - -func (suite *KeeperTestSuite) TestGRPCQueryAttestors() { - attestatorID := suite.registerAttestator() - - resp, err := suite.queryClient.Attestators(suite.ctx, &types.QueryAttestatorsRequest{}) - suite.Require().NoError(err) - suite.Require().Len(resp.Attestators, 1) - suite.Require().Equal(attestatorID, resp.Attestators[0].AttestatorId) - var actualPK secp256k1.PubKey - err = suite.cdc.Unmarshal(resp.Attestators[0].PublicKey.GetValue(), &actualPK) - suite.Require().NoError(err) -} - -func (suite *KeeperTestSuite) TestGRPCQueryAttestator() { - attestatorID := suite.registerAttestator() - - resp, err := suite.queryClient.Attestator(suite.ctx, &types.QueryAttestatorRequest{AttestatorId: attestatorID}) - suite.Require().NoError(err) - suite.Require().Equal(attestatorID, resp.Attestator.AttestatorId) - var actualPK secp256k1.PubKey - err = suite.cdc.Unmarshal(resp.Attestator.PublicKey.GetValue(), &actualPK) - suite.Require().NoError(err) -} diff --git a/configmodule/keeper/invariants.go b/configmodule/keeper/invariants.go index af53904..2dd8b6f 100644 --- a/configmodule/keeper/invariants.go +++ b/configmodule/keeper/invariants.go @@ -2,5 +2,6 @@ package keeper import sdk "github.com/cosmos/cosmos-sdk/types" +// TODO: Implement // RegisterInvariants registers the configmodule module invariants func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) {} diff --git a/configmodule/keeper/keeper.go b/configmodule/keeper/keeper.go index 24b871b..ff8ac68 100644 --- a/configmodule/keeper/keeper.go +++ b/configmodule/keeper/keeper.go @@ -21,9 +21,8 @@ type Keeper struct { stakingKeeper types.StakingKeeper - Schema collections.Schema - Params collections.Item[types.Params] - Attestators collections.Map[[]byte, types.Attestator] + Schema collections.Schema + Params collections.Item[types.Params] } func NewKeeper( @@ -42,7 +41,6 @@ func NewKeeper( authority: authority, stakingKeeper: stakingKeeper, Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), - Attestators: collections.NewMap(sb, types.AttestatorsKey, "attestators", collections.BytesKey, codec.CollValue[types.Attestator](cdc)), } schema, err := sb.Build() diff --git a/configmodule/keeper/keeper_test.go b/configmodule/keeper/keeper_test.go index 67a8a61..4e38d6c 100644 --- a/configmodule/keeper/keeper_test.go +++ b/configmodule/keeper/keeper_test.go @@ -11,9 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/address" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/runtime" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -97,22 +95,3 @@ func (suite *KeeperTestSuite) SetupTest() { suite.queryClient = queryClient suite.msgSrvr = msgSrvr } - -// TODO: Support creating multiple attestators. Currently calling this multiple times will fail -func (suite *KeeperTestSuite) registerAttestator() []byte { - pubKey := secp256k1.GenPrivKey().PubKey() - suite.Require().NotNil(pubKey) - pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) - suite.Require().NoError(err) - - attestatorID := []byte("attestator-id") - - _, err = suite.msgSrvr.RegisterAttestator(suite.ctx, &types.MsgRegisterAttestator{ - ValidatorAddress: testValidatorAddress, - AttestatorId: attestatorID, - AttestationPublicKey: pubKeyAny, - }) - suite.Require().NoError(err) - - return attestatorID -} diff --git a/configmodule/keeper/msg_server.go b/configmodule/keeper/msg_server.go index 3687b06..caf3a06 100644 --- a/configmodule/keeper/msg_server.go +++ b/configmodule/keeper/msg_server.go @@ -5,8 +5,6 @@ import ( "cosmossdk.io/errors" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/interchain-attestation/configmodule/types" ) @@ -38,31 +36,3 @@ func (m msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) return &types.MsgUpdateParamsResponse{}, nil } - -func (m msgServer) RegisterAttestator(ctx context.Context, msg *types.MsgRegisterAttestator) (*types.MsgRegisterAttestatorResponse, error) { - valAddr, err := m.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) - if err != nil { - return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) - } - - if err := msg.Validate(m.validatorAddressCodec); err != nil { - return nil, err - } - - validator, err := m.stakingKeeper.GetValidator(ctx, valAddr) - if err != nil { - return nil, err - } - - attestator := types.Attestator{ - AttestatorId: msg.AttestatorId, - PublicKey: msg.AttestationPublicKey, - ConsensusPubkey: validator.ConsensusPubkey, - } - - if err := m.Keeper.SetNewAttestator(ctx, attestator); err != nil { - return nil, err - } - - return &types.MsgRegisterAttestatorResponse{}, nil -} diff --git a/configmodule/keeper/msg_server_test.go b/configmodule/keeper/msg_server_test.go index 29da515..ae115c9 100644 --- a/configmodule/keeper/msg_server_test.go +++ b/configmodule/keeper/msg_server_test.go @@ -1,9 +1,6 @@ package keeper_test import ( - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/interchain-attestation/configmodule/types" ) @@ -59,53 +56,3 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { }) } } - -func (suite *KeeperTestSuite) TestMsgRegisterAttestator() { - pubKey := secp256k1.GenPrivKey().PubKey() - suite.Require().NotNil(pubKey) - pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) - suite.Require().NoError(err) - - attestatorID := []byte("attestator id") - - testCases := []struct { - name string - input *types.MsgRegisterAttestator - expErr string - }{ - { - "valid message", - &types.MsgRegisterAttestator{ - ValidatorAddress: testValidatorAddress, - AttestatorId: attestatorID, - AttestationPublicKey: pubKeyAny, - }, - "", - }, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - resp, err := suite.msgSrvr.RegisterAttestator(suite.ctx, tc.input) - if tc.expErr != "" { - suite.Require().Error(err) - suite.Require().Contains(err.Error(), tc.expErr) - } else { - suite.Require().NoError(err) - suite.Require().NotNil(resp) - - storedAttestator, err := suite.keeper.Attestators.Get(suite.ctx, tc.input.AttestatorId) - suite.Require().NoError(err) - - var actualPK secp256k1.PubKey - err = suite.cdc.Unmarshal(storedAttestator.PublicKey.GetValue(), &actualPK) - suite.Require().NoError(err) - suite.Require().Equal(pubKey.Bytes(), actualPK.Bytes()) - - suite.Require().Equal(tc.input.AttestatorId, storedAttestator.AttestatorId) - suite.Require().NotNil(storedAttestator.ConsensusPubkey.GetValue()) - suite.Require().Equal(suite.mockValidator.ConsensusPubkey.GetValue(), storedAttestator.ConsensusPubkey.GetValue()) - } - }) - } -} diff --git a/configmodule/module.go b/configmodule/module.go index 2dab204..d0a8d32 100644 --- a/configmodule/module.go +++ b/configmodule/module.go @@ -6,7 +6,6 @@ import ( "fmt" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "cosmossdk.io/client/v2/autocli" "cosmossdk.io/core/appmodule" @@ -24,7 +23,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" modulev1 "github.com/cosmos/interchain-attestation/configmodule/api/configmodule/module/v1" - "github.com/cosmos/interchain-attestation/configmodule/client/cli" "github.com/cosmos/interchain-attestation/configmodule/keeper" "github.com/cosmos/interchain-attestation/configmodule/types" ) @@ -79,11 +77,6 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) types.RegisterInterfaces(registry) } -// GetTxCmd returns the root tx command for the attestationconfig module. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.TxCmd(a.cdc.InterfaceRegistry().SigningContext().ValidatorAddressCodec()) -} - // ---------------------------------------------------------------------------- // AppModule // ---------------------------------------------------------------------------- diff --git a/configmodule/proto/configmodule/v1/attestator.proto b/configmodule/proto/configmodule/v1/attestator.proto deleted file mode 100644 index f72a5fe..0000000 --- a/configmodule/proto/configmodule/v1/attestator.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package configmodule.v1; - -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/interchain-attestation/configmodule/types"; - -message Attestator { - bytes attestator_id = 1; - - google.protobuf.Any public_key = 2 - [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; - - google.protobuf.Any consensus_pubkey = 3 - [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; -} \ No newline at end of file diff --git a/configmodule/proto/configmodule/v1/genesis.proto b/configmodule/proto/configmodule/v1/genesis.proto index 9a139dd..499e4b3 100644 --- a/configmodule/proto/configmodule/v1/genesis.proto +++ b/configmodule/proto/configmodule/v1/genesis.proto @@ -4,7 +4,6 @@ package configmodule.v1; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "configmodule/v1/params.proto"; -import "configmodule/v1/attestator.proto"; option go_package = "github.com/cosmos/interchain-attestation/configmodule/types"; @@ -12,6 +11,4 @@ option go_package = "github.com/cosmos/interchain-attestation/configmodule/types message GenesisState { // params defines all the paramaters of configmodule module. Params params = 1; - repeated Attestator attestators = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} \ No newline at end of file +} diff --git a/configmodule/proto/configmodule/v1/query.proto b/configmodule/proto/configmodule/v1/query.proto index 4a2b097..63eec66 100644 --- a/configmodule/proto/configmodule/v1/query.proto +++ b/configmodule/proto/configmodule/v1/query.proto @@ -5,7 +5,6 @@ import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "configmodule/v1/params.proto"; -import "configmodule/v1/attestator.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; option go_package = "github.com/cosmos/interchain-attestation/configmodule/types"; @@ -16,15 +15,6 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/configmodule/v1/params"; } - - rpc Attestators(QueryAttestatorsRequest) returns (QueryAttestatorsResponse) { - option (google.api.http).get = "/configmodule/v1/attestators"; - } - - rpc Attestator(QueryAttestatorRequest) returns (QueryAttestatorResponse) { - option (google.api.http).get = - "/configmodule/v1/attestators/{attestator_id}"; - } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -36,22 +26,3 @@ message QueryParamsResponse { Params params = 1 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } - -message QueryAttestatorRequest { bytes attestator_id = 1; } - -message QueryAttestatorResponse { - Attestator attestator = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -message QueryAttestatorsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAttestatorsResponse { - repeated Attestator attestators = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file diff --git a/configmodule/proto/configmodule/v1/tx.proto b/configmodule/proto/configmodule/v1/tx.proto index cc2b8b3..7cb7e20 100644 --- a/configmodule/proto/configmodule/v1/tx.proto +++ b/configmodule/proto/configmodule/v1/tx.proto @@ -7,7 +7,6 @@ import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; import "configmodule/v1/params.proto"; -import "configmodule/v1/attestator.proto"; option go_package = "github.com/cosmos/interchain-attestation/configmodule/types"; @@ -18,9 +17,6 @@ service Msg { // UpdateParams defines a governance operation for updating the // configmodule module parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - - rpc RegisterAttestator(MsgRegisterAttestator) - returns (MsgRegisterAttestatorResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -41,17 +37,3 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. message MsgUpdateParamsResponse {} - -message MsgRegisterAttestator { - option (cosmos.msg.v1.signer) = "validator_address"; - - string validator_address = 1 - [ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; - - bytes attestator_id = 2; - - google.protobuf.Any attestation_public_key = 3 - [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; -} - -message MsgRegisterAttestatorResponse {} \ No newline at end of file diff --git a/configmodule/types/attestator.go b/configmodule/types/attestator.go deleted file mode 100644 index a485cba..0000000 --- a/configmodule/types/attestator.go +++ /dev/null @@ -1,55 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ codectypes.UnpackInterfacesMessage = (*Attestator)(nil) - -func (a Attestator) Validate() error { - if a.AttestatorId == nil { - return errorsmod.Wrap(ErrInvalidAttestator, "attestator id cannot be empty") - } - - if a.PublicKey == nil { - return errorsmod.Wrap(ErrInvalidAttestator, "public key cannot be empty") - } - - pubKey, ok := a.PublicKey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "expecting attestation pubkey to be cryptotypes.PubKey, got %T", pubKey) - } - - if a.ConsensusPubkey == nil { - return errorsmod.Wrap(ErrInvalidAttestator, "consensus pubkey cannot be empty") - } - - consPubKey, ok := a.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "expecting consensus pubkey to be cryptotypes.PubKey, got %T", consPubKey) - } - - if a.ConsensusPubkey == nil { - return errorsmod.Wrap(ErrInvalidAttestator, "consensus pubkey cannot be empty") - } - - return nil -} - -func (a Attestator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - var pubKey cryptotypes.PubKey - if err := unpacker.UnpackAny(a.PublicKey, &pubKey); err != nil { - return err - } - - var consPubKey cryptotypes.PubKey - if err := unpacker.UnpackAny(a.ConsensusPubkey, &consPubKey); err != nil { - return err - } - - return nil -} diff --git a/configmodule/types/attestator.pb.go b/configmodule/types/attestator.pb.go deleted file mode 100644 index d6a8161..0000000 --- a/configmodule/types/attestator.pb.go +++ /dev/null @@ -1,447 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: configmodule/v1/attestator.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - 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 Attestator struct { - AttestatorId []byte `protobuf:"bytes,1,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` - PublicKey *types.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - ConsensusPubkey *types.Any `protobuf:"bytes,3,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` -} - -func (m *Attestator) Reset() { *m = Attestator{} } -func (m *Attestator) String() string { return proto.CompactTextString(m) } -func (*Attestator) ProtoMessage() {} -func (*Attestator) Descriptor() ([]byte, []int) { - return fileDescriptor_d1aabbaa6a62f312, []int{0} -} -func (m *Attestator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Attestator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Attestator.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 *Attestator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attestator.Merge(m, src) -} -func (m *Attestator) XXX_Size() int { - return m.Size() -} -func (m *Attestator) XXX_DiscardUnknown() { - xxx_messageInfo_Attestator.DiscardUnknown(m) -} - -var xxx_messageInfo_Attestator proto.InternalMessageInfo - -func (m *Attestator) GetAttestatorId() []byte { - if m != nil { - return m.AttestatorId - } - return nil -} - -func (m *Attestator) GetPublicKey() *types.Any { - if m != nil { - return m.PublicKey - } - return nil -} - -func (m *Attestator) GetConsensusPubkey() *types.Any { - if m != nil { - return m.ConsensusPubkey - } - return nil -} - -func init() { - proto.RegisterType((*Attestator)(nil), "configmodule.v1.Attestator") -} - -func init() { proto.RegisterFile("configmodule/v1/attestator.proto", fileDescriptor_d1aabbaa6a62f312) } - -var fileDescriptor_d1aabbaa6a62f312 = []byte{ - // 292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0xcf, 0x4b, - 0xcb, 0x4c, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x2c, 0x29, 0x49, - 0x2d, 0x2e, 0x49, 0x2c, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x47, 0x56, - 0xa1, 0x57, 0x66, 0x28, 0x25, 0x99, 0x9e, 0x9f, 0x9f, 0x9e, 0x93, 0xaa, 0x0f, 0x96, 0x4e, 0x2a, - 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xa8, 0x95, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x8e, - 0x07, 0xf3, 0xf4, 0x21, 0x1c, 0x88, 0x94, 0xd2, 0x6d, 0x46, 0x2e, 0x2e, 0x47, 0xb8, 0xd9, 0x42, - 0xca, 0x5c, 0xbc, 0x08, 0x9b, 0xe2, 0x33, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x78, - 0x10, 0x82, 0x9e, 0x29, 0x42, 0xbe, 0x5c, 0x5c, 0x05, 0xa5, 0x49, 0x39, 0x99, 0xc9, 0xf1, 0xd9, - 0xa9, 0x95, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x22, 0x7a, 0x10, 0xeb, 0xf5, 0x60, 0xd6, - 0xeb, 0x39, 0xe6, 0x55, 0x3a, 0x49, 0x9c, 0xda, 0xa2, 0x2b, 0x02, 0xb5, 0x2f, 0xb9, 0xa8, 0xb2, - 0xa0, 0x24, 0x5f, 0x2f, 0xa0, 0x34, 0xc9, 0x3b, 0xb5, 0x32, 0x88, 0x13, 0x62, 0x82, 0x77, 0x6a, - 0xa5, 0x50, 0x24, 0x97, 0x40, 0x72, 0x7e, 0x5e, 0x71, 0x6a, 0x5e, 0x71, 0x69, 0x71, 0x7c, 0x41, - 0x69, 0x12, 0xc8, 0x50, 0x66, 0xb2, 0x0c, 0xe5, 0x87, 0x9b, 0x13, 0x00, 0x36, 0xc6, 0x29, 0xf4, - 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, - 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xac, 0xd3, 0x33, 0x4b, 0x32, 0x4a, - 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, 0x01, 0xa2, 0x9f, 0x99, 0x57, 0x92, 0x5a, 0x94, 0x9c, 0x91, - 0x98, 0x99, 0xa7, 0x0b, 0xf3, 0x6e, 0x66, 0x7e, 0x9e, 0x3e, 0x4a, 0x4c, 0x94, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0xdd, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x90, 0x42, 0xfe, 0x57, - 0xa6, 0x01, 0x00, 0x00, -} - -func (m *Attestator) 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 *Attestator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Attestator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ConsensusPubkey != nil { - { - size, err := m.ConsensusPubkey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAttestator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAttestator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.AttestatorId) > 0 { - i -= len(m.AttestatorId) - copy(dAtA[i:], m.AttestatorId) - i = encodeVarintAttestator(dAtA, i, uint64(len(m.AttestatorId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAttestator(dAtA []byte, offset int, v uint64) int { - offset -= sovAttestator(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Attestator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AttestatorId) - if l > 0 { - n += 1 + l + sovAttestator(uint64(l)) - } - if m.PublicKey != nil { - l = m.PublicKey.Size() - n += 1 + l + sovAttestator(uint64(l)) - } - if m.ConsensusPubkey != nil { - l = m.ConsensusPubkey.Size() - n += 1 + l + sovAttestator(uint64(l)) - } - return n -} - -func sovAttestator(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAttestator(x uint64) (n int) { - return sovAttestator(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Attestator) 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 ErrIntOverflowAttestator - } - 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: Attestator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Attestator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestatorId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttestator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAttestator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAttestator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttestatorId = append(m.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if m.AttestatorId == nil { - m.AttestatorId = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttestator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAttestator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAttestator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PublicKey == nil { - m.PublicKey = &types.Any{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusPubkey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttestator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAttestator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAttestator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusPubkey == nil { - m.ConsensusPubkey = &types.Any{} - } - if err := m.ConsensusPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAttestator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAttestator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAttestator(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, ErrIntOverflowAttestator - } - 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, ErrIntOverflowAttestator - } - 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, ErrIntOverflowAttestator - } - 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, ErrInvalidLengthAttestator - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAttestator - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAttestator - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAttestator = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAttestator = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAttestator = fmt.Errorf("proto: unexpected end of group") -) diff --git a/configmodule/types/attestator_test.go b/configmodule/types/attestator_test.go deleted file mode 100644 index f567668..0000000 --- a/configmodule/types/attestator_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - - "github.com/cosmos/interchain-attestation/configmodule/types" -) - -func TestAttestatorValidate(t *testing.T) { - consPubKey := ed25519.GenPrivKey().PubKey() - require.NotNil(t, consPubKey) - consPubKeyAny, err := codectypes.NewAnyWithValue(consPubKey) - require.NoError(t, err) - - pubKey := secp256k1.GenPrivKey().PubKey() - require.NotNil(t, pubKey) - pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) - require.NoError(t, err) - - notConsKeyAny, err := codectypes.NewAnyWithValue(&types.MsgRegisterAttestator{ - ValidatorAddress: "tt", - AttestatorId: []byte("tt"), - AttestationPublicKey: pubKeyAny, - }) - require.NoError(t, err) - - testCases := []struct { - name string - attestator types.Attestator - expErr string - }{ - { - "valid attestator", - types.Attestator{ - AttestatorId: []byte("attestator id"), - PublicKey: consPubKeyAny, - ConsensusPubkey: consPubKeyAny, - }, - "", - }, - { - "attestator id is nil", - types.Attestator{ - AttestatorId: nil, - PublicKey: consPubKeyAny, - ConsensusPubkey: consPubKeyAny, - }, - "attestator id cannot be empty: invalid attestator", - }, - { - "public key is nil", - types.Attestator{ - AttestatorId: []byte("attestator id"), - PublicKey: nil, - ConsensusPubkey: consPubKeyAny, - }, - "public key cannot be empty: invalid attestator", - }, - { - "invalid pub key", - types.Attestator{ - AttestatorId: []byte("attestator id"), - PublicKey: notConsKeyAny, - ConsensusPubkey: consPubKeyAny, - }, - "expecting attestation pubkey to be cryptotypes.PubKey, got : invalid type", - }, - { - "consensus pubkey is nil", - types.Attestator{ - AttestatorId: []byte("attestator id"), - PublicKey: consPubKeyAny, - ConsensusPubkey: nil, - }, - "consensus pubkey cannot be empty: invalid attestator", - }, - { - "invalid cons pubkey", - types.Attestator{ - AttestatorId: []byte("attestator id"), - PublicKey: consPubKeyAny, - ConsensusPubkey: notConsKeyAny, - }, - "expecting consensus pubkey to be cryptotypes.PubKey, got : invalid type", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.attestator.Validate() - if tc.expErr == "" { - require.NoError(t, err) - } else { - require.EqualError(t, err, tc.expErr) - } - }) - } -} diff --git a/configmodule/types/codec.go b/configmodule/types/codec.go index db0cfdf..b93d43e 100644 --- a/configmodule/types/codec.go +++ b/configmodule/types/codec.go @@ -9,7 +9,6 @@ import ( func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, - &MsgRegisterAttestator{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/configmodule/types/genesis.pb.go b/configmodule/types/genesis.pb.go index 8fd2a88..33e08af 100644 --- a/configmodule/types/genesis.pb.go +++ b/configmodule/types/genesis.pb.go @@ -27,8 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the configmodule module's genesis state. type GenesisState struct { // params defines all the paramaters of configmodule module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - Attestators []Attestator `protobuf:"bytes,2,rep,name=attestators,proto3" json:"attestators"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -71,13 +70,6 @@ func (m *GenesisState) GetParams() *Params { return nil } -func (m *GenesisState) GetAttestators() []Attestator { - if m != nil { - return m.Attestators - } - return nil -} - func init() { proto.RegisterType((*GenesisState)(nil), "configmodule.v1.GenesisState") } @@ -85,24 +77,21 @@ func init() { func init() { proto.RegisterFile("configmodule/v1/genesis.proto", fileDescriptor_d904d6e8f6c1737d) } var fileDescriptor_d904d6e8f6c1737d = []byte{ - // 262 bytes of a gzipped FileDescriptorProto + // 216 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x47, 0x96, 0xd6, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x35, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0x41, 0x37, 0xb8, 0x20, 0xb1, 0x28, 0x31, - 0x17, 0x6a, 0xae, 0x94, 0x02, 0xba, 0x6c, 0x62, 0x49, 0x49, 0x6a, 0x71, 0x49, 0x62, 0x49, 0x7e, - 0x11, 0x44, 0x85, 0x52, 0x27, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0x2d, 0xc1, 0x25, 0x89, 0x25, 0xa9, - 0x42, 0xfa, 0x5c, 0x6c, 0x10, 0x23, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf5, 0xd0, - 0xdc, 0xa6, 0x17, 0x00, 0x96, 0x0e, 0x82, 0x2a, 0x13, 0xf2, 0xe0, 0xe2, 0x46, 0x98, 0x5a, 0x2c, - 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0x8d, 0xa1, 0xcb, 0x11, 0xae, 0xc6, 0x89, 0xf3, 0xc4, - 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x21, 0x6b, 0x75, 0x0a, 0x3d, 0xf1, 0x48, - 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, - 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xeb, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, - 0xe4, 0xfc, 0x5c, 0xfd, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xfd, 0xcc, 0xbc, 0x92, 0xd4, 0xa2, - 0xe4, 0x8c, 0xc4, 0xcc, 0x3c, 0x5d, 0x98, 0x19, 0x99, 0xf9, 0x79, 0xfa, 0x28, 0x1e, 0x2e, 0xa9, - 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xfb, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x15, 0x4b, - 0x47, 0x56, 0x84, 0x01, 0x00, 0x00, + 0x17, 0x6a, 0xae, 0x92, 0x3d, 0x17, 0x8f, 0x3b, 0xc4, 0xa2, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, + 0x7d, 0x2e, 0x36, 0x88, 0xbc, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xb8, 0x1e, 0x9a, 0xc5, + 0x7a, 0x01, 0x60, 0xe9, 0x20, 0xa8, 0x32, 0xa7, 0xd0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, + 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, + 0x96, 0x63, 0x88, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, + 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0xce, 0x48, 0xcc, 0xcc, + 0xd3, 0x4d, 0x2c, 0x29, 0x49, 0x2d, 0x2e, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x47, 0x71, 0x61, + 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x79, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x23, 0x88, 0xf8, 0x9c, 0x17, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -125,20 +114,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Attestators) > 0 { - for iNdEx := len(m.Attestators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attestators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } if m.Params != nil { { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) @@ -175,12 +150,6 @@ func (m *GenesisState) Size() (n int) { l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) } - if len(m.Attestators) > 0 { - for _, e := range m.Attestators { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } return n } @@ -255,40 +224,6 @@ 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 Attestators", 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.Attestators = append(m.Attestators, Attestator{}) - if err := m.Attestators[len(m.Attestators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/configmodule/types/msg.go b/configmodule/types/msg.go deleted file mode 100644 index 1635763..0000000 --- a/configmodule/types/msg.go +++ /dev/null @@ -1,43 +0,0 @@ -package types - -import ( - "cosmossdk.io/core/address" - errorsmod "cosmossdk.io/errors" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var ( - _ sdk.Msg = &MsgRegisterAttestator{} - _ codectypes.UnpackInterfacesMessage = (*MsgRegisterAttestator)(nil) -) - -func (msg MsgRegisterAttestator) Validate(ac address.Codec) error { - _, err := ac.StringToBytes(msg.ValidatorAddress) - if err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) - } - - if msg.AttestatorId == nil { - return sdkerrors.ErrInvalidRequest.Wrap("attestator id cannot be empty") - } - - if msg.AttestationPublicKey == nil { - return sdkerrors.ErrInvalidRequest.Wrap("public key cannot be empty") - } - - pubKey, ok := msg.AttestationPublicKey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "expecting attestation public key to be cryptotypes.PubKey, got %T", pubKey) - } - - return nil -} - -func (msg MsgRegisterAttestator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - var pubKey cryptotypes.PubKey - return unpacker.UnpackAny(msg.AttestationPublicKey, &pubKey) -} diff --git a/configmodule/types/msg_test.go b/configmodule/types/msg_test.go deleted file mode 100644 index 4b91fd7..0000000 --- a/configmodule/types/msg_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/interchain-attestation/configmodule/types" -) - -func TestMsgRegisterAttestatorValidate(t *testing.T) { - pubKey := secp256k1.GenPrivKey().PubKey() - require.NotNil(t, pubKey) - pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) - require.NoError(t, err) - - notAPubKey, err := codectypes.NewAnyWithValue(&types.MsgRegisterAttestator{ - ValidatorAddress: "tt", - AttestatorId: []byte("tt"), - AttestationPublicKey: pubKeyAny, - }) - require.NoError(t, err) - - testCases := []struct { - name string - msg types.MsgRegisterAttestator - expError string - }{ - { - "valid message", - types.MsgRegisterAttestator{ - ValidatorAddress: "cosmosvaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pqeemx8", - AttestatorId: []byte("attestator id"), - AttestationPublicKey: pubKeyAny, - }, - "", - }, - { - "validator is empty", - types.MsgRegisterAttestator{ - ValidatorAddress: "", - AttestatorId: []byte("attestator id"), - AttestationPublicKey: pubKeyAny, - }, - "invalid validator address: empty address string is not allowed: invalid address", - }, - { - "invalid validator address", - types.MsgRegisterAttestator{ - ValidatorAddress: "invalid", - AttestatorId: []byte("attestator id"), - AttestationPublicKey: pubKeyAny, - }, - "invalid validator address: decoding bech32 failed: invalid bech32 string length 7: invalid address", - }, - { - "nil attestator id", - types.MsgRegisterAttestator{ - ValidatorAddress: "cosmosvaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pqeemx8", - AttestatorId: nil, - AttestationPublicKey: pubKeyAny, - }, - "attestator id cannot be empty: invalid request", - }, - { - "nil attestation public key", - types.MsgRegisterAttestator{ - ValidatorAddress: "cosmosvaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pqeemx8", - AttestatorId: []byte("attestator id"), - AttestationPublicKey: nil, - }, - "public key cannot be empty: invalid request", - }, - { - "invalid attestation public key", - types.MsgRegisterAttestator{ - ValidatorAddress: "cosmosvaloper1gp957czryfgyvxwn3tfnyy2f0t9g2p4pqeemx8", - AttestatorId: []byte("attestator id"), - AttestationPublicKey: notAPubKey, - }, - "expecting attestation public key to be cryptotypes.PubKey, got : invalid type", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.Validate(addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr)) - if tc.expError == "" { - require.NoError(t, err) - } else { - require.EqualError(t, err, tc.expError) - } - }) - } -} diff --git a/configmodule/types/query.pb.go b/configmodule/types/query.pb.go index a67f865..db88fc6 100644 --- a/configmodule/types/query.pb.go +++ b/configmodule/types/query.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -114,237 +114,36 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryAttestatorRequest struct { - AttestatorId []byte `protobuf:"bytes,1,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` -} - -func (m *QueryAttestatorRequest) Reset() { *m = QueryAttestatorRequest{} } -func (m *QueryAttestatorRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAttestatorRequest) ProtoMessage() {} -func (*QueryAttestatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_33cc457b903e66fc, []int{2} -} -func (m *QueryAttestatorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAttestatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAttestatorRequest.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 *QueryAttestatorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAttestatorRequest.Merge(m, src) -} -func (m *QueryAttestatorRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAttestatorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAttestatorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAttestatorRequest proto.InternalMessageInfo - -func (m *QueryAttestatorRequest) GetAttestatorId() []byte { - if m != nil { - return m.AttestatorId - } - return nil -} - -type QueryAttestatorResponse struct { - Attestator Attestator `protobuf:"bytes,1,opt,name=attestator,proto3" json:"attestator"` -} - -func (m *QueryAttestatorResponse) Reset() { *m = QueryAttestatorResponse{} } -func (m *QueryAttestatorResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAttestatorResponse) ProtoMessage() {} -func (*QueryAttestatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_33cc457b903e66fc, []int{3} -} -func (m *QueryAttestatorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAttestatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAttestatorResponse.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 *QueryAttestatorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAttestatorResponse.Merge(m, src) -} -func (m *QueryAttestatorResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAttestatorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAttestatorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAttestatorResponse proto.InternalMessageInfo - -func (m *QueryAttestatorResponse) GetAttestator() Attestator { - if m != nil { - return m.Attestator - } - return Attestator{} -} - -type QueryAttestatorsRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAttestatorsRequest) Reset() { *m = QueryAttestatorsRequest{} } -func (m *QueryAttestatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAttestatorsRequest) ProtoMessage() {} -func (*QueryAttestatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_33cc457b903e66fc, []int{4} -} -func (m *QueryAttestatorsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAttestatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAttestatorsRequest.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 *QueryAttestatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAttestatorsRequest.Merge(m, src) -} -func (m *QueryAttestatorsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAttestatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAttestatorsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAttestatorsRequest proto.InternalMessageInfo - -func (m *QueryAttestatorsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAttestatorsResponse struct { - Attestators []Attestator `protobuf:"bytes,1,rep,name=attestators,proto3" json:"attestators"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAttestatorsResponse) Reset() { *m = QueryAttestatorsResponse{} } -func (m *QueryAttestatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAttestatorsResponse) ProtoMessage() {} -func (*QueryAttestatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_33cc457b903e66fc, []int{5} -} -func (m *QueryAttestatorsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAttestatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAttestatorsResponse.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 *QueryAttestatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAttestatorsResponse.Merge(m, src) -} -func (m *QueryAttestatorsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAttestatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAttestatorsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAttestatorsResponse proto.InternalMessageInfo - -func (m *QueryAttestatorsResponse) GetAttestators() []Attestator { - if m != nil { - return m.Attestators - } - return nil -} - -func (m *QueryAttestatorsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "configmodule.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "configmodule.v1.QueryParamsResponse") - proto.RegisterType((*QueryAttestatorRequest)(nil), "configmodule.v1.QueryAttestatorRequest") - proto.RegisterType((*QueryAttestatorResponse)(nil), "configmodule.v1.QueryAttestatorResponse") - proto.RegisterType((*QueryAttestatorsRequest)(nil), "configmodule.v1.QueryAttestatorsRequest") - proto.RegisterType((*QueryAttestatorsResponse)(nil), "configmodule.v1.QueryAttestatorsResponse") } func init() { proto.RegisterFile("configmodule/v1/query.proto", fileDescriptor_33cc457b903e66fc) } var fileDescriptor_33cc457b903e66fc = []byte{ - // 525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0x33, 0x2d, 0x06, 0x9c, 0x54, 0xc4, 0xb1, 0x98, 0x9a, 0x96, 0x6d, 0xd9, 0x16, 0x1b, - 0x8b, 0xce, 0x90, 0xea, 0x49, 0xf1, 0x60, 0x0f, 0xfe, 0xb9, 0xb5, 0x01, 0x2f, 0x5e, 0x64, 0x92, - 0x8c, 0xdb, 0x81, 0x66, 0xde, 0xed, 0xce, 0x24, 0x50, 0xc4, 0x8b, 0x27, 0x8f, 0x82, 0x78, 0xf7, - 0xe8, 0x45, 0xf0, 0x63, 0xf4, 0x58, 0xf0, 0xe2, 0x49, 0x24, 0x11, 0xfc, 0x1a, 0xb2, 0x33, 0xb3, - 0xee, 0x26, 0x1b, 0x1b, 0xbd, 0x2c, 0xcb, 0xbc, 0xef, 0xf3, 0x3e, 0xbf, 0x79, 0x76, 0x76, 0xf0, - 0x6a, 0x17, 0xd4, 0x4b, 0x19, 0xf5, 0xa1, 0x37, 0x38, 0x12, 0x6c, 0xd8, 0x62, 0xc7, 0x03, 0x91, - 0x9c, 0xd0, 0x38, 0x01, 0x03, 0xe4, 0x72, 0xb1, 0x48, 0x87, 0xad, 0xc6, 0x15, 0xde, 0x97, 0x0a, - 0x98, 0x7d, 0xba, 0x9e, 0xc6, 0x72, 0x04, 0x11, 0xd8, 0x57, 0x96, 0xbe, 0xf9, 0xd5, 0xb5, 0x08, - 0x20, 0x3a, 0x12, 0x8c, 0xc7, 0x92, 0x71, 0xa5, 0xc0, 0x70, 0x23, 0x41, 0xe9, 0xac, 0x3a, 0x6d, - 0x1a, 0xf3, 0x84, 0xf7, 0xb3, 0xea, 0xc6, 0x74, 0x95, 0x1b, 0x23, 0xb4, 0xe1, 0x06, 0x12, 0xdf, - 0xb1, 0xd3, 0x05, 0xdd, 0x07, 0xcd, 0x3a, 0x5c, 0x0b, 0x07, 0xcc, 0x86, 0xad, 0x8e, 0x30, 0x3c, - 0x9d, 0x14, 0x49, 0x65, 0xcd, 0x5c, 0x6f, 0xb8, 0x8c, 0xc9, 0x41, 0xda, 0xb1, 0x6f, 0x2d, 0xda, - 0xe2, 0x78, 0x20, 0xb4, 0x09, 0x0f, 0xf0, 0xd5, 0x89, 0x55, 0x1d, 0x83, 0xd2, 0x82, 0xdc, 0xc3, - 0x55, 0x87, 0xb2, 0x82, 0x36, 0x50, 0xb3, 0xb6, 0x5b, 0xa7, 0x53, 0x09, 0x50, 0x27, 0xd8, 0xbb, - 0x78, 0xfa, 0x7d, 0xbd, 0xf2, 0xe9, 0xd7, 0x97, 0x1d, 0xd4, 0xf6, 0x8a, 0xf0, 0x01, 0xbe, 0x66, - 0x47, 0x3e, 0xfc, 0x43, 0xeb, 0xcd, 0xc8, 0x26, 0xbe, 0x94, 0x6f, 0xe1, 0x85, 0xec, 0xd9, 0xe1, - 0x4b, 0xed, 0xa5, 0x7c, 0xf1, 0x69, 0x2f, 0xe4, 0xb8, 0x5e, 0x92, 0x7b, 0xaa, 0x47, 0x18, 0xe7, - 0xad, 0x9e, 0x6c, 0xb5, 0x44, 0x96, 0x0b, 0x8b, 0x74, 0x05, 0xe5, 0x0c, 0x8b, 0x2c, 0x8f, 0xd4, - 0x22, 0x4f, 0xce, 0x5b, 0xdc, 0xa0, 0x2e, 0x66, 0x9a, 0xc6, 0x4c, 0xdd, 0xb9, 0xf0, 0x31, 0xd3, - 0x7d, 0x1e, 0x09, 0xaf, 0x6d, 0x17, 0x94, 0xe1, 0x67, 0x84, 0x57, 0xca, 0x1e, 0x7e, 0x1f, 0x4f, - 0x70, 0x2d, 0xa7, 0x49, 0x23, 0x5e, 0xfc, 0x8f, 0x8d, 0x14, 0xa5, 0xe4, 0xf1, 0x04, 0xee, 0x82, - 0xc5, 0xdd, 0x9e, 0x8b, 0xeb, 0x30, 0x8a, 0xbc, 0xbb, 0x1f, 0x17, 0xf1, 0x05, 0xcb, 0x4b, 0x0c, - 0xae, 0xba, 0x6f, 0x4b, 0x36, 0x4b, 0x44, 0xe5, 0x03, 0xd4, 0xd8, 0x3a, 0xbf, 0xc9, 0x59, 0x85, - 0xeb, 0x6f, 0xbe, 0xfe, 0x7c, 0xbf, 0x70, 0x9d, 0xd4, 0xd9, 0xec, 0x13, 0x4f, 0xde, 0x22, 0x5c, - 0x2b, 0x44, 0x45, 0x9a, 0xb3, 0xc7, 0x96, 0xbf, 0x58, 0xe3, 0xe6, 0x3f, 0x74, 0x7a, 0x8a, 0x2d, - 0x4b, 0x11, 0x90, 0x35, 0xf6, 0xf7, 0x3f, 0x4b, 0x93, 0x0f, 0x08, 0xe3, 0x5c, 0x4d, 0xb6, 0xe7, - 0xcd, 0xcf, 0x40, 0x9a, 0xf3, 0x1b, 0x3d, 0xc7, 0x5d, 0xcb, 0x41, 0xc9, 0xad, 0xf3, 0x38, 0xd8, - 0xab, 0x89, 0x7f, 0xe5, 0xf5, 0xde, 0xb3, 0xd3, 0x51, 0x80, 0xce, 0x46, 0x01, 0xfa, 0x31, 0x0a, - 0xd0, 0xbb, 0x71, 0x50, 0x39, 0x1b, 0x07, 0x95, 0x6f, 0xe3, 0xa0, 0xf2, 0xfc, 0x7e, 0x24, 0xcd, - 0xe1, 0xa0, 0x43, 0xbb, 0xd0, 0x67, 0xfe, 0x46, 0x90, 0xca, 0x88, 0xa4, 0x7b, 0xc8, 0xa5, 0xba, - 0x9d, 0x8d, 0x91, 0xa0, 0x26, 0xfd, 0xcc, 0x49, 0x2c, 0x74, 0xa7, 0x6a, 0xaf, 0x87, 0x3b, 0xbf, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x08, 0x6c, 0xcf, 0x50, 0x01, 0x05, 0x00, 0x00, + // 325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xc1, 0x4a, 0x03, 0x31, + 0x10, 0x86, 0x37, 0x82, 0x05, 0xe3, 0x41, 0x8c, 0x85, 0x6a, 0x95, 0x54, 0xaa, 0x07, 0x29, 0xb8, + 0xa1, 0xf5, 0xa6, 0xb7, 0x3e, 0x81, 0x2d, 0x78, 0xf1, 0x96, 0x5d, 0x63, 0x1a, 0xe8, 0x66, 0xb6, + 0x9b, 0x6c, 0xa1, 0x07, 0x2f, 0x3e, 0x81, 0xe0, 0x4b, 0x78, 0xf4, 0x31, 0x7a, 0x2c, 0x78, 0xf1, + 0x24, 0xd2, 0x0a, 0xbe, 0x86, 0x34, 0xd9, 0x82, 0x6d, 0xc5, 0x4b, 0x18, 0x66, 0xbe, 0xf9, 0xe7, + 0xcf, 0x8f, 0x0f, 0x63, 0xd0, 0xf7, 0x4a, 0x26, 0x70, 0x97, 0xf7, 0x05, 0x1b, 0x36, 0xd9, 0x20, + 0x17, 0xd9, 0x28, 0x4c, 0x33, 0xb0, 0x40, 0x76, 0x7e, 0x0f, 0xc3, 0x61, 0xb3, 0xba, 0xcb, 0x13, + 0xa5, 0x81, 0xb9, 0xd7, 0x33, 0xd5, 0xb2, 0x04, 0x09, 0xae, 0x64, 0xf3, 0xaa, 0xe8, 0x1e, 0x49, + 0x00, 0xd9, 0x17, 0x8c, 0xa7, 0x8a, 0x71, 0xad, 0xc1, 0x72, 0xab, 0x40, 0x9b, 0xc5, 0x74, 0xf5, + 0x68, 0xca, 0x33, 0x9e, 0x2c, 0xa6, 0x8d, 0x18, 0x4c, 0x02, 0x86, 0x45, 0xdc, 0x08, 0x6f, 0x87, + 0x0d, 0x9b, 0x91, 0xb0, 0x7c, 0xce, 0x49, 0xa5, 0x9d, 0x94, 0x67, 0xeb, 0x65, 0x4c, 0x3a, 0x73, + 0xe2, 0xda, 0x09, 0x74, 0xc5, 0x20, 0x17, 0xc6, 0xd6, 0x3b, 0x78, 0x6f, 0xa9, 0x6b, 0x52, 0xd0, + 0x46, 0x90, 0x4b, 0x5c, 0xf2, 0x87, 0xf6, 0xd1, 0x31, 0x3a, 0xdb, 0x6e, 0x55, 0xc2, 0x95, 0xff, + 0x85, 0x7e, 0xa1, 0xbd, 0x35, 0xfe, 0xa8, 0x05, 0x2f, 0xdf, 0xaf, 0x0d, 0xd4, 0x2d, 0x36, 0x5a, + 0x0f, 0x78, 0xd3, 0x49, 0x12, 0x8b, 0x4b, 0x9e, 0x22, 0x27, 0x6b, 0xeb, 0xeb, 0x56, 0xaa, 0xa7, + 0xff, 0x43, 0xde, 0x59, 0xbd, 0xf6, 0xf8, 0xf6, 0xf5, 0xbc, 0x71, 0x40, 0x2a, 0xec, 0xef, 0x64, + 0xda, 0x37, 0xe3, 0x29, 0x45, 0x93, 0x29, 0x45, 0x9f, 0x53, 0x8a, 0x9e, 0x66, 0x34, 0x98, 0xcc, + 0x68, 0xf0, 0x3e, 0xa3, 0xc1, 0xed, 0x95, 0x54, 0xb6, 0x97, 0x47, 0x61, 0x0c, 0x09, 0x2b, 0x82, + 0x53, 0xda, 0x8a, 0x2c, 0xee, 0x71, 0xa5, 0xcf, 0xb9, 0xb5, 0xc2, 0xf8, 0xf0, 0x97, 0xa5, 0xed, + 0x28, 0x15, 0x26, 0x2a, 0xb9, 0x14, 0x2f, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x23, 0xbe, 0xb9, + 0xb1, 0x06, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -361,8 +160,6 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - Attestators(ctx context.Context, in *QueryAttestatorsRequest, opts ...grpc.CallOption) (*QueryAttestatorsResponse, error) - Attestator(ctx context.Context, in *QueryAttestatorRequest, opts ...grpc.CallOption) (*QueryAttestatorResponse, error) } type queryClient struct { @@ -382,30 +179,10 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) Attestators(ctx context.Context, in *QueryAttestatorsRequest, opts ...grpc.CallOption) (*QueryAttestatorsResponse, error) { - out := new(QueryAttestatorsResponse) - err := c.cc.Invoke(ctx, "/configmodule.v1.Query/Attestators", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Attestator(ctx context.Context, in *QueryAttestatorRequest, opts ...grpc.CallOption) (*QueryAttestatorResponse, error) { - out := new(QueryAttestatorResponse) - err := c.cc.Invoke(ctx, "/configmodule.v1.Query/Attestator", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - Attestators(context.Context, *QueryAttestatorsRequest) (*QueryAttestatorsResponse, error) - Attestator(context.Context, *QueryAttestatorRequest) (*QueryAttestatorResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -415,12 +192,6 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) Attestators(ctx context.Context, req *QueryAttestatorsRequest) (*QueryAttestatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Attestators not implemented") -} -func (*UnimplementedQueryServer) Attestator(ctx context.Context, req *QueryAttestatorRequest) (*QueryAttestatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Attestator not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -444,42 +215,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Attestators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAttestatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Attestators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/configmodule.v1.Query/Attestators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Attestators(ctx, req.(*QueryAttestatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Attestator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAttestatorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Attestator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/configmodule.v1.Query/Attestator", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Attestator(ctx, req.(*QueryAttestatorRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "configmodule.v1.Query", HandlerType: (*QueryServer)(nil), @@ -488,14 +223,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Attestators", - Handler: _Query_Attestators_Handler, - }, - { - MethodName: "Attestator", - Handler: _Query_Attestator_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "configmodule/v1/query.proto", @@ -557,153 +284,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAttestatorRequest) 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 *QueryAttestatorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAttestatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AttestatorId) > 0 { - i -= len(m.AttestatorId) - copy(dAtA[i:], m.AttestatorId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AttestatorId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAttestatorResponse) 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 *QueryAttestatorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAttestatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Attestator.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 *QueryAttestatorsRequest) 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 *QueryAttestatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAttestatorsRequest) 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 *QueryAttestatorsResponse) 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 *QueryAttestatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAttestatorsResponse) 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.Attestators) > 0 { - for iNdEx := len(m.Attestators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attestators[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 @@ -735,62 +315,6 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryAttestatorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AttestatorId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAttestatorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Attestator.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAttestatorsRequest) 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 *QueryAttestatorsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Attestators) > 0 { - for _, e := range m.Attestators { - 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 } @@ -930,379 +454,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAttestatorRequest) 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: QueryAttestatorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAttestatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestatorId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttestatorId = append(m.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if m.AttestatorId == nil { - m.AttestatorId = []byte{} - } - 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 *QueryAttestatorResponse) 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: QueryAttestatorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAttestatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attestator", 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 err := m.Attestator.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 *QueryAttestatorsRequest) 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: QueryAttestatorsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAttestatorsRequest: 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 *QueryAttestatorsResponse) 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: QueryAttestatorsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAttestatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attestators", 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.Attestators = append(m.Attestators, Attestator{}) - if err := m.Attestators[len(m.Attestators)-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 diff --git a/configmodule/types/query.pb.gw.go b/configmodule/types/query.pb.gw.go index 6f02c82..88fde16 100644 --- a/configmodule/types/query.pb.gw.go +++ b/configmodule/types/query.pb.gw.go @@ -51,96 +51,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -var ( - filter_Query_Attestators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Attestators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAttestatorsRequest - 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_Attestators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Attestators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Attestators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAttestatorsRequest - 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_Attestators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Attestators(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Attestator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAttestatorRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["attestator_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "attestator_id") - } - - protoReq.AttestatorId, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "attestator_id", err) - } - - msg, err := client.Attestator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Attestator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAttestatorRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["attestator_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "attestator_id") - } - - protoReq.AttestatorId, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "attestator_id", err) - } - - msg, err := server.Attestator(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. @@ -170,52 +80,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Attestators_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_Attestators_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_Attestators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Attestator_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_Attestator_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_Attestator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -277,61 +141,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Attestators_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_Attestators_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_Attestators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Attestator_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_Attestator_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_Attestator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"configmodule", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Attestators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"configmodule", "v1", "attestators"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Attestator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"configmodule", "v1", "attestators", "attestator_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Attestators_0 = runtime.ForwardResponseMessage - - forward_Query_Attestator_0 = runtime.ForwardResponseMessage ) diff --git a/configmodule/types/tx.pb.go b/configmodule/types/tx.pb.go index d42f150..90f7e18 100644 --- a/configmodule/types/tx.pb.go +++ b/configmodule/types/tx.pb.go @@ -7,7 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -128,147 +128,38 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -type MsgRegisterAttestator struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - AttestatorId []byte `protobuf:"bytes,2,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` - AttestationPublicKey *types.Any `protobuf:"bytes,3,opt,name=attestation_public_key,json=attestationPublicKey,proto3" json:"attestation_public_key,omitempty"` -} - -func (m *MsgRegisterAttestator) Reset() { *m = MsgRegisterAttestator{} } -func (m *MsgRegisterAttestator) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAttestator) ProtoMessage() {} -func (*MsgRegisterAttestator) Descriptor() ([]byte, []int) { - return fileDescriptor_7537773bb85d69b9, []int{2} -} -func (m *MsgRegisterAttestator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAttestator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAttestator.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 *MsgRegisterAttestator) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAttestator.Merge(m, src) -} -func (m *MsgRegisterAttestator) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAttestator) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAttestator.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAttestator proto.InternalMessageInfo - -func (m *MsgRegisterAttestator) GetValidatorAddress() string { - if m != nil { - return m.ValidatorAddress - } - return "" -} - -func (m *MsgRegisterAttestator) GetAttestatorId() []byte { - if m != nil { - return m.AttestatorId - } - return nil -} - -func (m *MsgRegisterAttestator) GetAttestationPublicKey() *types.Any { - if m != nil { - return m.AttestationPublicKey - } - return nil -} - -type MsgRegisterAttestatorResponse struct { -} - -func (m *MsgRegisterAttestatorResponse) Reset() { *m = MsgRegisterAttestatorResponse{} } -func (m *MsgRegisterAttestatorResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAttestatorResponse) ProtoMessage() {} -func (*MsgRegisterAttestatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7537773bb85d69b9, []int{3} -} -func (m *MsgRegisterAttestatorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAttestatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAttestatorResponse.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 *MsgRegisterAttestatorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAttestatorResponse.Merge(m, src) -} -func (m *MsgRegisterAttestatorResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAttestatorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAttestatorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAttestatorResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgUpdateParams)(nil), "configmodule.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "configmodule.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgRegisterAttestator)(nil), "configmodule.v1.MsgRegisterAttestator") - proto.RegisterType((*MsgRegisterAttestatorResponse)(nil), "configmodule.v1.MsgRegisterAttestatorResponse") } func init() { proto.RegisterFile("configmodule/v1/tx.proto", fileDescriptor_7537773bb85d69b9) } var fileDescriptor_7537773bb85d69b9 = []byte{ - // 529 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0x8e, 0x5b, 0x51, 0x29, 0x47, 0xa0, 0xd4, 0x0a, 0x8d, 0x6b, 0x51, 0x37, 0x04, 0x09, 0x45, - 0x95, 0x72, 0x56, 0x8b, 0xc4, 0x10, 0xa6, 0x64, 0x43, 0x55, 0x50, 0x64, 0x54, 0x86, 0x2e, 0xd6, - 0xd9, 0xbe, 0x5e, 0x4e, 0xd8, 0x3e, 0xcb, 0x77, 0x8e, 0xf0, 0x86, 0x18, 0x99, 0x58, 0xf8, 0x0f, - 0x8c, 0x1d, 0xfa, 0x23, 0x2a, 0xa6, 0xaa, 0x03, 0x62, 0x42, 0x28, 0x19, 0xf2, 0x37, 0x90, 0xbf, - 0x70, 0xe2, 0x44, 0x82, 0xc5, 0xba, 0xf7, 0xde, 0xe7, 0xfd, 0x78, 0x9e, 0xc7, 0x07, 0x14, 0x9b, - 0xf9, 0x97, 0x94, 0x78, 0xcc, 0x89, 0x5c, 0xac, 0x4f, 0x4f, 0x74, 0xf1, 0x01, 0x06, 0x21, 0x13, - 0x4c, 0xde, 0x5d, 0xce, 0xc0, 0xe9, 0x89, 0xba, 0x87, 0x3c, 0xea, 0x33, 0x3d, 0xfd, 0x66, 0x18, - 0xb5, 0x49, 0x18, 0x61, 0xe9, 0x51, 0x4f, 0x4e, 0xf9, 0x6d, 0xcb, 0x66, 0xdc, 0x63, 0x5c, 0xf7, - 0x38, 0x49, 0x3a, 0x7a, 0x9c, 0xe4, 0x89, 0x83, 0x2c, 0x61, 0x66, 0x15, 0x59, 0x50, 0xa4, 0x08, - 0x63, 0xc4, 0xc5, 0x7a, 0x1a, 0x59, 0xd1, 0xa5, 0x8e, 0xfc, 0x38, 0x4f, 0x3d, 0xa9, 0xae, 0x18, - 0xa0, 0x10, 0x79, 0x45, 0x61, 0xbb, 0x9a, 0x45, 0x42, 0x60, 0x2e, 0x90, 0x60, 0x61, 0x86, 0xe8, - 0x7c, 0x95, 0xc0, 0xee, 0x88, 0x93, 0xf3, 0xc0, 0x41, 0x02, 0x8f, 0xd3, 0x5a, 0xf9, 0x25, 0xa8, - 0xa3, 0x48, 0x4c, 0x58, 0x48, 0x45, 0xac, 0x48, 0x6d, 0xa9, 0x5b, 0x1f, 0x2a, 0x77, 0xd7, 0xbd, - 0x66, 0xbe, 0xd3, 0xc0, 0x71, 0x42, 0xcc, 0xf9, 0x5b, 0x11, 0x52, 0x9f, 0x18, 0x25, 0x54, 0xee, - 0x83, 0x9d, 0x6c, 0xba, 0xb2, 0xd5, 0x96, 0xba, 0xf7, 0x4f, 0x5b, 0xb0, 0xa2, 0x12, 0xcc, 0x06, - 0x0c, 0xeb, 0x37, 0xbf, 0x8e, 0x6a, 0xdf, 0x16, 0x57, 0xc7, 0x92, 0x91, 0x57, 0xf4, 0x1f, 0x7e, - 0x5a, 0x5c, 0x1d, 0x97, 0xbd, 0x3a, 0x07, 0xa0, 0x55, 0x59, 0xcb, 0xc0, 0x3c, 0x60, 0x3e, 0xc7, - 0x9d, 0xcf, 0x5b, 0xe0, 0xf1, 0x88, 0x13, 0x03, 0x13, 0xca, 0x05, 0x0e, 0x07, 0x7f, 0x29, 0xc9, - 0x6f, 0xc0, 0xde, 0x14, 0xb9, 0xd4, 0x49, 0x02, 0x13, 0x65, 0x6b, 0xe6, 0x04, 0x9e, 0xde, 0x5d, - 0xf7, 0x0e, 0x73, 0x02, 0xef, 0x0a, 0xcc, 0x2a, 0x93, 0x47, 0xd3, 0xca, 0xbd, 0xfc, 0x0c, 0x3c, - 0x28, 0x05, 0x33, 0xa9, 0x93, 0xf2, 0x6a, 0x18, 0x8d, 0xf2, 0xf2, 0xb5, 0x23, 0x3b, 0x60, 0xbf, - 0x88, 0x29, 0xf3, 0xcd, 0x20, 0xb2, 0x5c, 0x6a, 0x9b, 0xef, 0x71, 0xac, 0x6c, 0xa7, 0x2a, 0x34, - 0x61, 0xe6, 0x1e, 0x2c, 0xdc, 0x83, 0x03, 0x3f, 0x1e, 0x2a, 0xdf, 0x4b, 0x41, 0xed, 0x30, 0x0e, - 0x04, 0x83, 0xe3, 0xc8, 0x3a, 0xc3, 0xb1, 0xd1, 0x5c, 0xea, 0x36, 0x4e, 0x9b, 0x9d, 0xe1, 0xb8, - 0xbf, 0x9f, 0xe8, 0xb3, 0xce, 0xae, 0x73, 0x04, 0x0e, 0x37, 0x6a, 0x51, 0xa8, 0x75, 0xfa, 0x43, - 0x02, 0xdb, 0x23, 0x4e, 0xe4, 0x0b, 0xd0, 0x58, 0x31, 0xb9, 0xbd, 0x66, 0x4e, 0x45, 0x6f, 0xb5, - 0xfb, 0x2f, 0x44, 0x31, 0x43, 0x76, 0x81, 0xbc, 0xc1, 0x8d, 0xe7, 0x9b, 0xea, 0xd7, 0x71, 0x2a, - 0xfc, 0x3f, 0x5c, 0x31, 0x4d, 0xbd, 0xf7, 0x31, 0xf9, 0x73, 0x86, 0xe7, 0x37, 0x33, 0x4d, 0xba, - 0x9d, 0x69, 0xd2, 0xef, 0x99, 0x26, 0x7d, 0x99, 0x6b, 0xb5, 0xdb, 0xb9, 0x56, 0xfb, 0x39, 0xd7, - 0x6a, 0x17, 0xaf, 0x08, 0x15, 0x93, 0xc8, 0x82, 0x36, 0xf3, 0xf2, 0x77, 0xa4, 0x53, 0x5f, 0xe0, - 0xd0, 0x9e, 0x20, 0xea, 0xf7, 0x96, 0xe4, 0xd5, 0x57, 0x9e, 0x87, 0x88, 0x03, 0xcc, 0xad, 0x9d, - 0xd4, 0xa6, 0x17, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x1b, 0xf8, 0x6d, 0xfc, 0x03, 0x00, - 0x00, + // 364 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xce, 0xcf, 0x4b, + 0xcb, 0x4c, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x47, 0x96, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, + 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x35, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, + 0x88, 0x05, 0x15, 0x15, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0x07, 0x99, + 0x98, 0x5b, 0x9c, 0x0e, 0x95, 0x90, 0x84, 0x48, 0xc4, 0x43, 0x74, 0x40, 0x38, 0x30, 0xa9, 0xf4, + 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0x7d, 0x30, 0x2f, 0xa9, 0x34, 0x4d, 0x3f, 0x31, 0xaf, 0x12, 0x2a, + 0x25, 0x83, 0xee, 0xc4, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x46, 0xa5, 0xa9, 0x8c, 0x5c, 0xfc, + 0xbe, 0xc5, 0xe9, 0xa1, 0x05, 0x29, 0x89, 0x25, 0xa9, 0x01, 0x60, 0x19, 0x21, 0x33, 0x2e, 0xce, + 0xc4, 0xd2, 0x92, 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, + 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x36, 0x3a, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, + 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x21, 0x94, 0x0a, 0x59, 0x71, 0xb1, 0x41, 0xcc, 0x96, 0x60, 0x52, + 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd7, 0x43, 0x0b, 0x03, 0x3d, 0x88, 0x05, 0x4e, 0x9c, 0x27, 0xee, + 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0xc3, 0x8a, 0xaf, 0xe9, 0xf9, 0x06, + 0x2d, 0x84, 0x59, 0x4a, 0x92, 0x5c, 0xe2, 0x68, 0xce, 0x0a, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, + 0x4e, 0x35, 0xca, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x8a, 0xe2, 0xe2, 0x41, 0x71, 0xb5, 0x02, + 0x86, 0x6d, 0x68, 0x06, 0x48, 0x69, 0x10, 0x52, 0x01, 0xb3, 0x42, 0x8a, 0xb5, 0x01, 0xe4, 0x38, + 0xa7, 0xd0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x4e, 0xcf, 0x2c, + 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, 0x46, 0x84, 0x7e, 0x66, 0x5e, 0x49, 0x6a, 0x51, + 0x72, 0x46, 0x62, 0x66, 0x9e, 0x6e, 0x62, 0x49, 0x49, 0x6a, 0x71, 0x49, 0x62, 0x49, 0x66, 0x7e, + 0x9e, 0x3e, 0x4a, 0xe8, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xde, 0x18, 0x10, + 0x00, 0x00, 0xff, 0xff, 0x78, 0x38, 0xef, 0xdf, 0x3d, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -286,7 +177,6 @@ type MsgClient interface { // UpdateParams defines a governance operation for updating the // configmodule module parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - RegisterAttestator(ctx context.Context, in *MsgRegisterAttestator, opts ...grpc.CallOption) (*MsgRegisterAttestatorResponse, error) } type msgClient struct { @@ -306,21 +196,11 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } -func (c *msgClient) RegisterAttestator(ctx context.Context, in *MsgRegisterAttestator, opts ...grpc.CallOption) (*MsgRegisterAttestatorResponse, error) { - out := new(MsgRegisterAttestatorResponse) - err := c.cc.Invoke(ctx, "/configmodule.v1.Msg/RegisterAttestator", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a governance operation for updating the // configmodule module parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - RegisterAttestator(context.Context, *MsgRegisterAttestator) (*MsgRegisterAttestatorResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -330,9 +210,6 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func (*UnimplementedMsgServer) RegisterAttestator(ctx context.Context, req *MsgRegisterAttestator) (*MsgRegisterAttestatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterAttestator not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -356,24 +233,6 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_RegisterAttestator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterAttestator) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterAttestator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/configmodule.v1.Msg/RegisterAttestator", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterAttestator(ctx, req.(*MsgRegisterAttestator)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "configmodule.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -382,10 +241,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, - { - MethodName: "RegisterAttestator", - Handler: _Msg_RegisterAttestator_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "configmodule/v1/tx.proto", @@ -454,78 +309,6 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgRegisterAttestator) 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 *MsgRegisterAttestator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAttestator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AttestationPublicKey != nil { - { - size, err := m.AttestationPublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.AttestatorId) > 0 { - i -= len(m.AttestatorId) - copy(dAtA[i:], m.AttestatorId) - i = encodeVarintTx(dAtA, i, uint64(len(m.AttestatorId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterAttestatorResponse) 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 *MsgRegisterAttestatorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAttestatorResponse) 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 @@ -561,36 +344,6 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } -func (m *MsgRegisterAttestator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.AttestatorId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.AttestationPublicKey != nil { - l = m.AttestationPublicKey.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterAttestatorResponse) 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 } @@ -762,208 +515,6 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterAttestator) 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: MsgRegisterAttestator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAttestator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestatorId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttestatorId = append(m.AttestatorId[:0], dAtA[iNdEx:postIndex]...) - if m.AttestatorId == nil { - m.AttestatorId = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestationPublicKey", 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 m.AttestationPublicKey == nil { - m.AttestationPublicKey = &types.Any{} - } - if err := m.AttestationPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterAttestatorResponse) 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: MsgRegisterAttestatorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAttestatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/core/go.mod b/core/go.mod index c516a29..0e73255 100644 --- a/core/go.mod +++ b/core/go.mod @@ -26,7 +26,6 @@ require ( cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/depinject v1.0.0 // indirect - cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/x/tx v0.13.4 // indirect cosmossdk.io/x/upgrade v0.1.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -159,6 +158,6 @@ require ( ) require ( - github.com/golang/mock v1.6.0 + cosmossdk.io/log v1.3.1 golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 ) diff --git a/core/go.sum b/core/go.sum index 7ec4f8e..a21eddd 100644 --- a/core/go.sum +++ b/core/go.sum @@ -744,7 +744,6 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= @@ -812,7 +811,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= @@ -857,7 +855,6 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.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= @@ -951,7 +948,6 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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= diff --git a/core/lightclient/attestators_controller.go b/core/lightclient/attestators_controller.go index a4686c1..7c17c1c 100644 --- a/core/lightclient/attestators_controller.go +++ b/core/lightclient/attestators_controller.go @@ -2,12 +2,9 @@ package lightclient import ( "context" - - sdkcrypto "github.com/cosmos/cosmos-sdk/crypto/types" ) // TODO: Document the interface and its methods type AttestatorsController interface { - GetPublicKey(ctx context.Context, attestatorId []byte) (sdkcrypto.PubKey, error) SufficientAttestations(ctx context.Context, attestatorIds [][]byte) (bool, error) } diff --git a/core/lightclient/clientmsg.go b/core/lightclient/clientmsg.go index 9ce7e24..c9342ce 100644 --- a/core/lightclient/clientmsg.go +++ b/core/lightclient/clientmsg.go @@ -1,10 +1,6 @@ package lightclient import ( - "crypto/sha256" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/ibc-go/v9/modules/core/exported" "github.com/cosmos/interchain-attestation/core/types" @@ -26,9 +22,3 @@ func (m *AttestationClaim) ValidateBasic() error { // TODO implement me panic("implement me") } - -func GetSignableBytes(cdc codec.BinaryCodec, dataToAttestTo types.IBCData) []byte { - packetBytes := cdc.MustMarshal(&dataToAttestTo) - hash := sha256.Sum256(packetBytes) - return hash[:] -} diff --git a/core/lightclient/errors.go b/core/lightclient/errors.go index cc1fa6d..af87203 100644 --- a/core/lightclient/errors.go +++ b/core/lightclient/errors.go @@ -11,4 +11,5 @@ var ( ErrInvalidHeaderHeight = errorsmod.Register(ModuleName, 4, "invalid header height") ErrInvalidClientMsg = errorsmod.Register(ModuleName, 5, "invalid client message") ErrPacketCommitmentNotFound = errorsmod.Register(ModuleName, 6, "packet commitment not found") + ErrInvalidUpdateMethod = errorsmod.Register(ModuleName, 7, "invalid update method, can only be done through code") ) diff --git a/core/lightclient/light_client_module.go b/core/lightclient/light_client_module.go index 2d71a55..994fda1 100644 --- a/core/lightclient/light_client_module.go +++ b/core/lightclient/light_client_module.go @@ -18,6 +18,8 @@ import ( var _ exported.LightClientModule = (*LightClientModule)(nil) +type TrustedClientUpdateFunc func(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height + // LightClientModule implements the core IBC api.LightClientModule interface. type LightClientModule struct { cdc codec.BinaryCodec @@ -26,12 +28,13 @@ type LightClientModule struct { } // NewLightClientModule creates and returns a new attestation LightClientModule. -func NewLightClientModule(cdc codec.BinaryCodec, storeProvider clienttypes.StoreProvider, attestatorsHandler AttestatorsController) LightClientModule { - return LightClientModule{ +func NewLightClientModule(cdc codec.BinaryCodec, storeProvider clienttypes.StoreProvider, attestatorsHandler AttestatorsController) (LightClientModule, TrustedClientUpdateFunc) { + lcm := LightClientModule{ cdc: cdc, storeProvider: storeProvider, attestatorsHandler: attestatorsHandler, } + return lcm, lcm.trustedUpdateState } // Initialize unmarshals the provided client and consensus states and performs basic validation. @@ -86,8 +89,13 @@ func (l *LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID strin func (l *LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) { } -// UpdateState obtains the client state associated with the client identifier and calls into the clientState.UpdateState method. +// UpdateState will always return an error, because it is only supposed to be called by validators in the trustedUpdateState call func (l *LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { + panic(ErrInvalidUpdateMethod) +} + +// TODO: Document +func (l *LightClientModule) trustedUpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { clientStore := l.storeProvider.ClientStore(ctx, clientID) clientState, found := getClientState(clientStore, l.cdc) if !found { diff --git a/core/lightclient/light_client_module_test.go b/core/lightclient/light_client_module_test.go index f2514ff..bfed3d5 100644 --- a/core/lightclient/light_client_module_test.go +++ b/core/lightclient/light_client_module_test.go @@ -97,6 +97,7 @@ func (s *AttestationLightClientTestSuite) TestLightClientModule_VerifyClientMess s.Require().Contains(err.Error(), "client not found") } +// Since UpdateState should only be done by validators through the trustedUpdateFunc, the regular UpdateState should panic func (s *AttestationLightClientTestSuite) TestLightClientModule_UpdateState() { clientID := createClientID(0) clientStateBz := s.encCfg.Codec.MustMarshal(initialClientState) @@ -108,13 +109,34 @@ func (s *AttestationLightClientTestSuite) TestLightClientModule_UpdateState() { expectedHeight := clienttypes.NewHeight(1, defaultHeight.RevisionHeight+1) expectedTimestamp := time.Now() + clientMsg := generateClientMsg(s.encCfg.Codec, s.mockAttestators, 10, func(attestedData *types.IBCData) { + attestedData.Height = expectedHeight + attestedData.Timestamp = expectedTimestamp + }) + + s.Require().Panics(func() { + s.lightClientModule.UpdateState(s.ctx, clientID, clientMsg) + }, lightclient.ErrInvalidUpdateMethod) +} + +func (s *AttestationLightClientTestSuite) TestLightClientModule_TrustedUpdateState() { + clientID := createClientID(0) + clientStateBz := s.encCfg.Codec.MustMarshal(initialClientState) + consensusStateBz := s.encCfg.Codec.MustMarshal(initialConsensusState) + + err := s.lightClientModule.Initialize(s.ctx, clientID, clientStateBz, consensusStateBz) + s.Require().NoError(err) + + expectedHeight := clienttypes.NewHeight(1, defaultHeight.RevisionHeight+1) + expectedTimestamp := time.Now() + for i := 0; i < 25; i++ { clientMsg := generateClientMsg(s.encCfg.Codec, s.mockAttestators, i, func(attestedData *types.IBCData) { attestedData.Height = expectedHeight attestedData.Timestamp = expectedTimestamp }) - heights := s.lightClientModule.UpdateState(s.ctx, clientID, clientMsg) + heights := s.trustedUpdateFunc(s.ctx, clientID, clientMsg) s.Require().Equal([]exported.Height{expectedHeight}, heights) s.assertClientState(clientID, expectedHeight, expectedTimestamp) @@ -130,7 +152,7 @@ func (s *AttestationLightClientTestSuite) TestLightClientModule_UpdateState() { attestedData.Timestamp = expectedTimestamp }) - heights := s.lightClientModule.UpdateState(s.ctx, clientID, clientMsg) + heights := s.trustedUpdateFunc(s.ctx, clientID, clientMsg) s.Require().Equal([]exported.Height{expectedHeight}, heights) s.assertClientState(clientID, expectedHeight, expectedTimestamp) @@ -152,7 +174,7 @@ func (s *AttestationLightClientTestSuite) TestLightClientModule_VerifyMembership clientMsg := generateClientMsg(s.encCfg.Codec, s.mockAttestators, 5, func(attestedData *types.IBCData) { attestedData.Height = clienttypes.NewHeight(1, defaultHeight.RevisionHeight+1) }) - s.lightClientModule.UpdateState(s.ctx, clientID, clientMsg) + s.trustedUpdateFunc(s.ctx, clientID, clientMsg) for _, packetCommitment := range clientMsg.Attestations[0].AttestedData.PacketCommitments { err = s.lightClientModule.VerifyMembership(s.ctx, clientID, nil, 0, 0, nil, nil, packetCommitment) @@ -168,7 +190,7 @@ func (s *AttestationLightClientTestSuite) TestLightClientModule_VerifyMembership clientMsg = generateClientMsg(s.encCfg.Codec, s.mockAttestators, 0, func(attestedData *types.IBCData) { attestedData.Height = clienttypes.NewHeight(1, clientMsg.Attestations[0].AttestedData.Height.RevisionHeight+1) }) - s.lightClientModule.UpdateState(s.ctx, clientID, clientMsg) + s.trustedUpdateFunc(s.ctx, clientID, clientMsg) for _, packetCommitment := range oldPacketCommitments { err = s.lightClientModule.VerifyMembership(s.ctx, clientID, nil, 0, 0, nil, nil, packetCommitment) diff --git a/core/lightclient/light_client_test.go b/core/lightclient/light_client_test.go index 0d5d14b..a40b72c 100644 --- a/core/lightclient/light_client_test.go +++ b/core/lightclient/light_client_test.go @@ -6,14 +6,13 @@ import ( "testing" "time" - testifysuite "github.com/stretchr/testify/suite" + suite "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdkcrypto "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" @@ -48,9 +47,10 @@ var ( ) type AttestationLightClientTestSuite struct { - testifysuite.Suite + suite.Suite lightClientModule lightclient.LightClientModule + trustedUpdateFunc lightclient.TrustedClientUpdateFunc storeProvider clienttypes.StoreProvider mockAttestators []mockAttestator @@ -62,7 +62,7 @@ type AttestationLightClientTestSuite struct { } func TestAttestationLightClientTestSuite(t *testing.T) { - testifysuite.Run(t, new(AttestationLightClientTestSuite)) + suite.Run(t, new(AttestationLightClientTestSuite)) } func (s *AttestationLightClientTestSuite) SetupTest() { @@ -75,13 +75,11 @@ func (s *AttestationLightClientTestSuite) SetupTest() { s.mockAttestators = generateAttestators(10) s.mockAttestatorsHandler = NewMockAttestatorsHandler(s.mockAttestators) - s.lightClientModule = lightclient.NewLightClientModule(s.encCfg.Codec, s.storeProvider, s.mockAttestatorsHandler) + s.lightClientModule, s.trustedUpdateFunc = lightclient.NewLightClientModule(s.encCfg.Codec, s.storeProvider, s.mockAttestatorsHandler) } type mockAttestator struct { - id []byte - publicKey sdkcrypto.PubKey - privateKey sdkcrypto.PrivKey + id []byte } type mockAttestatorsHandler struct { @@ -104,51 +102,23 @@ func NewMockAttestatorsHandler(attestators []mockAttestator) mockAttestatorsHand } } -func (m mockAttestatorsHandler) GetPublicKey(ctx context.Context, attestatorId []byte) (sdkcrypto.PubKey, error) { - attestator, ok := m.attestators[string(attestatorId)] - if !ok { - return nil, fmt.Errorf("attestator not found") - } - return attestator.publicKey, nil -} - func (m mockAttestatorsHandler) SufficientAttestations(_ context.Context, _ [][]byte) (bool, error) { return m.sufficientAttestations() } -func (m mockAttestatorsHandler) getMockAttestator(attestatorId []byte) mockAttestator { - attestator, ok := m.attestators[string(attestatorId)] - if !ok { - panic("attestator not found") - } - return attestator -} - -func (m mockAttestatorsHandler) reSignAttestation(cdc codec.BinaryCodec, attestation *types.Attestation) { - attestator := m.getMockAttestator(attestation.AttestatorId) - signableBytes := lightclient.GetSignableBytes(cdc, attestation.AttestedData) - signature, err := attestator.privateKey.Sign(signableBytes) - if err != nil { - panic(err) - } - attestation.Signature = signature -} - func generateAttestators(n int) []mockAttestator { attestators := make([]mockAttestator, n) for i := 0; i < n; i++ { privKey := secp256k1.GenPrivKey() valAddr := sdk.ValAddress(privKey.PubKey().Address()) attestators[i] = mockAttestator{ - id: valAddr, - publicKey: privKey.PubKey(), - privateKey: privKey, + id: valAddr, } } return attestators } -func generateClientMsg(cdc codec.BinaryCodec, attestators []mockAttestator, numberOfPacketCommitments int, modifiers ...func(dataToAttestTo *types.IBCData)) *lightclient.AttestationClaim { +func generateClientMsg(_ codec.BinaryCodec, attestators []mockAttestator, numberOfPacketCommitments int, modifiers ...func(dataToAttestTo *types.IBCData)) *lightclient.AttestationClaim { attestations := make([]types.Attestation, len(attestators)) packetCommitments := generatePacketCommitments(numberOfPacketCommitments) timestamp := time.Now() @@ -170,17 +140,9 @@ func generateClientMsg(cdc codec.BinaryCodec, attestators []mockAttestator, numb modifier(&attestationData) } - signableBytes := lightclient.GetSignableBytes(cdc, attestationData) - - signature, err := attestator.privateKey.Sign(signableBytes) - if err != nil { - panic(err) - } - attestations[i] = types.Attestation{ AttestatorId: attestator.id, AttestedData: attestationData, - Signature: signature, } } return &lightclient.AttestationClaim{ diff --git a/core/lightclient/update.go b/core/lightclient/update.go index 41529d8..5261792 100644 --- a/core/lightclient/update.go +++ b/core/lightclient/update.go @@ -10,6 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" + + "github.com/cosmos/interchain-attestation/core/types" ) // VerifyClientMessage checks if the clientMessage is the correct type and verifies the message @@ -72,33 +74,17 @@ func (cs *ClientState) verifyAttestationClaim( } // Used to check against all the other attestations to make sure they match - firstSignableBytes := GetSignableBytes(cdc, attestationClaim.Attestations[0].AttestedData) + firstAttestationBytes := types.GetDeterministicAttestationBytes(cdc, attestationClaim.Attestations[0].AttestedData) // check that the attestations are all the same for i, attestation := range attestationClaim.Attestations { - attestator := string(attestation.AttestatorId) - - // verify signature - var signableBytes []byte - if i == 0 { - signableBytes = firstSignableBytes - } else { - signableBytes = GetSignableBytes(cdc, attestation.AttestedData) - } - pubKey, err := attestatorsHandler.GetPublicKey(ctx, attestation.AttestatorId) - if err != nil { - return errorsmod.Wrapf(ErrInvalidClientMsg, "failed to get public key for attestator %s: %s", attestator, err) - } - if verified := pubKey.VerifySignature(signableBytes, attestation.Signature); !verified { - return errorsmod.Wrapf(ErrInvalidClientMsg, "invalid signature from attestator %s", attestator) - } - - // for the rest we just verify against the first attestation, so we skip the first one + // we are going to equals check against the first one, so we skip it here if i == 0 { continue } - if !bytes.Equal(firstSignableBytes, signableBytes) { + attestationBytes := types.GetDeterministicAttestationBytes(cdc, attestation.AttestedData) + if !bytes.Equal(firstAttestationBytes, attestationBytes) { return errorsmod.Wrapf(ErrInvalidClientMsg, "attestations must all be the same") } } diff --git a/core/lightclient/update_test.go b/core/lightclient/update_test.go index e76fb94..26615e4 100644 --- a/core/lightclient/update_test.go +++ b/core/lightclient/update_test.go @@ -99,7 +99,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { RevisionNumber: 1, RevisionHeight: 100000, } - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -109,7 +108,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { 5, func(attestation *types.Attestation) { attestation.AttestedData.Timestamp = attestation.AttestedData.Timestamp.Add(10) - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -119,7 +117,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { 5, func(attestation *types.Attestation) { attestation.AttestedData.PacketCommitments[0] = []byte{0x01} - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -129,7 +126,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { 5, func(attestation *types.Attestation) { attestation.AttestedData.PacketCommitments = append(attestation.AttestedData.PacketCommitments, []byte{0x01}) - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -139,7 +135,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { 5, func(attestation *types.Attestation) { attestation.AttestedData.ChainId = "different chain id" - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -149,7 +144,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { 5, func(attestation *types.Attestation) { attestation.AttestedData.ClientId = "different client id" - attestatorsHandler.reSignAttestation(s.encCfg.Codec, attestation) }, "attestations must all be the same", }, @@ -160,7 +154,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { func(_ *types.Attestation) { for _, attestation := range clientMsg.(*lightclient.AttestationClaim).Attestations { attestation.AttestedData.PacketCommitments[1] = attestation.AttestedData.PacketCommitments[0] - attestatorsHandler.reSignAttestation(s.encCfg.Codec, &attestation) } }, "duplicate packet commitment", @@ -174,26 +167,6 @@ func (s *AttestationLightClientTestSuite) TestVerifyClientMessage() { }, "duplicate attestation from", }, - { - "invalid client message: invalid signature over different bytes", - 10, - 5, - func(attestation *types.Attestation) { - var err error - attestation.Signature, err = attestators[0].privateKey.Sign([]byte("different bytes")) - s.Require().NoError(err) - }, - "invalid signature from attestator", - }, - { - "invalid client message: invalid signature", - 10, - 5, - func(attestation *types.Attestation) { - attestation.Signature = []byte{0x01} - }, - "invalid signature from attestator", - }, { "insufficient number of attestators in claim", 10, diff --git a/core/proto/core/types/v1/attestation.proto b/core/proto/core/types/v1/attestation.proto index 0979f22..2fe16d1 100644 --- a/core/proto/core/types/v1/attestation.proto +++ b/core/proto/core/types/v1/attestation.proto @@ -10,7 +10,6 @@ option go_package = "github.com/cosmos/interchain-attestation/core/types"; message Attestation { bytes attestator_id = 1; IBCData attested_data = 2 [ (gogoproto.nullable) = false ]; - bytes signature = 3; } message IBCData { diff --git a/core/types/attestation.go b/core/types/attestation.go index 6fb33a4..32c3f0f 100644 --- a/core/types/attestation.go +++ b/core/types/attestation.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" ) -func GetSignableBytes(cdc codec.BinaryCodec, dataToAttestTo IBCData) []byte { +func GetDeterministicAttestationBytes(cdc codec.BinaryCodec, dataToAttestTo IBCData) []byte { packetBytes := cdc.MustMarshal(&dataToAttestTo) hash := sha256.Sum256(packetBytes) return hash[:] diff --git a/core/types/attestation.pb.go b/core/types/attestation.pb.go index 8ad08cc..4237549 100644 --- a/core/types/attestation.pb.go +++ b/core/types/attestation.pb.go @@ -31,7 +31,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Attestation struct { AttestatorId []byte `protobuf:"bytes,1,opt,name=attestator_id,json=attestatorId,proto3" json:"attestator_id,omitempty"` AttestedData IBCData `protobuf:"bytes,2,opt,name=attested_data,json=attestedData,proto3" json:"attested_data"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` } func (m *Attestation) Reset() { *m = Attestation{} } @@ -81,13 +80,6 @@ func (m *Attestation) GetAttestedData() IBCData { return IBCData{} } -func (m *Attestation) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - type IBCData struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` @@ -180,34 +172,33 @@ func init() { func init() { proto.RegisterFile("core/types/v1/attestation.proto", fileDescriptor_25eb7c0454d2e150) } var fileDescriptor_25eb7c0454d2e150 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto + // 406 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0x31, 0x6f, 0xd4, 0x30, - 0x14, 0xc7, 0xcf, 0xd7, 0x72, 0xbd, 0xb8, 0x57, 0x04, 0x16, 0x42, 0xe1, 0x40, 0xb9, 0x53, 0x59, - 0x6e, 0xa9, 0xad, 0xa3, 0x0b, 0x6b, 0x53, 0x06, 0x32, 0xb0, 0x44, 0x65, 0x61, 0x89, 0x1c, 0xdb, - 0x24, 0x16, 0x4d, 0x1c, 0x25, 0x2f, 0x27, 0xf1, 0x2d, 0x2a, 0xb1, 0xf0, 0x91, 0x3a, 0x76, 0x64, - 0x02, 0x74, 0xf7, 0x45, 0x50, 0xec, 0x84, 0xc0, 0x66, 0xff, 0xff, 0xbf, 0xe7, 0xf7, 0xde, 0x5f, - 0xc6, 0x2b, 0x61, 0x6a, 0xc5, 0xe0, 0x6b, 0xa5, 0x1a, 0xb6, 0xdb, 0x32, 0x0e, 0xa0, 0x1a, 0xe0, - 0xa0, 0x4d, 0x49, 0xab, 0xda, 0x80, 0x21, 0x67, 0x1d, 0x40, 0x2d, 0x40, 0x77, 0xdb, 0xe5, 0xb3, - 0xcc, 0x64, 0xc6, 0x3a, 0xac, 0x3b, 0x39, 0x68, 0xb9, 0xd2, 0xa9, 0x60, 0xf6, 0x25, 0x71, 0xab, - 0x55, 0x09, 0xdd, 0x53, 0xee, 0x34, 0x00, 0x99, 0x31, 0xd9, 0xad, 0x62, 0xf6, 0x96, 0xb6, 0x9f, - 0x19, 0xe8, 0xa2, 0x6b, 0x54, 0x54, 0x0e, 0x38, 0xff, 0x86, 0xf0, 0xe9, 0xd5, 0xd8, 0x9c, 0xbc, - 0xc6, 0x67, 0xc3, 0x2c, 0xa6, 0x4e, 0xb4, 0xf4, 0xd1, 0x1a, 0x6d, 0x16, 0xf1, 0x62, 0x14, 0x23, - 0x49, 0xae, 0x06, 0x48, 0xc9, 0x44, 0x72, 0xe0, 0xfe, 0x74, 0x8d, 0x36, 0xa7, 0x6f, 0x9e, 0xd3, - 0xff, 0x66, 0xa6, 0x51, 0x78, 0xfd, 0x8e, 0x03, 0x0f, 0x8f, 0xef, 0x7f, 0xae, 0x26, 0xc3, 0x13, - 0x4a, 0x76, 0x1a, 0x79, 0x85, 0xbd, 0x46, 0x67, 0x25, 0x87, 0xb6, 0x56, 0xfe, 0x91, 0xed, 0x31, - 0x0a, 0xe7, 0xdf, 0xa7, 0xf8, 0xa4, 0xaf, 0x26, 0x2f, 0xf0, 0x5c, 0xe4, 0x5c, 0x97, 0xc3, 0x30, - 0x5e, 0x7c, 0x62, 0xef, 0x91, 0x24, 0x2f, 0xb1, 0xe7, 0xb6, 0xed, 0xbc, 0xa9, 0xf5, 0xe6, 0x4e, - 0x88, 0x24, 0xd9, 0xe0, 0x27, 0xbd, 0x09, 0x26, 0x69, 0x2b, 0xc9, 0xc1, 0x35, 0xf2, 0xe2, 0xc7, - 0x4e, 0xbf, 0x31, 0x1f, 0xad, 0x4a, 0xde, 0xe2, 0x59, 0xae, 0x74, 0x96, 0x83, 0x7f, 0x6c, 0xf7, - 0x58, 0x52, 0x9d, 0x0a, 0xb7, 0x4b, 0x1f, 0xe6, 0x6e, 0x4b, 0xdf, 0x5b, 0xa2, 0xdf, 0xa5, 0xe7, - 0x49, 0x88, 0xbd, 0xbf, 0x81, 0xfa, 0x8f, 0xfa, 0x62, 0x17, 0x39, 0x1d, 0x22, 0xa7, 0x37, 0x03, - 0x11, 0xce, 0xbb, 0xe2, 0xbb, 0x5f, 0x2b, 0x14, 0x8f, 0x65, 0xe4, 0x02, 0x93, 0x8a, 0x8b, 0x2f, - 0x0a, 0x12, 0x61, 0x8a, 0x42, 0x43, 0xa1, 0x4a, 0x68, 0xfc, 0xd9, 0xfa, 0x68, 0xb3, 0x88, 0x9f, - 0x3a, 0xe7, 0x7a, 0x34, 0xc2, 0x0f, 0xf7, 0xfb, 0x00, 0x3d, 0xec, 0x03, 0xf4, 0x7b, 0x1f, 0xa0, - 0xbb, 0x43, 0x30, 0x79, 0x38, 0x04, 0x93, 0x1f, 0x87, 0x60, 0xf2, 0xe9, 0x32, 0xd3, 0x90, 0xb7, - 0x29, 0x15, 0xa6, 0x60, 0xc2, 0x34, 0x85, 0x69, 0x98, 0x2e, 0x41, 0xd5, 0x36, 0xad, 0x8b, 0x7f, - 0x7e, 0x18, 0x1b, 0xff, 0x5e, 0x3a, 0xb3, 0x63, 0x5e, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xcd, - 0xe1, 0x09, 0x43, 0x90, 0x02, 0x00, 0x00, + 0x14, 0xc7, 0x93, 0x6b, 0xb9, 0xde, 0xb9, 0x57, 0x04, 0x16, 0x42, 0xe1, 0x90, 0x92, 0x53, 0x59, + 0xb2, 0xd4, 0xd6, 0xd1, 0x85, 0xb5, 0x29, 0x03, 0x19, 0x58, 0xa2, 0xb2, 0xb0, 0x44, 0x8e, 0x6d, + 0x12, 0x8b, 0x26, 0x8e, 0x92, 0x97, 0x93, 0xf8, 0x16, 0x1d, 0xf9, 0x48, 0x1d, 0x6f, 0x64, 0x02, + 0x74, 0xf7, 0x45, 0x50, 0xec, 0x84, 0xc0, 0x66, 0xbf, 0xff, 0xef, 0xbd, 0xf7, 0xf7, 0x5f, 0x46, + 0x01, 0xd7, 0x8d, 0xa4, 0xf0, 0xad, 0x96, 0x2d, 0xdd, 0x6d, 0x29, 0x03, 0x90, 0x2d, 0x30, 0x50, + 0xba, 0x22, 0x75, 0xa3, 0x41, 0xe3, 0x8b, 0x1e, 0x20, 0x06, 0x20, 0xbb, 0xed, 0xfa, 0x45, 0xae, + 0x73, 0x6d, 0x14, 0xda, 0x9f, 0x2c, 0xb4, 0x0e, 0x54, 0xc6, 0xa9, 0x99, 0xc4, 0xef, 0x95, 0xac, + 0xa0, 0x1f, 0x65, 0x4f, 0x23, 0x90, 0x6b, 0x9d, 0xdf, 0x4b, 0x6a, 0x6e, 0x59, 0xf7, 0x85, 0x82, + 0x2a, 0xfb, 0x45, 0x65, 0x6d, 0x81, 0xcb, 0x0e, 0x9d, 0xdf, 0x4c, 0xbb, 0xf1, 0x1b, 0x74, 0x31, + 0x5a, 0xd1, 0x4d, 0xaa, 0x84, 0xe7, 0x6e, 0xdc, 0x70, 0x95, 0xac, 0xa6, 0x62, 0x2c, 0xf0, 0xcd, + 0x08, 0x49, 0x91, 0x0a, 0x06, 0xcc, 0x9b, 0x6d, 0xdc, 0xf0, 0xfc, 0xed, 0x4b, 0xf2, 0x9f, 0x65, + 0x12, 0x47, 0xb7, 0xef, 0x19, 0xb0, 0xe8, 0xf4, 0xf1, 0x67, 0xe0, 0x8c, 0x23, 0xa4, 0xe8, 0x6b, + 0x97, 0xdf, 0x67, 0xe8, 0x6c, 0xd0, 0xf1, 0x2b, 0xb4, 0xe0, 0x05, 0x53, 0xd5, 0xb8, 0x6e, 0x99, + 0x9c, 0x99, 0x7b, 0x2c, 0xf0, 0x6b, 0xb4, 0xb4, 0xcf, 0xe9, 0xb5, 0x99, 0xd1, 0x16, 0xb6, 0x10, + 0x0b, 0x1c, 0xa2, 0x67, 0x83, 0x08, 0x3a, 0xed, 0x6a, 0xc1, 0x40, 0x7a, 0x27, 0x86, 0x79, 0x6a, + 0xeb, 0x77, 0xfa, 0x93, 0xa9, 0xe2, 0x77, 0x68, 0x5e, 0x48, 0x95, 0x17, 0xe0, 0x9d, 0x1a, 0xa7, + 0x6b, 0xa2, 0x32, 0x6e, 0xdd, 0x0e, 0x69, 0xed, 0xb6, 0xe4, 0x83, 0x21, 0x06, 0xb7, 0x03, 0x8f, + 0x23, 0xb4, 0xfc, 0x9b, 0x98, 0xf7, 0x64, 0x68, 0xb6, 0x99, 0x92, 0x31, 0x53, 0x72, 0x37, 0x12, + 0xd1, 0xa2, 0x6f, 0x7e, 0xf8, 0x15, 0xb8, 0xc9, 0xd4, 0x86, 0xaf, 0x10, 0xae, 0x19, 0xff, 0x2a, + 0x21, 0xe5, 0xba, 0x2c, 0x15, 0x94, 0xb2, 0x82, 0xd6, 0x9b, 0x6f, 0x4e, 0xc2, 0x55, 0xf2, 0xdc, + 0x2a, 0xb7, 0x93, 0x10, 0x7d, 0x7c, 0x3c, 0xf8, 0xee, 0xfe, 0xe0, 0xbb, 0xbf, 0x0f, 0xbe, 0xfb, + 0x70, 0xf4, 0x9d, 0xfd, 0xd1, 0x77, 0x7e, 0x1c, 0x7d, 0xe7, 0xf3, 0x75, 0xae, 0xa0, 0xe8, 0x32, + 0xc2, 0x75, 0x49, 0xb9, 0x6e, 0x4b, 0xdd, 0x52, 0x55, 0x81, 0x6c, 0x4c, 0x5a, 0x57, 0xff, 0x7c, + 0x21, 0x3a, 0x7d, 0xae, 0x6c, 0x6e, 0x6c, 0x5e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x15, + 0xa5, 0x24, 0x71, 0x02, 0x00, 0x00, } func (m *Attestation) Marshal() (dAtA []byte, err error) { @@ -230,13 +221,6 @@ func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintAttestation(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1a - } { size, err := m.AttestedData.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -351,10 +335,6 @@ func (m *Attestation) Size() (n int) { } l = m.AttestedData.Size() n += 1 + l + sovAttestation(uint64(l)) - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovAttestation(uint64(l)) - } return n } @@ -491,40 +471,6 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttestation - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAttestation - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAttestation - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAttestation(dAtA[iNdEx:]) diff --git a/core/types/attestation_test.go b/core/types/attestation_test.go index b897c67..9486ff9 100644 --- a/core/types/attestation_test.go +++ b/core/types/attestation_test.go @@ -20,7 +20,7 @@ const ( mockClientID = "testclient-1" ) -func TestGetSignableBytes(t *testing.T) { +func TestGetDeterministicBytes(t *testing.T) { cdc := testutil.MakeTestEncodingConfig().Codec for i := 0; i < 10; i++ { @@ -36,7 +36,7 @@ func TestGetSignableBytes(t *testing.T) { Timestamp: time.Now(), PacketCommitments: packetCommitments, } - expectedSignableBytes := types.GetSignableBytes(cdc, attestationData) + expectedAttestationBytes := types.GetDeterministicAttestationBytes(cdc, attestationData) var signers []*secp256k1.PrivKey for j := 0; j < i; j++ { @@ -45,11 +45,11 @@ func TestGetSignableBytes(t *testing.T) { for j := 0; j < 10; j++ { for _, signer := range signers { - bz := types.GetSignableBytes(cdc, attestationData) + bz := types.GetDeterministicAttestationBytes(cdc, attestationData) require.NotNil(t, bz) // verify bytes are the same every time - require.Equal(t, expectedSignableBytes, bz) + require.Equal(t, expectedAttestationBytes, bz) signature, err := signer.Sign(bz) require.NoError(t, err) diff --git a/core/voteextension/expected_keepers.go b/core/voteextension/expected_keepers.go deleted file mode 100644 index d6e2dd2..0000000 --- a/core/voteextension/expected_keepers.go +++ /dev/null @@ -1,11 +0,0 @@ -package voteextension - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/ibc-go/v9/modules/core/exported" -) - -type ClientKeeper interface { - UpdateClient(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error -} diff --git a/core/voteextension/module.go b/core/voteextension/module.go index 78acdcb..d16eced 100644 --- a/core/voteextension/module.go +++ b/core/voteextension/module.go @@ -15,6 +15,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cometbft/cometbft/libs/json" + + lightclient "github.com/cosmos/interchain-attestation/core/lightclient" ) const ModuleName = "attestationvoteextension" @@ -49,22 +51,22 @@ type AppModule struct { AppModuleBasic // TODO: Should we just move this stuff into a keeper, or is it fine here? - sidecarAddress string - clientKeeper ClientKeeper - cdc codec.Codec + sidecarAddress string + trustedUpdateClientFunc lightclient.TrustedClientUpdateFunc + cdc codec.Codec // Create lazily sidecarGrpcClient *grpc.ClientConn } // NewAppModule creates a new attestation vote extension AppModule -func NewAppModule(clientKeeper ClientKeeper, cdc codec.Codec) AppModule { +func NewAppModule(trustedUpdateClientFunc lightclient.TrustedClientUpdateFunc, cdc codec.Codec) AppModule { sidecarAddress := os.Getenv(SidecarAddressEnv) return AppModule{ - sidecarAddress: sidecarAddress, - clientKeeper: clientKeeper, - cdc: cdc, + sidecarAddress: sidecarAddress, + trustedUpdateClientFunc: trustedUpdateClientFunc, + cdc: cdc, } } diff --git a/core/voteextension/testutil/expected_keepers_mocks.go b/core/voteextension/testutil/expected_keepers_mocks.go deleted file mode 100644 index e01e3a8..0000000 --- a/core/voteextension/testutil/expected_keepers_mocks.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: voteextension/expected_keepers.go - -// Package testutil is a generated GoMock package. -package testutil - -import ( - reflect "reflect" - - types "github.com/cosmos/cosmos-sdk/types" - exported "github.com/cosmos/ibc-go/v9/modules/core/exported" - gomock "github.com/golang/mock/gomock" -) - -// MockClientKeeper is a mock of ClientKeeper interface. -type MockClientKeeper struct { - ctrl *gomock.Controller - recorder *MockClientKeeperMockRecorder -} - -// MockClientKeeperMockRecorder is the mock recorder for MockClientKeeper. -type MockClientKeeperMockRecorder struct { - mock *MockClientKeeper -} - -// NewMockClientKeeper creates a new mock instance. -func NewMockClientKeeper(ctrl *gomock.Controller) *MockClientKeeper { - mock := &MockClientKeeper{ctrl: ctrl} - mock.recorder = &MockClientKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockClientKeeper) EXPECT() *MockClientKeeperMockRecorder { - return m.recorder -} - -// UpdateClient mocks base method. -func (m *MockClientKeeper) UpdateClient(ctx types.Context, clientID string, clientMsg exported.ClientMessage) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateClient", ctx, clientID, clientMsg) - ret0, _ := ret[0].(error) - return ret0 -} - -// UpdateClient indicates an expected call of UpdateClient. -func (mr *MockClientKeeperMockRecorder) UpdateClient(ctx, clientID, clientMsg interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClient", reflect.TypeOf((*MockClientKeeper)(nil).UpdateClient), ctx, clientID, clientMsg) -} diff --git a/core/voteextension/voteextension.go b/core/voteextension/voteextension.go index 13cb226..e9e6a81 100644 --- a/core/voteextension/voteextension.go +++ b/core/voteextension/voteextension.go @@ -178,8 +178,14 @@ func (a AppModule) ProcessProposal(ctx sdk.Context, req *abci.RequestProcessProp // TODO: Document // Contract: We do not need to check if vote extensions are enabled as that is dealt with by the top level handler func (a AppModule) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock, i int) error { - // Extract "fake tx" and send an update client msg to the light client + // If something panics here, don't panic the app + defer func() { + if r := recover(); r != nil { + ctx.Logger().Error("AttestationVoteExtension: PreBlocker (panic recovered)", "panic", r) + } + }() + // Extract "fake tx" and send an update client msg to the light client ctx.Logger().Info("AttestationVoteExtension: PreBlocker") if len(req.Txs) == 0 { @@ -195,7 +201,7 @@ func (a AppModule) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock, i } for _, clientUpdate := range clientUpdates.ClientUpdates { - if err := a.clientKeeper.UpdateClient(ctx, clientUpdate.ClientToUpdate, &clientUpdate.AttestationClaim); err != nil { + if err := a.trustedUpdateClientFunc(ctx, clientUpdate.ClientToUpdate, &clientUpdate.AttestationClaim); err != nil { ctx.Logger().Error("failed to update client", "error", err, "client_id", clientUpdate.ClientToUpdate) } diff --git a/core/voteextension/voteextension_test.go b/core/voteextension/voteextension_test.go index 65d3f63..828783b 100644 --- a/core/voteextension/voteextension_test.go +++ b/core/voteextension/voteextension_test.go @@ -7,51 +7,58 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "golang.org/x/exp/rand" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" abci "github.com/cometbft/cometbft/abci/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v9/modules/core/exported" + lightclient "github.com/cosmos/interchain-attestation/core/lightclient" "github.com/cosmos/interchain-attestation/core/types" "github.com/cosmos/interchain-attestation/core/voteextension" "github.com/cosmos/interchain-attestation/core/voteextension/testutil" ) -func TestExtendVote(t *testing.T) { - testKey := storetypes.NewKVStoreKey("upgrade") - ctx := sdktestutil.DefaultContext(testKey, storetypes.NewTransientStoreKey("transient_test")) +type VoteExtensionTestSuite struct { + suite.Suite + + ctx sdk.Context + encodingCfg moduletestutil.TestEncodingConfig + mockServer *testutil.Server + appModule voteextension.AppModule + mockUpdateFunc lightclient.TrustedClientUpdateFunc +} + +func (s *VoteExtensionTestSuite) SetupSuite() { + s.encodingCfg = moduletestutil.MakeTestEncodingConfig() randomPort := rand.Intn(65535-49152) + 49152 addr := fmt.Sprintf("localhost:%d", randomPort) - mockServer := testutil.NewServer() + s.mockServer = testutil.NewServer() wg := sync.WaitGroup{} wg.Add(1) go func() { - err := mockServer.Serve(addr) - require.NoError(t, err) + err := s.mockServer.Serve(addr) + require.NoError(s.T(), err) wg.Done() }() time.Sleep(1 * time.Second) err := os.Setenv(voteextension.SidecarAddressEnv, addr) - require.NoError(t, err) + require.NoError(s.T(), err) - ctrl := gomock.NewController(t) - clientKeeper := testutil.NewMockClientKeeper(ctrl) - - encodingCfg := moduletestutil.MakeTestEncodingConfig() - appModule := voteextension.NewAppModule(clientKeeper, encodingCfg.Codec) - - mockServer.Response = &types.GetAttestationsResponse{ + s.mockServer.Response = &types.GetAttestationsResponse{ Attestations: []types.Attestation{ { AttestatorId: []byte("mock-attestor-id"), @@ -66,27 +73,111 @@ func TestExtendVote(t *testing.T) { []byte("pckt2"), }, }, - Signature: []byte("sig"), }, }, } - responseExtendVote, err := appModule.ExtendVote(ctx, &abci.RequestExtendVote{}) - require.NoError(t, err) - require.NotEmpty(t, responseExtendVote.VoteExtension) + + s.mockUpdateFunc = nilUpdateFunc // Default to no updates, change in test if you need another + s.appModule = voteextension.NewAppModule(func(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { + return s.mockUpdateFunc(ctx, clientID, clientMsg) + }, s.encodingCfg.Codec) + + testKey := storetypes.NewKVStoreKey("upgrade") + s.ctx = sdktestutil.DefaultContext(testKey, storetypes.NewTransientStoreKey("transient_test")).WithLogger(log.NewLogger(os.Stdout)) +} + +func TestVoteExtensionTestSuite(t *testing.T) { + suite.Run(t, new(VoteExtensionTestSuite)) +} + +var nilUpdateFunc = func(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { + return nil +} + +// panicUpdateFunc can be used for tests that want to ensure the update function is never called +var panicUpdateFunc = func(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { + panic("should-not-happen") +} + +func (s *VoteExtensionTestSuite) TestExtendVote() { + responseExtendVote, err := s.appModule.ExtendVote(s.ctx, &abci.RequestExtendVote{}) + require.NoError(s.T(), err) + require.NotEmpty(s.T(), responseExtendVote.VoteExtension) var voteExt voteextension.VoteExtension - err = encodingCfg.Codec.Unmarshal(responseExtendVote.VoteExtension, &voteExt) - require.NoError(t, err) - require.Len(t, voteExt.Attestations, 1) - require.Equal(t, mockServer.Response.Attestations[0].AttestatorId, voteExt.Attestations[0].AttestatorId) - require.Equal(t, mockServer.Response.Attestations[0].Signature, voteExt.Attestations[0].Signature) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.ChainId, voteExt.Attestations[0].AttestedData.ChainId) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.ClientId, voteExt.Attestations[0].AttestedData.ClientId) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.ClientToUpdate, voteExt.Attestations[0].AttestedData.ClientToUpdate) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.Height, voteExt.Attestations[0].AttestedData.Height) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.Timestamp.UnixNano(), voteExt.Attestations[0].AttestedData.Timestamp.UnixNano()) - - require.Len(t, voteExt.Attestations[0].AttestedData.PacketCommitments, 2) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.PacketCommitments[0], voteExt.Attestations[0].AttestedData.PacketCommitments[0]) - require.Equal(t, mockServer.Response.Attestations[0].AttestedData.PacketCommitments[1], voteExt.Attestations[0].AttestedData.PacketCommitments[1]) + err = s.encodingCfg.Codec.Unmarshal(responseExtendVote.VoteExtension, &voteExt) + require.NoError(s.T(), err) + require.Len(s.T(), voteExt.Attestations, 1) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestatorId, voteExt.Attestations[0].AttestatorId) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.ChainId, voteExt.Attestations[0].AttestedData.ChainId) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.ClientId, voteExt.Attestations[0].AttestedData.ClientId) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.ClientToUpdate, voteExt.Attestations[0].AttestedData.ClientToUpdate) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.Height, voteExt.Attestations[0].AttestedData.Height) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.Timestamp.UnixNano(), voteExt.Attestations[0].AttestedData.Timestamp.UnixNano()) + + require.Len(s.T(), voteExt.Attestations[0].AttestedData.PacketCommitments, 2) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.PacketCommitments[0], voteExt.Attestations[0].AttestedData.PacketCommitments[0]) + require.Equal(s.T(), s.mockServer.Response.Attestations[0].AttestedData.PacketCommitments[1], voteExt.Attestations[0].AttestedData.PacketCommitments[1]) +} + +func (s *VoteExtensionTestSuite) TestPreBlocker() { + // TODO: Add a mocked light client to test with + tests := []struct { + name string + clientUpdates *voteextension.ClientUpdates + mockUpdateFunc lightclient.TrustedClientUpdateFunc + }{ + { + "success: no attestation tx", + nil, + panicUpdateFunc, + }, + { + "success: empty attestation list in tx", + &voteextension.ClientUpdates{}, + panicUpdateFunc, + }, + { + "success: panic on update should not panic the app", + &voteextension.ClientUpdates{ + ClientUpdates: []voteextension.ClientUpdate{ + { + ClientToUpdate: "non-existent", + AttestationClaim: lightclient.AttestationClaim{ + Attestations: []types.Attestation{ + { + AttestatorId: []byte("whatever"), + AttestedData: types.IBCData{ + ChainId: "whateverchain", + ClientId: "whateverclient", + ClientToUpdate: "non-existent", + Height: clienttypes.Height{}, + Timestamp: time.Now(), + PacketCommitments: [][]byte{}, + }, + }, + }, + }, + }, + }, + }, + panicUpdateFunc, + }, + } + + for _, tt := range tests { + s.Run(tt.name, func() { + req := &abci.RequestFinalizeBlock{ + Txs: [][]byte{}, + } + if tt.clientUpdates != nil { + txBz, err := s.encodingCfg.Codec.Marshal(tt.clientUpdates) + s.Require().NoError(err) + req.Txs = append(req.Txs, txBz) + } + s.mockUpdateFunc = tt.mockUpdateFunc + err := s.appModule.PreBlocker(s.ctx, req, 0) + require.NoError(s.T(), err) + }) + } } diff --git a/docs/docs/architecture/configmodule.md b/docs/docs/architecture/configmodule.md index e431d3a..de3d065 100644 --- a/docs/docs/architecture/configmodule.md +++ b/docs/docs/architecture/configmodule.md @@ -7,11 +7,9 @@ sidebar_position: 2 The Attestation Config Module is a Cosmos SDK module that allows for configurable security requirements for the Interchain Attestation system. It has the following responsibilities: -* Registering and keeping track of validator attestation signing keys * Registering and keeping track of chains/clients that are registered for attestation with configuration details * Providing the light client with the data and integration points to the chain it needs: - * Validator signing keys * Validating required security backing of an attestation (i.e. is there enough voting power behind the attestation) * Any chain native capabilities like slashing or incentives -TODO: Add illustration with actors and interactions \ No newline at end of file +TODO: Add illustration with actors and interactions diff --git a/docs/docs/architecture/sidecar.md b/docs/docs/architecture/sidecar.md index d14d485..5eec5ff 100644 --- a/docs/docs/architecture/sidecar.md +++ b/docs/docs/architecture/sidecar.md @@ -9,7 +9,7 @@ The sidecar is used by the chain node to fetch attestations during vote extensio The sidecar is configured by the validator to connect to counterparty chains and will run in the background to continuously fetch and generate attestations. -The sidecar is implemented as a CLI binary that can perform multiple tasks, such as setting up signing keys, creating validator registration files, and starting the attestation process. +The sidecar is implemented as a CLI binary that can perform multiple tasks, such as setting up an IBC connection and starting the attestation process. In addition, the sidecar also enables relaying of IBC packets (exact capabilities TBD). @@ -17,7 +17,6 @@ The Attestation Sidecar is responsible for the following: * Fetching attestation data from the counterparty chain * Packet commitments * Header information -* Signing attestations * Serving attestations to the chain node via a GRPC server ## Configuration @@ -31,4 +30,4 @@ as part of its running process. ## CLI -TODO: Document the commands \ No newline at end of file +TODO: Document the commands diff --git a/docs/docs/architecture/system-architecture-and-flow.md b/docs/docs/architecture/system-architecture-and-flow.md index 0d054d9..4f3c474 100644 --- a/docs/docs/architecture/system-architecture-and-flow.md +++ b/docs/docs/architecture/system-architecture-and-flow.md @@ -9,11 +9,11 @@ sidebar_position: 1 Interchain Attestation is composed of a few different components that work together to let validators safely attest to the state of a counterparty chain. The main components, in "chronological order" are: * Attestation Config Module - * Validators register their signing keys * Chains/clients are registered for attestation with configuration details + * Verifies that attestation sets follow the configured rules (e.g. enough voting power has voted) * Attestation Sidecar - * Validators run a sidecar that reads counterparty chain information, and generates signed attestations - * The sidecar also hosts a GRPC server that can be queried for attestations (used by the chain node to fetch attestations during vote extensions) + * Validators run a sidecar that reads counterparty chain information, and generates attestations + * GRPC server that serves attestations (used by the chain node to fetch attestations during vote extensions) * Vote Extensions * Uses the ABCI++ interface with vote extensions to fetch attestations from the sidecar * Attestations are aggregated from all the validators, and sent to the light client for verification and client updates @@ -35,16 +35,15 @@ A few things need to happen before packets can flow between chains: 2. Clients are created on both chains, and registered with the Attestation Config Module * ⚠️For v1, pre-Eureka, we also need to create connections and channels. * In v2, only IBC Eureka is supported, and connections and channels are finally a thing of the past. -3. Validators are registered with their attestation signing keys on the Attestation Config Module -4. Sufficient Validators have signed up to attest to the counterparty chain (if the configuration requires it) -5. Validators have configured and started up their Attestation Sidecar process +3. Sufficient Validators have signed up to attest to the counterparty chain (if the configuration requires it) +4. Validators have configured and started up their Attestation Sidecar process ### Normal operation At this point, we have clients on both chains, and validators who are expected to attest to the counterparty chain. The flow of the system for the client to get updated is as follows: -1. The sidecar process reads all configured counterparty chain states, generates attestations, signs them and stores them in the sidecar database +1. The sidecar process reads all configured counterparty chain states, generates attestations, and stores them in the sidecar database 2. The ABCI++ Vote Extensions query the sidecar for the latest attestations 3. The Vote Extensions aggregate the attestations from all the validators, and send them to the light client 4. The light client verifies the attestations, and updates the client state and consensus state with the packet commitments diff --git a/docs/docs/intro.md b/docs/docs/intro.md index bf9ca45..6ba8332 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -18,8 +18,8 @@ and the validators using Interchain Attestation are attesting to the state of th High level, Interchain Attestation uses the validators to attest to the state of the counterparty chain. The validators are running a sidecar process, and a full node of the counterparty chain. The sidecar process reads the state of the -counterparty chain, and the full node validates the state of the counterparty chain. The validators then sign the -attestation, and the attestation is fetched, validated and aggregated by the node binary using ABCI++ Vote Extensions. +counterparty chain, and the full node validates the state of the counterparty chain. The validators then fetch the +attestation and aggregates them in the node binary using ABCI++ Vote Extensions. ![How it works on a high level](../static/img/attest.png) @@ -30,4 +30,4 @@ A talk about the project from Modular Summit (this was before the name change fr TODO: Use cases (maybe a separate page?) -TODO: Links to other pages (for validators, for chain developers, etc.) \ No newline at end of file +TODO: Links to other pages (for validators, for chain developers, etc.) diff --git a/sidecar/attestators/coordinator.go b/sidecar/attestators/coordinator.go index 6630628..80a16d5 100644 --- a/sidecar/attestators/coordinator.go +++ b/sidecar/attestators/coordinator.go @@ -39,11 +39,6 @@ type coordinator struct { var _ Coordinator = &coordinator{} func NewCoordinator(logger *zap.Logger, db *badger.DB, sidecarConfig config.Config) (Coordinator, error) { - attestatorSigningKey, err := AttestatorSigningKeyFromConfig(cosmos.NewCodecConfig().Marshaler, sidecarConfig) - if err != nil { - return nil, err - } - chainProvers := make(map[string]attestator.Attestator) for _, cosmosConfig := range sidecarConfig.CosmosChains { if !cosmosConfig.Attestation { @@ -55,7 +50,6 @@ func NewCoordinator(logger *zap.Logger, db *badger.DB, sidecarConfig config.Conf logger, sidecarConfig.AttestatorID, cosmosConfig, - attestatorSigningKey.Sign, ) if err != nil { return nil, err diff --git a/sidecar/attestators/coordinator_test.go b/sidecar/attestators/coordinator_test.go index a5e5939..d3ba0d2 100644 --- a/sidecar/attestators/coordinator_test.go +++ b/sidecar/attestators/coordinator_test.go @@ -17,11 +17,10 @@ import ( ) const ( - mockChainID = "mockChainID" - mockClientID = "mockClientID" - mockClientToUpdate = "mockClientToUpdate" - mockAttestatorID = "mockAttestatorID" - mockAttestatorSignature = "mockAttestatorSignature" + mockChainID = "mockChainID" + mockClientID = "mockClientID" + mockClientToUpdate = "mockClientToUpdate" + mockAttestatorID = "mockAttestatorID" ) var mockPacketCommits = [][]byte{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} @@ -52,7 +51,6 @@ func (m *MockChainAttestator) CollectAttestation(ctx context.Context) (types.Att Timestamp: m.Timestamp, PacketCommitments: mockPacketCommits, }, - Signature: []byte(mockAttestatorSignature), }, nil } @@ -100,7 +98,6 @@ func TestCoordinator_Run(t *testing.T) { require.Equal(t, height, latestAttestations[0].AttestedData.Height.RevisionHeight) require.Equal(t, mockPacketCommits, latestAttestations[0].AttestedData.PacketCommitments) require.Equal(t, mockAttestatorID, string(latestAttestations[0].AttestatorId)) - require.Equal(t, mockAttestatorSignature, string(latestAttestations[0].Signature)) require.Equal(t, mockChainID, latestAttestations[0].AttestedData.ChainId) require.Equal(t, mockClientID, latestAttestations[0].AttestedData.ClientId) require.Equal(t, mockClientToUpdate, latestAttestations[0].AttestedData.ClientToUpdate) diff --git a/sidecar/attestators/cosmos/attestation_collection.go b/sidecar/attestators/cosmos/attestation_collection.go index b5b572f..ea6f261 100644 --- a/sidecar/attestators/cosmos/attestation_collection.go +++ b/sidecar/attestators/cosmos/attestation_collection.go @@ -8,7 +8,6 @@ import ( chantypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - "github.com/cosmos/interchain-attestation/core/lightclient" "github.com/cosmos/interchain-attestation/core/types" ) @@ -53,7 +52,7 @@ func (c *Attestator) CollectAttestation(ctx context.Context) (types.Attestation, PacketCommitments: packetCommitments, } - c.logger.Debug("Signing attestation data", + c.logger.Debug("Generated attestation data", zap.String("chain_id", c.config.ChainID), zap.String("client_id", c.config.ClientID), zap.String("client_to_update", c.config.ClientToUpdate), @@ -62,16 +61,9 @@ func (c *Attestator) CollectAttestation(ctx context.Context) (types.Attestation, zap.Int("packet_commitments", len(packetCommitments)), ) - signableBytes := lightclient.GetSignableBytes(c.codec.Marshaler, attestationData) - signature, err := c.signer(signableBytes) - if err != nil { - return types.Attestation{}, errors.Errorf("failed to sign attestation data for client id %s on chain id %s: %w", c.config.ClientID, c.config.ChainID, err) - } - attestation := types.Attestation{ AttestatorId: []byte(c.attestatorID), AttestedData: attestationData, - Signature: signature, } return attestation, nil diff --git a/sidecar/attestators/cosmos/attestor.go b/sidecar/attestators/cosmos/attestor.go index 5bda899..1464021 100644 --- a/sidecar/attestators/cosmos/attestor.go +++ b/sidecar/attestators/cosmos/attestor.go @@ -21,10 +21,9 @@ type Attestator struct { attestatorID string config config.CosmosChainConfig - signer func(msg []byte) ([]byte, error) } -func NewCosmosAttestator(logger *zap.Logger, attestatorID string, config config.CosmosChainConfig, signer func(msg []byte) ([]byte, error)) (*Attestator, error) { +func NewCosmosAttestator(logger *zap.Logger, attestatorID string, config config.CosmosChainConfig) (*Attestator, error) { cometClient, err := clientwrapper.NewClient(config.RPC, time.Second*30) // TODO: Make timeout configurable per chain if err != nil { return nil, err @@ -46,7 +45,6 @@ func NewCosmosAttestator(logger *zap.Logger, attestatorID string, config config. attestatorID: attestatorID, config: config, - signer: signer, }, nil } diff --git a/sidecar/attestators/signing_key.go b/sidecar/attestators/signing_key.go deleted file mode 100644 index 93eaee0..0000000 --- a/sidecar/attestators/signing_key.go +++ /dev/null @@ -1,84 +0,0 @@ -package attestators - -import ( - "os" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - - "github.com/cosmos/interchain-attestation/sidecar/config" -) - -const ( - DefaultSigningPubKeyFileName = "signing_pub_key.json" - DefaultSigningPrivKeyFileName = "signing_priv_key.json" -) - -type AttestatorSigningKey struct { - PubKey cryptotypes.PubKey - PrivKey cryptotypes.PrivKey -} - -func GenerateAttestatorSigningKey() (AttestatorSigningKey, error) { - privKey := secp256k1.GenPrivKey() - pubKey := privKey.PubKey() - - return AttestatorSigningKey{ - PrivKey: privKey, - PubKey: pubKey, - }, nil -} - -func AttestatorSigningKeyFromConfig(cdc codec.Codec, cfg config.Config) (AttestatorSigningKey, error) { - signingPrivKeyJSON, err := os.ReadFile(cfg.SigningPrivateKeyPath) - if err != nil { - return AttestatorSigningKey{}, err - } - - return AttestatorSigningKeyFromJSON(cdc, signingPrivKeyJSON) -} - -func AttestatorSigningKeyFromJSON(cdc codec.Codec, privKeyJSON []byte) (AttestatorSigningKey, error) { - var privKeyAny codectypes.Any - err := cdc.UnmarshalJSON(privKeyJSON, &privKeyAny) - if err != nil { - return AttestatorSigningKey{}, err - } - - var privKey cryptotypes.PrivKey - err = cdc.UnpackAny(&privKeyAny, &privKey) - if err != nil { - return AttestatorSigningKey{}, err - } - - pubKey := privKey.PubKey() - - return AttestatorSigningKey{ - PrivKey: privKey, - PubKey: pubKey, - }, nil -} - -func (a AttestatorSigningKey) PubKeyJSON(cdc codec.Codec) ([]byte, error) { - pubKeyAny, err := codectypes.NewAnyWithValue(a.PubKey) - if err != nil { - return nil, err - } - - return cdc.MarshalJSON(pubKeyAny) -} - -func (a AttestatorSigningKey) PrivKeyJSON(cdc codec.Codec) ([]byte, error) { - privKeyAny, err := codectypes.NewAnyWithValue(a.PrivKey) - if err != nil { - return nil, err - } - - return cdc.MarshalJSON(privKeyAny) -} - -func (a AttestatorSigningKey) Sign(msg []byte) ([]byte, error) { - return a.PrivKey.Sign(msg) -} diff --git a/sidecar/attestators/signing_key_test.go b/sidecar/attestators/signing_key_test.go deleted file mode 100644 index 3b2c825..0000000 --- a/sidecar/attestators/signing_key_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package attestators_test - -import ( - "encoding/base64" - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/interchain-attestation/sidecar/attestators" - "github.com/cosmos/interchain-attestation/sidecar/attestators/cosmos" -) - -func TestAttestatorSigningKeyJSON(t *testing.T) { - encodingConfig := cosmos.NewCodecConfig() - cdc := encodingConfig.Marshaler - - attestatorSigningKey, err := attestators.GenerateAttestatorSigningKey() - require.NoError(t, err) - - pubKeyJSON, err := attestatorSigningKey.PubKeyJSON(cdc) - require.NoError(t, err) - require.Equal(t, - fmt.Sprintf( - `{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"%s"}`, - base64.StdEncoding.EncodeToString(attestatorSigningKey.PubKey.Bytes()), - ), - string(pubKeyJSON), - ) - - privKeyJSON, err := attestatorSigningKey.PrivKeyJSON(cdc) - require.NoError(t, err) - require.Equal(t, - fmt.Sprintf( - `{"@type":"/cosmos.crypto.secp256k1.PrivKey","key":"%s"}`, - base64.StdEncoding.EncodeToString(attestatorSigningKey.PrivKey.Bytes()), - ), - string(privKeyJSON), - ) - - attestatorSigningKey2, err := attestators.AttestatorSigningKeyFromJSON(cdc, privKeyJSON) - require.NoError(t, err) - require.Equal(t, attestatorSigningKey, attestatorSigningKey2) -} diff --git a/sidecar/cmd/register_attestor_json.go b/sidecar/cmd/register_attestor_json.go deleted file mode 100644 index 13add7c..0000000 --- a/sidecar/cmd/register_attestor_json.go +++ /dev/null @@ -1,54 +0,0 @@ -package cmd - -import ( - "encoding/base64" - "fmt" - - "github.com/spf13/cobra" - - "github.com/cometbft/cometbft/libs/json" - - "github.com/cosmos/interchain-attestation/core/types" - "github.com/cosmos/interchain-attestation/sidecar/attestators" - "github.com/cosmos/interchain-attestation/sidecar/attestators/cosmos" -) - -func GenerateRegisterAttestatorJSONCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "generate-register-attestator-json", - Short: "generate json used to register an attestator on-chain", - RunE: func(cmd *cobra.Command, args []string) error { - config := GetConfig(cmd) - - attestatorID := config.AttestatorID - attestatorIDBase64 := base64.StdEncoding.EncodeToString([]byte(attestatorID)) - - cdc := cosmos.NewCodecConfig().Marshaler - attestatorSigningKey, err := attestators.AttestatorSigningKeyFromConfig(cdc, config) - if err != nil { - return err - } - - pubKey, err := attestatorSigningKey.PubKeyJSON(cdc) - if err != nil { - return err - } - - attestatorRegistrationJSON := types.AttestatorRegistrationJson{ - AttestatorID: attestatorIDBase64, - AttestationPublicKey: pubKey, - } - - jsonBz, err := json.Marshal(attestatorRegistrationJSON) - if err != nil { - return err - } - - fmt.Println(string(jsonBz)) - - return nil - }, - } - - return cmd -} diff --git a/sidecar/cmd/root.go b/sidecar/cmd/root.go index b898373..239f342 100644 --- a/sidecar/cmd/root.go +++ b/sidecar/cmd/root.go @@ -136,9 +136,7 @@ func RootCmd() *cobra.Command { keysCmd, StartCmd(), ConfigCmd(), - SigningKeysCmd(), RelayerCmd(), - GenerateRegisterAttestatorJSONCmd(), ) userHomeDir, err := os.UserHomeDir() diff --git a/sidecar/cmd/signing_keys.go b/sidecar/cmd/signing_keys.go deleted file mode 100644 index 427126b..0000000 --- a/sidecar/cmd/signing_keys.go +++ /dev/null @@ -1,77 +0,0 @@ -package cmd - -import ( - "fmt" - "os" - "path" - - "github.com/spf13/cobra" - - "github.com/cosmos/interchain-attestation/sidecar/attestators" - "github.com/cosmos/interchain-attestation/sidecar/attestators/cosmos" -) - -const ( - signingKeysCommandName = "signing-keys" -) - -func SigningKeysCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: signingKeysCommandName, - Short: fmt.Sprintf("%s subcommands", signingKeysCommandName), - } - - cmd.AddCommand(CreateSigningKeyCmd()) - - return cmd -} - -func CreateSigningKeyCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "create", - Short: fmt.Sprintf("create a new signing key and writes it to %s and %s", attestators.DefaultSigningPubKeyFileName, attestators.DefaultSigningPrivKeyFileName), - RunE: func(cmd *cobra.Command, args []string) error { - homedir := GetHomedir(cmd) - config := GetConfig(cmd) - - signingKey, err := attestators.GenerateAttestatorSigningKey() - if err != nil { - return err - } - - encodingConfig := cosmos.NewCodecConfig() - cdc := encodingConfig.Marshaler - - // json encoding - pubKeyJSON, err := signingKey.PubKeyJSON(cdc) - if err != nil { - return err - } - privKeyJSON, err := signingKey.PrivKeyJSON(cdc) - if err != nil { - return err - } - - // write to files - pubKeyFullPath := path.Join(homedir, attestators.DefaultSigningPubKeyFileName) - privKeyFullPath := path.Join(homedir, attestators.DefaultSigningPrivKeyFileName) - - if err := os.WriteFile(pubKeyFullPath, pubKeyJSON, 0o600); err != nil { - return err - } - if err := os.WriteFile(privKeyFullPath, privKeyJSON, 0o600); err != nil { - return err - } - config.SigningPrivateKeyPath = privKeyFullPath - if err := config.Save(); err != nil { - return err - } - - fmt.Printf("Generated %s and %s, as well as updated the config file with the path to the private key\n", pubKeyFullPath, privKeyFullPath) - - return nil - }, - } - - return cmd -} diff --git a/sidecar/config/config.go b/sidecar/config/config.go index fd963ba..b63f57b 100644 --- a/sidecar/config/config.go +++ b/sidecar/config/config.go @@ -15,9 +15,8 @@ const ( ) type Config struct { - AttestatorID string `toml:"attestator_id"` - SigningPrivateKeyPath string `toml:"private_key_path"` - CosmosChains []CosmosChainConfig `toml:"cosmos_chain"` + AttestatorID string `toml:"attestator_id"` + CosmosChains []CosmosChainConfig `toml:"cosmos_chain"` configFilePath string } @@ -86,10 +85,6 @@ func (c Config) Validate() error { if c.AttestatorID == "" { return errors.New("attestator id cannot be empty if any chains have attestation true") } - - if c.SigningPrivateKeyPath == "" { - return errors.New("private key path cannot be empty if any chains have attestation true") - } } return nil @@ -132,8 +127,7 @@ func InitConfig(homedir string, force bool) (string, error) { } config := Config{ - AttestatorID: "your-attestator-id", - SigningPrivateKeyPath: "/path/to/your/private/signing/key.json", + AttestatorID: "your-attestator-id", CosmosChains: []CosmosChainConfig{ { ChainID: "chain-to-attest-1", diff --git a/sidecar/config/config_test.go b/sidecar/config/config_test.go index aebc05c..57793c0 100644 --- a/sidecar/config/config_test.go +++ b/sidecar/config/config_test.go @@ -43,16 +43,14 @@ func TestConfig_Validate(t *testing.T) { GasAdjustment: 0, }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "", }, { name: "empty chains", config: Config{ - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "at least one chain must be defined in the config", }, @@ -65,8 +63,7 @@ func TestConfig_Validate(t *testing.T) { RPC: "http://localhost:26657", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "chain id cannot be empty", }, @@ -82,8 +79,7 @@ func TestConfig_Validate(t *testing.T) { ClientToUpdate: "client1", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "client id cannot be empty when attestation is true", }, @@ -99,8 +95,7 @@ func TestConfig_Validate(t *testing.T) { ClientToUpdate: "", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "client to update cannot be empty when attestation is true", }, @@ -113,8 +108,7 @@ func TestConfig_Validate(t *testing.T) { RPC: "", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "rpc address cannot be empty", }, @@ -134,8 +128,7 @@ func TestConfig_Validate(t *testing.T) { ChainID: "chain1", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "duplicate chain id", }, @@ -158,8 +151,7 @@ func TestConfig_Validate(t *testing.T) { ClientToUpdate: "client1", }, }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "some/path", + AttestatorID: "test-attestator-id", }, expErr: "duplicate client to update", }, @@ -180,33 +172,10 @@ func TestConfig_Validate(t *testing.T) { Attestation: false, }, }, - AttestatorID: "", - SigningPrivateKeyPath: "some/path", + AttestatorID: "", }, expErr: "attestator id cannot be empty if any chains have attestation true", }, - { - name: "empty signing private key path if any chain have attestation true", - config: Config{ - CosmosChains: []CosmosChainConfig{ - { - ChainID: "chain1", - RPC: "http://localhost:26657", - ClientID: "client1", - Attestation: true, - ClientToUpdate: "client1", - }, - { - ChainID: "chain2", - RPC: "http://localhost:26658", - Attestation: false, - }, - }, - AttestatorID: "test-attestator-id", - SigningPrivateKeyPath: "", - }, - expErr: "private key path cannot be empty if any chains have attestation true", - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/sidecar/register-attestor.json b/sidecar/register-attestor.json deleted file mode 100644 index 779597c..0000000 --- a/sidecar/register-attestor.json +++ /dev/null @@ -1 +0,0 @@ -{"attestator-id":"eW91ci1hdHRlc3RhdG9yLWlk","attestation-public-key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AkMIdx2z1dKWFXSIIKMa6UEWw0qrtDnYmPp5MMi1PUFQ"}} \ No newline at end of file diff --git a/sidecar/server/server_test.go b/sidecar/server/server_test.go index 8e56531..16c7796 100644 --- a/sidecar/server/server_test.go +++ b/sidecar/server/server_test.go @@ -25,7 +25,6 @@ const ( mockChainID = "mockChainID" mockClientID = "mockClientID" mockChainAttestatorID = "mockChainAttestatorID" - mockSignature = "mockSignature" ) type mockCoordinator struct{} @@ -56,7 +55,6 @@ func (m mockCoordinator) GetLatestAttestations() ([]types.Attestation, error) { Timestamp: time.Now(), PacketCommitments: [][]byte{{0x01}, {0x02}, {0x03}}, }, - Signature: []byte(mockSignature), }, }, nil } @@ -101,7 +99,6 @@ func TestServe(t *testing.T) { require.Equal(t, []byte(mockChainAttestatorID), resp.Attestations[0].AttestatorId) require.Equal(t, mockChainID, resp.Attestations[0].AttestedData.ChainId) require.Equal(t, mockClientID, resp.Attestations[0].AttestedData.ClientId) - require.Equal(t, mockSignature, string(resp.Attestations[0].Signature)) s.Stop() diff --git a/testing/interchaintest/setup_test.go b/testing/interchaintest/setup_test.go index caf15ae..ddc063e 100644 --- a/testing/interchaintest/setup_test.go +++ b/testing/interchaintest/setup_test.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "os" - "path" "strings" "testing" @@ -164,9 +163,8 @@ func (s *E2ETestSuite) setupSidecars() { attestorID := fmt.Sprintf("attestator-%d", i) sidecarConfig := config.Config{ - CosmosChains: chainConfigs, - AttestatorID: attestorID, - SigningPrivateKeyPath: "dummy", // Will be updated when we create the key + CosmosChains: chainConfigs, + AttestatorID: attestorID, } byteWriter := new(bytes.Buffer) @@ -184,25 +182,6 @@ func (s *E2ETestSuite) setupSidecars() { }, []string{}) s.Require().NoError(err, string(stdOut), string(stdErr)) - // Create the attestator signing key - stdOut, stdErr, err = sidecar.Exec(s.ctx, []string{"attestation-sidecar", "signing-keys", "create", "--home", "/home/sidecar"}, []string{}) - s.Require().NoError(err, string(stdOut), string(stdErr)) - - // Generate registration file - stdOut, stdErr, err = sidecar.Exec(s.ctx, []string{ - "attestation-sidecar", - "generate-register-attestator-json", - "--home", - "/home/sidecar", - }, []string{}) - s.Require().NoError(err, string(stdOut), string(stdErr)) - registrationFileName := fmt.Sprintf("register-attestator-%d.json", i) - err = val.WriteFile(s.ctx, stdOut, registrationFileName) - s.Require().NoError(err) - - _, err = val.ExecTx(s.ctx, "validator", "attestationconfig", "register-attestator", path.Join(val.HomeDir(), registrationFileName)) - s.Require().NoError(err) - err = sidecar.CreateContainer(s.ctx) s.Require().NoError(err) diff --git a/testing/rollupsimapp/ibc.go b/testing/rollupsimapp/ibc.go index fed11d8..685dc4d 100644 --- a/testing/rollupsimapp/ibc.go +++ b/testing/rollupsimapp/ibc.go @@ -124,7 +124,7 @@ func (app *RollupSimApp) registerIBCModules(appOpts servertypes.AppOptions) erro smLightClientModule := solomachine.NewLightClientModule(app.appCodec, storeProvider) clientKeeper.AddRoute(solomachine.ModuleName, &smLightClientModule) - attestationLightClientModule := attestationlightclient.NewLightClientModule( + attestationLightClientModule, _ := attestationlightclient.NewLightClientModule( app.appCodec, storeProvider, attestationconfigkeeper.NewAttestatorHandler(app.AttestationConfigKeeper), diff --git a/testing/scripts/serve-sidecar.sh b/testing/scripts/serve-sidecar.sh index e43bc88..d85aed0 100755 --- a/testing/scripts/serve-sidecar.sh +++ b/testing/scripts/serve-sidecar.sh @@ -37,7 +37,6 @@ fi echo "Creating sidecar config" cat < $SIDECAR_DIR/config.toml attestator_id = 'your-attestator-id' -private_key_path = 'will-be-updated' [[cosmos_chain]] chain_id = 'rollupsimapp-1' @@ -66,26 +65,9 @@ gas_adjustment = 1.5 EOF -echo "Creating signing key" -$BINARY signing-keys create --home $SIDECAR_DIR - echo "Setting up keys on sidecar keychain" echo "$ALICE_MNEMONIC" | $BINARY keys add alice --recover --home $SIDECAR_DIR --keyring-backend test --address-prefix simapp -echo "Creating registration json" -$BINARY generate-register-attestator-json --home $SIDECAR_DIR > register-attestator.json - -echo "Registering attestator" -TX_HASH=$(simappd tx attestationconfig register-attestator register-attestator.json --from validator --chain-id simapp-1 --keyring-backend test --home /tmp/simapp-1 --gas auto --gas-adjustment 1.5 --gas-prices 0.025stake --output json -y | jq -r ".txhash") -sleep 5 -RES_CODE=$(simappd q tx $TX_HASH --output json | jq -r ".code") -if [ "$RES_CODE" != "0" ]; then - echo "Error: Attestator registration failed: $RES_CODE" - exit 1 -fi - -rm register-attestator.json - echo "Creating light clients" $BINARY relayer create clients rollupsimapp-1 tendermint simapp-1 attestation --home $SIDECAR_DIR @@ -98,4 +80,4 @@ echo "Creating connections" $BINARY relayer create connections rollupsimapp-1 simapp-1 --verbose --home $SIDECAR_DIR echo "Creating channels" -$BINARY relayer create channels rollupsimapp-1 connection-0 transfer ics20-1 simapp-1 connection-0 transfer --home $SIDECAR_DIR \ No newline at end of file +$BINARY relayer create channels rollupsimapp-1 connection-0 transfer ics20-1 simapp-1 connection-0 transfer --home $SIDECAR_DIR diff --git a/testing/simapp/ibc.go b/testing/simapp/ibc.go index be3c2e8..d69d90e 100644 --- a/testing/simapp/ibc.go +++ b/testing/simapp/ibc.go @@ -36,7 +36,7 @@ import ( ) // registerIBCModules register IBC keepers and non dependency inject modules. -func (app *SimApp) registerIBCModules(appOpts servertypes.AppOptions) error { +func (app *SimApp) registerIBCModules(_ servertypes.AppOptions) error { // set up non depinject support modules store keys if err := app.RegisterStores( storetypes.NewKVStoreKey(capabilitytypes.StoreKey), @@ -125,7 +125,7 @@ func (app *SimApp) registerIBCModules(appOpts servertypes.AppOptions) error { smLightClientModule := solomachine.NewLightClientModule(app.appCodec, storeProvider) clientKeeper.AddRoute(solomachine.ModuleName, &smLightClientModule) - attestationLightClientModule := attestationlightclient.NewLightClientModule( + attestationLightClientModule, trustedUpdateClientFunc := attestationlightclient.NewLightClientModule( app.appCodec, storeProvider, attestationconfigkeeper.NewAttestatorHandler(app.AttestationConfigKeeper), @@ -141,7 +141,7 @@ func (app *SimApp) registerIBCModules(appOpts servertypes.AppOptions) error { ibctm.NewAppModule(tmLightClientModule), solomachine.NewAppModule(smLightClientModule), attestationlightclient.NewAppModule(attestationLightClientModule), - attestationve.NewAppModule(app.IBCKeeper.ClientKeeper, app.appCodec), + attestationve.NewAppModule(trustedUpdateClientFunc, app.appCodec), ); err != nil { return err }